LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

If you build something similar to the image below does it work similarly to the event structure method?

Pulse Train.png

Message 11 of 21
(1,969 Views)

Ok! I may be making some progress. I feel like it's a little messy though. Please see my attached screenshot. 

 

Right now to operate I need to:

 

1. In the front panel first click the Boolean button ON so it is lit. 

2. Run program

 

Is there a way to make it so that I can:

 

1. Run program

2. Click boolean to start sequence

3. Have light on front panel show me when value is T/F so I know when valve is open (I can hear it, but visual would be nice)

 

Thanks a bunch for your help ogk.nz!

0 Kudos
Message 12 of 21
(1,959 Views)

Okay, I've cleaned it up a bit and added Boolean light indicators so I know when the valve is on/off. Please see attached screenshotvi6.jpg.

 

1. Does anything pop out as inefficient?

 

2. Currently when a frame comes up, the light turns ON, but never off. So at the end of the sequence of frames I have four lights on that need to be manually reset. Is there a way to have a single light that turns ON/OFF depending on which frame is active? Or is there a way to at least have the lights turn OFF once the next light turns on?

 

3. Currently I run the program, and the sequence starts immediately (which is why I put a 1000ms-WAIT as the first frame to give me a bit of time before the valve opens. Ideally, I would have a program where I click a button which would then activate the frame sequence. Is this possible?

 

Right now it is operational and as far as I can tell this will work for what I need. I really appreciate the help you've provided for me ogk.nz. From here on it will be refinements or making the program more efficient. 

 

Thanks,

Zack

0 Kudos
Message 13 of 21
(1,949 Views)

In you use the even structure that you had been using previously and place the structure inside the 'Boolean case that you were using for control previously you should be able to press the button and start. In this case you will not need to use the timeout change/timeout case at all. 

You don't need to use the boolean as a true constant at the start of the sequence, it only needs to be located within the "Boolean" case of the event structure so that it is read to reset the button.

Consider shifting to a For loop for tidiness and better control.

To show the indicator of the valve status you will need to use a local variable, create an indicator from the valve control, right-click  and select 'Create Local Variable', then wire the data you are wiring into the DAQ Assistant into that, the local variables will need to be inside the sequence structure otherwise they will all be updated at the completion of the sequence structure leading to race conditions.

 

Pulse Train.png

Message 14 of 21
(1,948 Views)

The array looking constant values that I see on the bottom left, what is that? I'm having difficulty finding it in my pallete. Also, how did you connect the boolean T/F to the loop? Mine requires a value.

0 Kudos
Message 15 of 21
(1,946 Views)

 

 

 

 

 

0 Kudos
Message 16 of 21
(1,932 Views)

 

 

 

 

 

0 Kudos
Message 17 of 21
(1,929 Views)

Okay. No idea what was going on with those blank posts.... 

 

I've done my best to replicate what you had, and it seems to be working, but here are my questions:

 

1. I was only able to connect a numeric or constant to the loop in the upper left corner, this determines how many times it will loop. How would I connect a boolean to it to start the loop process?

 

2. Currently each loop has the same wait values. What is that array-looking thing that you used in the bottom left? I can't find it in my pallete.

 

Thanks!

0 Kudos
Message 18 of 21
(1,915 Views)

If you don't know how to make array constants, then you need to take some tutorials.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

Drop an array constant (from the array palette) onto your diagram.

Drop an integer constant into that array constant container.

Extend the bottom border and fill in whatever value you want.

0 Kudos
Message 19 of 21
(1,909 Views)

ogk.nz - I think I have everything where I want it. This program allows me to:

 

1. Alter the length of the output signal (valve open for x-amount of time)

2. Alter the time between pulses (valve closed for x-amount of time)

3. Run the loop however many times I want before ending the program.

 

I appreciate your help immensely. The university kind of dropped this program on me so this is my first time ever using it and only one of the faculty has ever used it. Thanks again!

 

I've attached a screenshot of my (for now) final program along with the program itself if anybody might find this useful. 

 

Download All
0 Kudos
Message 20 of 21
(1,892 Views)