Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx.Device problem

Trying C# from Delphi and early days yet. (Visual Studio C# 2005 Express and NI-DAQ8.1)

My understanding, from looking at the help files is that when you have

NationalInstruments.DAQmx.Device.

there would then be a list of associated properties and methods, but all I see are Equals and Reference Equals in the autocomplete list.

I have my test program working to show the devices

private void button1_Click(object sender, EventArgs e)
{
object devarray;
int devcount;


devcount = NationalInstruments.DAQmx.DaqSystem.Local.Devices.Length;

MessageBox.Show("Devices " + devcount.ToString());

for (int i = 0; i <= devcount - 1; i++)
{
devarray = NationalInstruments.DAQmx.DaqSystem.Local.Devices.GetValue(i);

MessageBox.Show(devarray.ToString());
// NationalInstruments.DAQmx.Device. ---->>>????
}



}

so I assume I have loaded everything I need to ( the dlls from the DotNet directory)

Any ideas anyone


Thanks

Andy
0 Kudos
Message 1 of 3
(2,900 Views)
NI.DAQmx.Device is a class, not a property. You need to set it up as follows:

using NationalInstruments.DAQmx; //namespace at the top

.
.
.

Device test = DaqSystem.Local.LoadDevice("\\Dev1");
DeviceBusTypebus = test.BusType; //for example

Bilal Durrani
NI
Message 2 of 3
(2,898 Views)
OK Bilal

Got it going now (it didn't like the \\ in \\Dev1 btw.)

Thanks

Andy
0 Kudos
Message 3 of 3
(2,889 Views)