Measurement-computing DAQFlex User Guide Manuale Utente Pagina 13

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 125
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 12
DAQFlex Software User's Guide Using DAQFlex Software
13
Writing to an analog output channel
C#
// Write a value to analog output channel 0
String[] Devices;
DaqDevice MyDevice;
try
{
// Get a list of message-based DAQ devices
Devices = DaqDeviceManager.GetDeviceNames(DeviceNameFormat.NameAndSerno);
// Get a DaqDevice object for device 0
MyDevice = DaqDeviceManager.CreateDevice(Devices[0]);
// Send device messages
MyDevice.SendMessage("AO{0}:RANGE=BIP10V");
MyDevice.SendMessage("AO:CAL=ENABLE");
MyDevice.SendMessage("AO:SCALE=ENABLE");
MyDevice.SendMessage("AO{0}:VALUE=2.53");
}
catch (Exception ex)
{
// handle error
label1.Text = ex.Message;
}
VB
' Write a value to analog output channel 0
Dim Devices As String()
Dim MyDevice As DaqDevice
Try
' Get a list of message-based DAQ devices
Devices = DaqDeviceManager.GetDeviceNames(DeviceNameFormat.NameAndSerno)
' Get a DaqDevice object for device 0
MyDevice = DaqDeviceManager.CreateDevice(Devices(0))
' Send device messages
MyDevice.SendMessage("AO{0}:RANGE=BIP10V")
MyDevice.SendMessage("AO:CAL=ENABLE")
MyDevice.SendMessage("AO:SCALE=ENABLE")
MyDevice.SendMessage("AO{0}:VALUE=2.53")
Catch Ex As Exception
' handle error
Label1.Text = Ex.Message
End Try
Vedere la pagina 12
1 2 ... 8 9 10 11 12 13 14 15 16 17 18 ... 124 125

Commenti su questo manuale

Nessun commento