11-23-2009 03:26 PM
I am trying to create a subVI to simultaneously measure 5 AI signals and output one AO signal. The AO signal feeds a power supply which in turn powers my sample. The AI measures the applied voltage, current (via a shunt resistor), temperature via a 1-5 V signal from an optical pyrometer and two other sensor input voltages. During the test I also want to vary the applied voltage so I set up a waveform of the voltage values. To make things fairly simple I am running both the AI and AO tasks at the same rate and I want both tasks to start simultaneously. To accomplish the trigger start I wired an extra set of contacts on the power relay to line 0 on a 9401 DIO module resident in slot 5 of the 9172 chassis (access to the PFIO signal).
The attachment is the basic subVI I have come up with to do this. What I find is the AI task seems to trigger correctly, but the AO seems to start as much as 100 msec before the AI task begins (sometimes it is dead on, but other times not).
Am I setting up these tasks to start simultaneously, or is my programming approach off?
Here is my hardware setup
Solved! Go to Solution.
11-24-2009 09:45 AM
1. If you want to start both tasks at the same time and run them synchronously, you don't need two Start Digital Triggers. Have a look at the example Multi-Func-Synch AI-AO.vi in the Example Finder.
2. Design your architecture using State Machines instead of using Sequence Structures. Have a look at a State machine template in File -> New..
11-24-2009 03:22 PM