Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Browse DAQmx Devices?

I know that it is possible to browse and retrieve information for DAQmx devices within LabVIEW.  However, I would like to do the same within my MS 8.0.1 application.

An example of how this is done in LabVIEW:

Discussion Thread for browsing DAQmx devices in LabVIEW

VI that can retrieve DAQmx information in LabVIEW

Any advice on how to do this in LabVIEW would be appreciated.  Also, are all of the property node classes accesible through Measurement Studio?

Thanks!
CLA, CTA
0 Kudos
Message 1 of 6
(5,521 Views)
Hi LVB,
 
Programmatically retrieving information about DAQmx devices from the DAQmx for .NET API is fairly easy once you know where to look.  The following C# code sample demonstrates this:
 

foreach (String deviceName in DaqSystem.Local.Devices)
{    
    Device
d = DaqSystem
.Local.LoadDevice(deviceName);    
    StringBuilder
s = new StringBuilder
();    
    s.AppendLine(
"DeviceID = "
+ d.DeviceID);    
    s.AppendLine(
"Simulated = "
+ d.IsSimulated);    
    s.AppendLine(
"Product Category = "
+ d.ProductCategory);    
    s.AppendLine(
"Product Number = "
+ d.ProductNumber);    
    s.AppendLine(
"Product Type = "
+ d.ProductType);    
    s.AppendLine(
"Bus Type = "
+ d.BusType);    
    MessageBox
.Show(s.ToString());
}

Or in VB.NET:

For Each deviceName As String In DaqSystem.Local.Devices
    Dim d As
Device = DaqSystem.Local.LoadDevice(deviceName)
    Dim s As StringBuilder = New
StringBuilder()
    s.AppendLine(
"DeviceID = "
+ d.DeviceID)
    s.AppendLine(
"Simulated = "
+ d.IsSimulated.ToString())
    s.AppendLine(
"Product Category = "
+ d.ProductCategory.ToString())
    s.AppendLine(
"Product Number = "
+ d.ProductNumber.ToString())
    s.AppendLine(
"Product Type = "
+ d.ProductType)
    s.AppendLine(
"Bus Type = "
+ d.BusType.ToString())
    MessageBox.Show(s.ToString())
Next

This example will display a message box giving information on each device present on your system.  I believe this should answer your question.

Hexar Anderson
Measurement Studio Staff Software Engineer
National Instruments
Message 2 of 6
(5,501 Views)
Is there any way to read Compact FieldPoint device configurations from a VB.NET application?

I'd like to be able to dynamically load the available channels and their names to be used in a test configuration management application.
0 Kudos
Message 3 of 6
(5,387 Views)
webcmc,

When you say that you will be using this as a test system, do you always expect to have the same modules in the different cFP chassis? I know it is possible to use the .NET class library to communicate with I/O points on your FieldPoint bank (Communicating with FP modules with VB .NET). I also know that you can obtain a channel listing in LabVIEW (Accessing available FieldPoint I/O points) but I am not certain if this functionality exists for VB.NET. I will do some digging into this API to determine if this is possible. Please post back to this forum if you have any further insight into this capability. Thanks,

-Mike
0 Kudos
Message 4 of 6
(5,355 Views)
I would also like to know if it's possible in MS 8.0.1 to retrieve information from a compact fieldpoint device (cfp-1808).
 
Thanks
0 Kudos
Message 5 of 6
(5,091 Views)
Hi Crusader,

The best way to communicate with your compactFieldPoint devices is through an OPC server. An OPC server is installed automatically when you install the cFP drivers. Take a look at the following documents and examples, which will explain further:

Can I Use Microsoft Visual C++ 6.0 and/or Visual C++ .NET with My FieldPoint Modules?

Reading Data from an OPC Server using DataSocket in Visual Basic
 
Creating a DataSocket Reader/Writer with Measurement Studio ActiveX Controls in Visual C#
 
Developing Industrial Automation Applications using Visual Basic .NET and OPC
 
Developing an OPC Client Application Using Visual Basic
 
Cheers.

Michael K.

| Michael K | Project Manager | LabVIEW R&D | National Instruments |

0 Kudos
Message 6 of 6
(5,074 Views)