Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Daq traditional to Daq mx port config

I previously used the traditional DAQ Port Config to generate and return an array of 12 task ID's from my old DIO96 card. Some of the 12 ports were digital input some output and were specified by sending an array of (0 read, 1 write) 12 length data. This array in , array out function would then be compiled into a dll and could then be used on different programs called by TestStand. The dll would therefore be able to specify either read or write of either of the 12 ports by sending an array to it.

When transfering to Daq mx there is no Port Config icon but a create channel one. My question is how do I change the new Daq mx 'Create channel' icon for either a read or write configuration dynamicaly? What is the best way to do this?

 

 

0 Kudos
Message 1 of 6
(3,831 Views)

Hi Steve H,

 

Thank you for contacting National Instruments. With DAQmx you should have no difficulty changing the assignment of channel on you DAQ device. I have attached a VI that uses a case structure to flick between Digital Input to Digital output. Both tasks have similar architecture -> Setup task, setup timing, start task, finish and clean up task. 

 

Please let me know how you get along with using the attached code.

 

Many thanks

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,812 Views)

Sorry cannot open your vi as it is a new version of LabView; I only have version 7.1. Also if I only want one digital write rather than a loop then can I omit the 'start', 'finish' & 'clean' icons as they seem pointless? Also the TaskID on the traditional Daq is a decimal number and the Daqmx has something else for some reason; can this be converted back to decimal?

 

 

 

 

0 Kudos
Message 3 of 6
(3,810 Views)

Hi Steve H,

 

Please find attached a 7.1 version of the code. I believe you will still need to include the Start, stop and clean VIs as these will release the resource to get re-allocated.

 

I shall look into Task ID for you.

 

Many thanks,

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(3,805 Views)

Hi Steve H,

 

I have had a look at the Task ID for you and I have a couple of suggestions. 

 

Firstly, the Task ID from Traditional DAQ has been replaced with the "Task Out" terminal. This outputs a DAQmx Task Name data type, which is a close approximation to a String. In order to get the data back, you could use a Flatten to string or a Type Cast function. 

 

I do feel however, you are not going to get any meaningful data back from this approach.  I would ask why you wish to use a number instead of the Task out data type as the DAQmx Task Name is compatible with TestStand so you should have no problem with this.

 

There are a couple of article which may help you change your code from Traditional DAQ to DAQmx and some details on the different naming structures that are used in Tradtional DAQ and DAQmx

 

Please let me know your thoughts.

 

Many thanks, 

 

 

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 5 of 6
(3,784 Views)

Thanks for the LabView code, seems to work.

The reason I wanted the TaskID data type to be decimal so it is the same as the traditional Daq. This is because I have a TestStand program that has 1000 or so tests in it each calling a dll written in LabView, where one of the parameters is the TaskID (as decimal). In this program I have one call to config the ports, this returns the decimal TaskID as a parameter which is then held as a variable; this variable is then sent when required to either a write or read port function within the dll. If the Task Id is a different type then not only will I have to rewrite the LabView dll but also 1000 lines of TestStand as the TaskID parameter is of a different type.  

 

0 Kudos
Message 6 of 6
(3,778 Views)