Measurement-computing DAQFlex User Guide Manuale Utente Pagina 10

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 125
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 9
DAQFlex Software User's Guide Using DAQFlex Software
10
VB
Dim deviceNumber As Integer
Dim device As DaqDevice
Dim deviceName As String
deviceNumber = 0
deviceName = deviceNames(deviceNumber)
device = DaqDeviceManager.CreateDevice(deviceName)
4. Once you have a DaqDevice object, use the SendMessage() method to program your DAQFlex-
supported device.
C#
DaqResponse response;
response = device.SendMessage("AI{0}:RANGE=BIP10V"); // set the input range for channel 0
response = device.SendMessage("?AI{0}:VALUE"); // read a single value from channel 0
VB
Dim response As DaqResponse
response = device.SendMessage("AI{0}:RANGE=BIP10V") ' set the input range for channel 0
response = device.SendMessage("?AI{0}:VALUE") ' read a single value from channel 0
The DaqResponse object contains a method for getting the response as a string and a method for
getting the response as a numeric.
To get the response as a string, use the ToString() method:
C#
string value = response.ToString();
VB
Dim value As String
value = response.ToString()
To get the response as a numeric, use the ToValue() method:
C#
double value = response.ToValue();
VB
Dim value As Double
value = response.ToValue()
If the response does not contain a numeric value, ToValue() returns Double.NaN.
When you no longer need the DaqDevice object, you can release it by calling the ReleaseDevice()
method:
C#
DaqDeviceManager.ReleaseDevice(device);
VB
DaqDeviceManager.ReleaseDevice(device)
Vedere la pagina 9
1 2 ... 5 6 7 8 9 10 11 12 13 14 15 ... 124 125

Commenti su questo manuale

Nessun commento