LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

digital output 1 sec ON - 9 sec OFF

Solved!
Go to solution

Hello Friends,

 

I am new to LabView.

And I am working on an project where I have to control 6 relay via data acquision digital output lines.(USB-6353)

Each relay will be ON for 1 sec and OFF for 9 sec. But they all should be out of phase. So only 1 relay is ON at a time.

 

Can someone help me with doing this in Labview. 

 

Thank you.

0 Kudos
Message 1 of 24
(3,113 Views)

Hi sky,

 

you just need to output that array using DAQmx functions:

check.png

Best regards,
GerdW


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

Hi GerdW,

Thank you for your reply.

 

But for now I was busy with the this VI. The outputs a digital pulse 1sec on and 9 sec off. I copied it once to use 2 channels and was thinknig to delay it by 1 sec inside while loop.

 

But I just want the output on both the digital channel with just one button click, hopefully you can help me with it.

 

Thanks again.

0 Kudos
Message 3 of 24
(3,054 Views)

Hi sky,

 

could you please downconvert your VI to LV2011?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 24
(3,046 Views)

Hi,

 

Here please find the LV2011 version.

 

Thanks,

Kind Regards

0 Kudos
Message 5 of 24
(3,042 Views)

Hi sky,

 

did you notice the snippet I attached yesterday? It shows how to use an array to hold the status of 6 LEDs in just one wire…

 

You should do the same with your VI. Handling each single DO in it's own loop is pure overkill - some might say RubeGoldberg! DAQmx can handle more than one DO per task, so give it a try…

 

Btw. are you sure you need your "wait loops" to iterate once per millisecond?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 24
(3,035 Views)

Hi,

 

Thanks for your reply.

If i could start both of the digital output with one button.

then I will use the wait loop in the 2nd output to be 1000ms, so when the 1st output goes low then 2nd will go high.

 

and if i add a third output then i will use the wait loop to be 3000ms, so it will go high when 2nd goes low.That's what I was thinking to do.

 

Do you maybe have a VI of the snippet you attached? And how can I use to output it to the digital channels ?

 

Thank you.

Kind regards,

0 Kudos
Message 7 of 24
(3,030 Views)

Hi sky,

 

instead of hardcoding each and every delay between the channels you should think about a simple state machine approach:

Have one state for the delay and another state(s) for switching the outputs…

 


Do you maybe have a VI of the snippet you attached?


Just copy the snippet to your harddisc, then drag&drop it into your block diagram. That's how snippets work…

 

 


And how can I use to output it to the digital channels ?


You just output the "LED" array with DAQmxWrite…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 24
(3,026 Views)

Hi,

 

Any example VI, to understand it better ?

 

Thank you,

Kind Regards,

 

0 Kudos
Message 9 of 24
(3,015 Views)

Hi sky,

 

open the example finder and look for example VIs that demonstrate the output of more than just one DO signal…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 24
(3,012 Views)