NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Toggling individual Output Lines on DAQ

Hi,

 

This may be an easy question to answer but I cannot figure it out.

 

I am using a USB-6501 DAQ. I have created the VI in which I can toggle the individual output lines on the DAQ (all digital IO are set as outputs).

 

Here is my issue:

 

When I am calling the VI in TestStand, I do not know how to toggle a line without affecting the others. For example, I have output lines 0-7. In order for me to toggle it in Labview, I only need to click on the one i want to toggle. In TestStand, I am calling the VI but I believe I need to set them all and I cannot just change one line.....I do not want to affect the state of the others. This really creates a problem if I am using a parallel sequence model.

 

Im sure one way would be to created a VI for each individual output, but I am not 100% sure on how to do that. Also, I can't use the same sequence and call a different VI for each parallel instance.

 

Thanks for the help,

Ryan

 

0 Kudos
Message 1 of 4
(3,441 Views)

One possibility is to use a byte to keep track of the state of the digital outputs.  To toggle a bit, xor the byte with the bit position you want to toggle.  To toggle bit 2 for example XOR the byte with 00000100 or 0x04.  To reset the bit use AND with the other bits set to 1, to set a bit use OR with a set bit. 

 

Write the byte to the digital outputs after manipulating the desired bit.

 

Thanks,

Jim

0 Kudos
Message 2 of 4
(3,423 Views)

Thanks Jim,

 

I wll give it a shot and let you know how it goes.

 

Ryan

 

0 Kudos
Message 3 of 4
(3,404 Views)

JIm,

 

I believe I found an easier way. I was investigating what you proposed and I noticed DAQmx create channel function and DAQmx write function. I believe I can simply do this by calling the appropriate channel and toggling it high or low. It seems to be working fine.

 

Thanks,

Ryan

 

0 Kudos
Message 4 of 4
(3,389 Views)