Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Masking DAQ output

I'm programming the NI 6503 DIO card using LABWindows/CVI. If I want to set/clear specific bits in the DAQ output without altering the other bits in the pattern, can I set the direction to "Bidirectional" and then read the DAQ bit-pattern, mask it accordingly, and then write the new pattern back to the DAQ? For example, if I wished to simply clear bit O of the pattern could I do something like this (if I was in bidirectional mode):

DIG_In_Prt(boardNumber, portNumber, &bitPattern);
bitPattern &= 0xFE;
DIG_Out_Prt(boardNumber, portNumber, bitPattern);
0 Kudos
Message 1 of 2
(2,466 Views)

Hello Vik,

If you call DIG_Out_Prt(boardNumber, portNumber, bitPattern);  with bitPattern set to FE, you will write a 0 to bit 0 and 1 to bits 1:7.  To write to bit 0 only, try calling Dig_Out_Line.

Let me know if this does not work.


Regards,
Sean C.

0 Kudos
Message 2 of 2
(2,441 Views)