Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How test tasks & device relationship; so to associate a device with a pre-configured task.

I used M/A Explorer to create a set of tasks for a turnkey system that i built that uses a USB-6501 and a USB-9211.   The system is controlled by a C# NetFrameworks app' that i wrote and is hosted by Windows XP.  The said app' was written to resource the said tasks.   The system performs well and we r very happy with it.  Now, we built a 2nd such system using all new hardware and have come to discover that the existing tasks "are married" to the original NI hardware (of the first system).   I don't want to maintain two copies of the app'; i.e. one programmed for use with the tasks corresponding to the original hardware and one with tasks corresponding to the new hardware.  I see to programming options that could serve as a solution:

1. The app' compares and matches resident tasks with the connected hardware and loads the existing tasks that correspond.

2. The app' verifies that both a USB-9211 and a USB-6501 are connected and the creates the needed tasks accordingly.  This way sounds most attractive as the app' will thusly accommodate a "replaced module" situation.

 

Please point me n the right direction such that i can program either (the chosen) solution in C#.

 

0 Kudos
Message 1 of 2
(2,371 Views)

Hi GLennXS,

 

I believe that you are falling into this issue because your tasks created in Measurement and Automation Explorer (MAX) have their channels configured for a specific device number and channel. Therefore, if you connect your hardware to another PC, your computer might assign it a different device number depending on what devices were previously connected to that computer, in which case, your program will not be able to correlate the tasks to the right hardware. So although running different tasks according to the hardware device name may be one possible solution, it seems somewhat redundant to have the multiple tasks which perform the same action but for different hardware or device number. I believe that the better solution would be to program out your tasks in C# using the DAQmx .NET API and have a control on your GUI which the user can select the hardware and channel he/she wants to use.

 

To help you get started, you can take a look at some of our C# DAQmx shipping examples under C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples. Also for more information on the DAQmx .NET API, please refer to the NI-DAQmx .NET Framework 2.0 Help under Start » All Programs » National Instruments » NI-DAQ.

 

I hope this helps.

S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(2,350 Views)