From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

digital I/O output port state

I want to write individual bits on a port using a 6503 DI/O board. Rather than having 8 tasks, I would like to create 1 task and mask the bits to write. To do this I need to get the current state of the port without reconfiguring. Is there a way to read the current state of an output port?
 
It looks to me like I will either need a seperate task for each bit or keep track of the state each time I write the port.
0 Kudos
Message 1 of 2
(3,068 Views)

Hi,

 

Thank you for posting to the NI forums.  Unfortunately, you can’t read from a digital output line without first stopping the task, and then creating a digital input task.  Instead, as you mentioned in your post, I would recommend just keeping track of your digital output lines using software.  You can easily create a multi-channel digital output task by entering the physical channel string in the following format: “Dev1/port0/line0:7”. 

 

I hope this helps.  Please post back if you have further questions.

 

Ed W.

Applications Engineer

National Instruments

 

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