11-13-2008 05:48 PM - edited 11-13-2008 05:52 PM
Hi I'm using Labview 6i, and I'm relatively new to this system, here's my task and what I've tried:
I need to embed within a while loop of an existing data acquisition program a shutter control system that will turn the shutter OFF and ON in defined assymetric cycles (on time and off time are different) for the duration of the experiment. I can't use frames or loops within loops since they interfere with the time based acquisition that is controlled by the loop.
I have a time feed which I can use to keep track of time since experiment started. So for the case ON time = OFF time I can just say cycle time is ON time, divide cycle time by current time to get a cycle number and through integer division determine if the cycle is odd or even, (if even = true, then TTL state is true) and so on, if works like a charm.
But I have no clue how to go about programming for the case ON time not equal to OFF time. Any help on a strategy or labview functions I can easily implement to do this would be much appreciated.
11-13-2008 11:41 PM - edited 11-13-2008 11:42 PM
Keep track of time and the current state (On/Off) using shift registers. When the loop starts, feed the current time into a shift register. Read the current time inside the loop. If the current time is greater than the stored time plus the on time then switch the state to off, feed the current time into the time shift register as well as the current state. If they are not, feed the . For the condition of being in the off state, you will want to compared current time with the off time plus the stored time.