LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling digital I/O's on USB-6009-OEM

Solved!
Go to solution

Hello.

I'm using a USB-6009-OEM in a project I'm working on.

And I have a quick question in regards to controlling the I/O's on the DAQ.

Currently, to be able to control each I/O individually, I'm opening a task for each and every I/O at the start of the program, and tucking them away in a cluster for later use.  But my Open Task VI is starting to grow considerably in size.  So I'm curious to know if this really is the best way to do this.  Is opening a task for every I/O the only way to do it, if you want to be able to write to a pin without messing with the values on the other pins on the port?

BR,

Øystein Johnsen.

0 Kudos
Message 1 of 5
(2,681 Views)

Hi Øystein,

 

you can combine all pins of a port in one DAQmx task.

When you output a new value for a single pin you need to keep track of the other pin's state and combine them to one value by (boolean) ORing them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,669 Views)

Hi GerdW.

I'm not exactly sure what you mean by combining the other pins' values by ORing them, and what this would accomplish.

Do you mean reading out the port values first, then setting the relevant pin value to whatever state, and then writing the port values again?

BR,

Øystein.

0 Kudos
Message 3 of 5
(2,664 Views)
Solution
Accepted by topic author ojohnsen79

Hi Øystein,

 

no, you don't need to read out any port values.

 

You need to keep track of them in your VI by storing the previous values in a shift register!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(2,657 Views)

Hi.

Yes, that would work, I guess.  I'll keep that in mind if the amount of tasks grows out of hand. 🙂

Thanks for the idea!

BR,

Øystein.

0 Kudos
Message 5 of 5
(2,654 Views)