Measurement-computing DAQFlex User Guide Manuale Utente Pagina 9

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 125
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 8
9
Chapter 2
Using DAQFlex Software
The following procedure describes how to program a DAQFlex-supported device with DAQFlex software.
1. Add a reference to the DAQFlex assembly to your project.
o In Visual Studio and MonoDevelop, this assembly is listed under the .NET tab of the Add
Reference dialog as DAQFlex API.
If your project is a C# project, add the following statement to your source file:
using MeasurementComputing.DAQFlex;
2. Get a list of device names using the static method GetDeviceNames():
C#
string[] deviceNames;
deviceNames = DaqDeviceManager.GetDeviceNames(DeviceNameFormat.NameAndSerno);
VB
Dim deviceNames As String()
deviceNames = DaqDeviceManager.GetDeviceNames(DeviceNameFormat.NameAndSerno)
GetDeviceNames gets the names of DAQFlex devices detected by the DAQFlex API. DeviceNameFormat
is an enumeration that specifies the format of the returned values. This enumeration defines four
different formats:
Member Name
NameOnly
NameAndSerno
NameAndID
NameSernoAndID
Note: Each DAQFlex API method will throw an exception if an error occurs, and should be enclosed
within a Try/Catch block.
3. Get a device object using the static method CreateDevice():
C#
int deviceNumber = 0;
DaqDevice device;
string deviceName = deviceNames[deviceNumber];
device = DaqDeviceManager.CreateDevice(deviceName);
Vedere la pagina 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... 124 125

Commenti su questo manuale

Nessun commento