Showing results for 
Search instead for 
Did you mean: 

Adding a pulse (train? timer?) to digital output pulse VI.



I've searched around, but am still a bit comfused, my new question is:


Is it possible to add more elements to my code in order to have a second (or third) pulse occur right after the first one. Ideally with the number of pulses editable, and the time between pulses editable (will probably be limited by my solenoid valve vs. my DAQ). If so, could anybody help?


I've attached my current VI and an image.


Thank you in advance for any assistance.

Download All
0 Kudos
Message 1 of 21

So the answer to all of your questions so far would be YES.


The following is a pretty simple method of controlling pulses and pulse length, I'm sure that you should be able to figure out how it applies to you, I would recommend replacing the flat sequence with a case structure controlled by the boolean, on the true case trigger your solenoid, and on the false case wait.



Message 2 of 21
(2,573 Views) thanks for your suggestion. 


Attached is my attempt. I took your advice of using a case structure and threw in a wait timer. In my screenshot it's set to 3 sec (3000ms) so I could audibly test it. This set up allows me to press the Boolean, it then waits 3s and then runs for 500ms then shuts off. 


I'm not too good at LabView, do you have any suggestions on how to instead have clicking the Boolean button run true for 500ms (or whatever amount), and then wait x-seconds (maybe 3s), then run true again,then false etc for y amount of times before stopping fully?

0 Kudos
Message 3 of 21

There are many different ways of doing what you want, however for now we will go with the simplest version. When using the event structure, you do not need to have the boolean controlling anything, it is simply read when the event occurs, so you could just wire true to your boolean assuming that you have the switch set up mechanically to be a latch.



Message 4 of 21

What is that z(loops) thing circled in my attached image?

      Edit: looks like it's a control? I think my LabView may be a slightly different version or something.

Also is the X(pulse) not attached anything (also circled)?



0 Kudos
Message 5 of 21

X is the length of time that you want to run to the Pulse length control. Z(loops) is the number of times that the loop will repeat itself, with 0 being not at all.

0 Kudos
Message 6 of 21

Thanks, so I've got crazy structures going on. Currently this operates as if the pulse doesn't exist, but I'm trying to inch my way closer to a working solution. 


I have the Z(loops) set to 2 for now. X(pulse) set to 2 also (two pulses in theory). With a Y(wait) = 3000ms. 


I think it's exiting a loop too early before the pulse can even start. Suggestions? Thank you for all your help, I really appreciate it. I wish my university used this program more.

0 Kudos
Message 7 of 21

Can you just clarify for me something, how do you control the length of time that the valve is turned on? I probably should have asked earlier as I am unable to get a good look at your code as I am using an older version of labview.

0 Kudos
Message 8 of 21

Sorry for the super late reply. 


If you look at my original screenshot (screenshotvi.jpg attached again), you will see 500 value representing 500ms. Adjusting that adjusts how long the DO from the DAQ is on. After that it automatically turns off.


I'm still working on modifying my code to include the pulse. Thanks!

0 Kudos
Message 9 of 21

I'm still having difficulty getting a pulse to work. I feel there must be a relatively simple solution.


If you see the attached screenshotvi4.jpg, you'll see the numeric constant "500" going into the T/F comparison. The 500 represents 500ms. Once 500ms has occured, I presume it triggers False and the DO from the DAQ assistant turns off. 


Is there a way to have the output signal be TRUE for x-seconds, then FALSE for y-seconds, then TRUE/FALSE again z-amount of loops? Maybe a T/F Boolean is inappropriate in this situation, but rather a switch to begin a square wave would be better? 


A square wave of either 0 or 1 with width and delay. Where 0 triggered off and 1 triggered off?


Any help further help is greatly appreciated.

0 Kudos
Message 10 of 21