First thing.....I am relatively new to LabVIEW!
Second thing.......this is what I want to do:
This is what I am going to use:
I tried using the timer function blocks available in the RT module (two timers, after First is done, start second and after second is done restart first, PLC coding style!!). But this method doesnt seem to work!
So I used a 'FOR' loop with 2 iterations and the loop timing being adjusted using the On and Off times available from front panel entries.
Now when I use it as a sub VI, it is not working. If I connect another subVI to this code, it still doesnt work........
Where am I wrong?
Any help would be useful!
Thanks in advance...
There are a number of ways you could code this requirement, here is one suggestion (others will have other recommendations):
Use a while loop with a boolean stop control wired to the conditional terminal.
Inside the while loop, monitor time elapsed using the Time in ms function. Compare the current time in ms to that at the last value change, as stored in a shift register.
When the time elapsed is greater than the time required (high time or low time), switch the output from low to high (or high to low).
The loop will continue checking the time elapsed and alter the output accordingly, until the user selects Stop from the front panel.
The idea has the advantages of: