04-16-2012 11:04 AM
Hey guys,
I'm putting together an automation VI and I am having some issues with the relay.
I have a time delay in the program that is delaying the value (open/closing) but not delaying the valve relay. The valve relay turns off when the valves open and opposite occurs when the valves are closed.
I am also automating off of a script.
04-16-2012 11:12 AM
@gmartinez wrote:
I'm putting together an automation VI and I am having some issues with the relay.
I have a time delay in the program that is delaying the value (open/closing) but not delaying the valve relay. The valve relay turns off when the valves open and opposite occurs when the valves are closed.
This description is incomplete, because you are not saying what behavior you want and what behavior you don't want.
Looking at your diagram, your two big FOR loops have no data depedencly and thus start and run in parallel and at the same time. Is this really what you want?
04-16-2012 11:23 AM
No. How I have them connected, the for loop on the right will not run until the for loop on the left stops.
My problem, like I stated before, is that the DAQmx corresponding to the digital output samples are delayed by the Time Delay. I want this time delay apply to the boolean array, that way we don't inverse effects between the DAQmx and the boolean array.
Thanks for the quick reply.
04-16-2012 11:31 AM
@gmartinez wrote:
No. How I have them connected, the for loop on the right will not run until the for loop on the left stops.
You are crating tasks, then branching the wire to two different places, each place will clear the task independently. That's asking for trouble. If the loops should run in sequence, simply continue the tasks as they exit the first loop and wire them to the second loop.
04-16-2012 11:34 AM
Ok, that takes care of some problems. Thanks. How about that boolean arrays on both loops. How do I apply the same time delay the DAQmx's have to the boolean arrays?
04-16-2012 02:25 PM
What do you mean by time delay ?
Try to explain what you what the code to do.
You have an input signal and 2 output signals. Do you want them to be connected in time ?
Also do you have problems with your to digital output task ?
What is the hardware you are using ?
04-16-2012 05:59 PM
The program does what I intend it to do as it is, the only thing I am trying to fix is that I want the boolean array indicatrs to light with the time delay that is applied to the loop. For example, if i am opening valves with 1s and 0s with a script, say my first line is all 0's therefore no valves are open, but after 5 seconds 2 valves open, hence there are two 1's in the second row of a script. As the program is currently, two of the boolean indicators will light at time 0 and stay on until time 5s and then turn off. Basically they are reversed to what I intend for them to do. I woud like for the bindicators to stay of from time 0 to 5 and then turn on at t=5s. I attribute this to the fact that the time delay in the loop is not having the same effect on the indicator.
So, I guess my question was, that if there is any way that I could apply the time delay of the loop to the indicator, so that it lights apporpriately.Or how to fix the program so that the indicators turn on when a 1 is shown in the script