National Instruments 373392C-01 Instrukcja Użytkownika Strona 129

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 179
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 128
Chapter 5 Getting Started with Measurement Studio
© National Instruments Corporation 5-25 Measurement Studio User Manual
Return values
End Function
Sub Main()
Const location As String = "\\localhost\system\double"
Dim bufferedWriter As NetworkVariableBufferedWriter(Of Double()) =
New
NetworkVariableBufferedWriter(Of Double())(location)
bufferedWriter.Connect()
Dim phase As Integer = 0
While (True)
Dim values As Double() = GenerateDoubleArray(phase)
Console.WriteLine("Writing Array")
bufferedWriter.WriteValue(values)
Thread.Sleep(500)
phase = phase + 1
End While
End Sub
End Module
[C#]
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using NationalInstruments.NetworkVariable;
namespace NetworkVariableWriter
{
class Program
{
private static double[] GenerateDoubleArray(double phase)
{
double[] values = new double[1000];
for (int x = 0; x < 1000; x++)
values[x] = Math.Sin(((2 * Math.PI * x) / 1000) + phase) * 2;
return values;
}
static void Main(string[] args)
{
const string Location = @"\\localhost\system\double";
NetworkVariableBufferedWriter<double[]> bufferedWrite = new
NetworkVariableBufferedWriter<double[]>(Location);
bufferedWrite.Connect();
int phase = 0;
while (true)
{
double[] value = GenerateDoubleArray(phase);
Console.WriteLine("Writing array");
Przeglądanie stron 128
1 2 ... 124 125 126 127 128 129 130 131 132 133 134 ... 178 179

Komentarze do niniejszej Instrukcji

Brak uwag