Measurement-computing DAQFlex User Guide Manuel d'utilisateur Page 19

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 125
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 18
DAQFlex Software User's Guide Using DAQFlex Software
19
' Stop the counter
MyDevice.SendMessage("CTR{0}:STOP")
Catch Ex As Exception
' handle error
Label1.Text = Ex.Message
End Try
Reading hardware-paced I/O
The basic approach to programming analog input scans is to set the device's scan properties, send the
START command, and call the ReadScanData() method. The following examples show how to program a
basic input scan.
C#
try
{
double[,] scanData;
string[] names = DaqDeviceManager.GetDeviceNames(DeviceNameFormat.NameAndSerno);
DaqDevice device = DaqDeviceManager.CreateDevice(names[0]);
device.SendMessage("AISCAN:LOWCHAN=0");
device.SendMessage("AISCAN:HIGHCHAN=0");
device.SendMessage("AISCAN:RATE=1000");
device.SendMessage("AISCAN:SAMPLES=5000");
device.SendMessage("AISCAN:START");
scanData = device.ReadScanData(5000, 0);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
VB
Try
Dim ScanData As Double(,)
Dim Names As String()
Dim Device As DaqDevice
Names = DaqDeviceManager.GetDeviceNames(DeviceNameFormat.NameAndSerno)
Device = DaqDeviceManager.CreateDevice(Names(0))
Device.SendMessage("AISCAN:LOWCHAN=0")
Device.SendMessage("AISCAN:HIGHCHAN=0")
Device.SendMessage("AISCAN:RATE=1000")
Device.SendMessage("AISCAN:SAMPLES=5000")
Device.SendMessage("AISCAN:START")
ScanData = Device.ReadScanData(5000, 0)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
Vue de la page 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 124 125

Commentaires sur ces manuels

Pas de commentaire