LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital start trigger for simultaneous AI and AO tasks

Solved!
Go to solution

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

  • cDAQ-9172 chassis:
    • Slot 1: 9410 DIO module
    • Slot 2: 9481 Relay module (line 0 actuates power relay)
    • Slot 3: 9263 AO module (1 channel used)
    • Slot 4: empty
    • Slot 5: DIO module (line 0 wired to power relay)
    • Slot 6: 9239 AI module (4 channels used)
    • Slot 7: 9215 AI module (1 channel used)
    • Slot 8: empty
0 Kudos
Message 1 of 3
(3,734 Views)
Solution
Accepted by topic author MJHanagan

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..

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 2 of 3
(3,717 Views)
Yes, that seems to have solve the problem.  Thank you for the help!
0 Kudos
Message 3 of 3
(3,704 Views)