LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

lag time

Akshath,

 

I am attaching the program that you modified with some changes. Let me explain what I am doing so I can give you as much info as possible, hope it helps.

 

I am sampling air. The sample point is about 14 meters above where the actual pump and valves are taking the air samples, so I therefore need to add in a lag time to control the valves. Currently where the random number generators (dice) are, I actually have a VI that controls the opening of my valves. The valves are correlated with wind directions, which can be negative, positive or zero (this happens quickly and is measured at 10 hz). So, as a scenario, I may be sampling, and the wind could be fluctuating between 0.01 and 5 m/s, when this is going on, I have a valve open sampling the positive wind values. However, the wind may change quickly to a negative value, and then quickly back to a positive value again. If this happens, I need the valves to operate in such a way that they don't open immediately to sample, but rather wait (hence the 6 second wait), sample the negative air plug quickly, and then go back to sampling positive air.....this is just one example, but there could be a number of scenarios. Whatever the case, I need a six second lag time before the valve opens to collect the right air sample. Also, while the six second lag time is counting down, the valve that is sampling needs to remain open until the other one opens to collect the negative air sample. In other words, the valves are controlled by the changing sign of the wind values, but they just need to open six seconds after the change in wind, in other words, they need to be delayed. Keep in mind, the wind can change pretty fast, but if the valves are controlled by a program that delays by six seconds, I don't think it will be an issue.

 

Does this make sense yet Smiley Happy I hope so, if not, maybe there is another platform that we can discuss it on.

 

Take a look at the mods I did and let me know what you think.

 

Tim

0 Kudos
Message 11 of 16
(1,599 Views)

Hi,

 Do you want it to wait for any change like when ever its going to + or - it should wait. As what i have did here is it will wait only when the slide value is changed to -1 or +1 its witing for 6Sec so if you want it for any - or + change i have to work it out. Reply me back.

 

 

Regards
Aks

(Appreciate answers by giving KUDOS)
Hit the stars.............. sky is not the limit.
Message 12 of 16
(1,588 Views)

Akshath,

 

One of the valves needs to always be open, sampling the air, wether it be postive or negative. The valve just needs to be six seconds behind what is actually being measured. It should wait six seconds, only if there is a change from negative to positive or positive to negative. Negative to negative or positive to positive should be constantly sampling at a rate of 100ms. 

0 Kudos
Message 13 of 16
(1,574 Views)

VTStudent-

 

          I think what you need is a state machine. A state machine is a LabVIEW coding structure that consists of a While Loop, Case Structure, Enum Constants, and Shift Registers. The allow the developer to control where the code will go next based on conditions (logic based on data or just user inputs). So you could sample your air and if the code detects that the wind has changed then it would send it to the wait case which would consist of just a Wait(ms).vi. After it waited it could check the wind again and stay in the wait or you could sample again immediately. I have attached a simple form of this (developed in LabVIEW 8.0) but you will have to adapt it for your application. Hope this helps!!

Download All
Message 14 of 16
(1,566 Views)

G,

 

I like the style of this program, it seems to definitely be doing what I need it to do for the wind velocities that will be positive. Also, based on how I modified it, I can also go to the negative side of the slide and then immediately back to the positive side, and it waits six seconds before sampling again, However, I need to sample the negative wind too, and I am not sure how to add the negative wind to this program. How do I get the negative side of the slide to do the same thing the positive side does? Only sampling either negative or positive wind at 100ms after counting to six? 

 

Thanks so much for your help.

 

Tim

0 Kudos
Message 15 of 16
(1,555 Views)

VTStudent-

 

          As long as you can physically measure that negative wind then you can make it an event in the logic that turns the "sampling" on the same thing. Treat them as the same thing and only wait if the wind changes. It may take some trial and error but the best thing to do is write down on paper what you want to do and see if you can get a flowchart from it. If you have a flow chart, you can code it. 🙂 Good Luck!!

0 Kudos
Message 16 of 16
(1,540 Views)