cancel
Showing results for 
Search instead for 
Did you mean: 

Generate continuous digital output

SOLVED
john_84112
Member
Solved!

Generate continuous digital output

Hello Everyone,

 

I'd like to generate continuous digital output using a NI USB-6002 through P0.0 - P0.3. The output will be 0001 -->0010 --> 0100 --> 1000 --> 0001 --> 0010 --> 0100 --> 1000 --> ...... Can anyone help to implement it in LabVIEW?

 

Thank you,

 

John

8 REPLIES 8
ZYOng
Trusted Enthusiast

Re: Generate continuous digital output

You can refer to shipping examples at Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Digital Output

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
JÞB
Knight of NI

Re: Generate continuous digital output


@john_84112 wrote:

Hello Everyone,

 

I'd like to generate continuous digital output using a NI USB-6002 through P0.0 - P0.3. The output will be 0001 -->0010 --> 0100 --> 1000 --> 0001 --> 0010 --> 0100 --> 1000 --> ...... Can anyone help to implement it in LabVIEW?

 

Thank you,

 

John


Hello John,

That sounds like a homework assignment so, we only give tips and answer questions about what you have attached from your attempts.  

 

TIP: an array of four elements could be used as an input to Rotate Array.  See what ideas that might start you looking at.


"Should be" isn't "Is" -Jay
Solution

Re: Generate continuous digital output

Certainly, John. You can create this sequence in LabVIEW using arrays and a loop. Start with a 4-element array [0001, 0010, 0100, 1000] and use a loop to continuously output these values through your NI USB-6002 on P0.0 - P0.3. If you face any issues, feel free to ask for help. Good luck!




Good Luck
Paybyplatema
.
john_84112
Member

Re: Generate continuous digital output

Hi Kevin,

 

Thank you for your advice. What I need is to generate digital outputs in P0.0, P0.1, P0.2, and P0.3 to control a 4x1 switch. When the outputs in these four terminals are 0001 (Low Low Low High), the switch will be connected to Ch1; When the outputs in these four terminals are 0010 (Low Low High Low), the switch will be connected to Ch2; When the outputs in these four terminals are 0100 (Low High Low), the switch will be connected to Ch3; When the outputs in these four terminals are 1000 (High Low Low Low), the switch will be connected to Ch4. The control will repeat the process until being stopped by pressing the STOP button. I can set a delay time in the loop to control the switching time. I wonder if you have any idea to implement this using logic gates in the loop with initial inputs of FFFT (i.e. 0001) in the loop?

 

Best,

 

John

john_84112
Member

Re: Generate continuous digital output

Thank you Jay. I have updated the requirements.

 

Best,

 

John

john_84112
Member

Re: Generate continuous digital output

Message contains an attachment

Please look at the attached diagram to see what I need.

Highlighted
john_84112
Member

Re: Generate continuous digital output

Thank you everyone. The problem has been solved.

 

GerdW
Knight of NI

Re: Generate continuous digital output

Hi John,

 


@john_84112 wrote:

Thank you everyone. The problem has been solved.


How did you solve the problem? It's a forum of volunteers living from solutions…

 

On your image from message #7: You need only one DAQmx task and only one shift register holding an array of booleans!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019