Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Self-Test C# API

I am interfacing to a NI USB-6361 and a NI USB-6525 using the C# API. I would like to build into my application a diagnostics function to test each DAQ, and I was thinking I should perform the same actions as done by NI MAX i.e. running the "Self-Test" function found on the "Devices and Interfaces" page.

 

What are these self test functions doing and which API functions do I need to use?

 

Also, what is the Configure function doing and what is the API call?

 

And finally, what is the best approach for my application to work out the name of each device? Currently the devices are named "Dev1" and "Dev2". I'm not sure how they got those names and I assume that there is no garantee that the devices would have the same name on a different machine. Is there a way to query the device to work out what it is based on something like a serial number? 

0 Kudos
Message 1 of 5
(4,907 Views)

Here are a couple of articles that may help you accomplish this. The first details the location of some Examples depending on what your setup is. I highly recommend looking for an example that may do exactly what you need. The second is about using NI-DAQmx in text based programming languages and at the bottom it states that further documentation can be found in the DAQmx Help in the installed files. 

 

Programming NI-DAQ in Visual C#

Using NI-DAQmx in Text Based Programming Environments 

 

As for performing a Self Test you would need to use the Self Calibrate function. That is what it is called according to the DAQmx Help. You should only need the one function and it will take care of everything for you. 

 

The Device Configuration functions are the Reset Device and the Self Test according to what I could find but there may be more to them with the Text Based. The exact api call can be found using the Help documentation while programming but I do not have the C# Libraries available. I believe that you should be able to locate the exact syntax you need in the help now. 

 

You can discover the available devices using the information found here:

Programatically Detect Device Information in C-Based Languages

 

Alex D
Systems Engineer
Academic Research
National Instruments
0 Kudos
Message 2 of 5
(4,883 Views)

Please,

 

M.E.A., our company, uses deeply National instruments.

 

Can somebody to tell me how to operate a self-test device from C# APIs, I simply could not find.

 

As I can easily reset a device (using NationalInstruments.DAQmx;    Device sample.Reset), how to self test a device.

 

Thanks for the help

 

Daniel 054 748 3270

0 Kudos
Message 3 of 5
(4,427 Views)

Hi,

 

Maybe these examples might help.

 

http://www.ni.com/example/29555/en/

 

 

Curt

0 Kudos
Message 4 of 5
(4,416 Views)

Hey dallouf,

 

Along with Curt's suggestion, you can also use the int32 DAQmxSelfTestDevice (const char deviceName[ ]); function to programmatically self-test a device.

 

For a list of all of the available C functions in DAQmx, including the definition for the Self-Test function above, take a look at the C Reference Help library. The Self-Test function is located in:

 

NI-DAQmx C Functions >> Advanced Functions >> Device Control >> DAQmxSelfTestDevice

 

I hope this helps.

 

Regards,

 

Ryan

Ryan P.
CLA
0 Kudos
Message 5 of 5
(4,395 Views)