LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use array to specify module & channels of DAQmx

First, forgive me if I’m not using the correct terminology.  My only experience with LabView was the Basic 1 & 2 classes I attended 5+yrs ago.

Attached is the VI I’m currently working on.  This was started by somebody else but I’ve been tasked to finish it.  I understand what is going on and how it works but I don’t know that I could build it from scratch.

What I need help with is using the text file to specify the output & input channels for a particular test.  I am using two (2) NI9265 0-20mA modules and three (3) NI9481 relay modules for outputs and two (2) NI9221 +/-60V for input in a NI cDAQ-9178 Chassis.   I’d like to address the relay module as a port using hex to make it easier to toggle multiple relays at one time using something similar to the “Write Dig Port.vi” example.   On the 0-20mA modules I’d like to use the same text file to specify two amplitudes (example: 6mA & 10mA) but here’s the real tricky part, I need all 8 channels to remain at 4mA except when the text file specifies something different (will not exceed 1 channel at one time).  Basically, I need the channel to step from 4ma to the first value speficied in the text file, si there long enough for the input module to take a measurement of the channels specified in the text file then step to the second value in the text file, take the same measurements and then return to 4mA.  Last but not least I need to specify the input module and channels that are to be read (will not exceed 6 channels at one time).

 

Thanks in advance for all your help!!

 

0 Kudos
Message 1 of 3
(2,168 Views)

You can use the "Write Dig Port" example for the outputs on your 9481. You can use the values from your text file with case structures to select which ports and values to write. You will probably need to use multiple tasks to address multiple modules/channels.

 

For the 9265 modules, you can use the example "Gen 0-20mA Current" found under Hardware Input and Output>>DAQmx>>Analog Generation>>Current. The input array to the DAQmx Write function can be used to specify how much current to output. This would be good time for a case structure as well. You can base the case structures off of the values you bring in from your text file for what modules/channels to write and what data to write to them.

 

If you have any specific questions about setting this up, please post them.

 

 

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
Message 2 of 3
(2,137 Views)

Thanks, that helped.  I'm still working on it so I'll wait until I'm comfortable I've got it figured out before I marked this solved.

0 Kudos
Message 3 of 3
(2,129 Views)