07-06-2010 03:55 AM
Hi,
I'm trying to figure out how to implement a trigger into my program. I basically want this to happen:
Psuedocode:
if (AI2 = 3V)
write data from AI1 to graph 1
if (AI2 = 4V)
write data from AI1 to graph2
else
do not write data to anywhere
I had thought of a case structure, but realised that not all of the outputs would be wired.
The problem with my VI is that the DAQ is reading from 50 channels - would it be easier to try and create two separate arrays in the producer loop and then read from them separately in the consumer loop
OR to create a single array in the producer loop and then try to split the data in the consumer loop?
or is there a better way altogether?
Here's the VI as i'm working on it. I've stripped out a lot of the program that does other things (LED control, Digital input recording etc.)
07-06-2010 06:18 AM
Hi,
I would avoid processing the measurements into two seperate arrays within the producer loop, as this may impact on the timing of your measurements.
I haven't been able to open your VI (I still haven't installed LabVIEW 9 yet!) but I've knocked up a quick example of how you could queue a single array in the producer and split it out in the consumer:
Hope this helps,
Charlie
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
07-06-2010 08:01 AM
Why can't the graphs be put inside two different cases which are triggered when one = 3 and the other = 4? What outputs are you talking about?
Secondly, why graph a straight line?
07-06-2010 08:11 AM
Hi Broken Arrow,
Yep, just realised my mistake - I was originally building arrays in the consumer to add to graphs, but then changed to charts.
Corrected:
Thanks,
Charlie
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
07-06-2010 09:03 AM
Cheers for the help Charlie, sorry but i thought that who ever would look at the post would also see the VI!
Below are the consumer and producer loops of my VI. Originally i needed to produce 2 graphs in the word report which contained data from 2 separate AIs.
Now i want to use the integer value of the middle array (which goes to the max/min in the picture) to send only one array (the top one) to either graph 1 or graph 2 in the report. (the bottom array will now not be used at all).
Thanks for any help you can give,
Chris
07-06-2010 09:59 AM
Hi Chris,
I think I'm beginning to understand your dilemma now...
If you wire the top array through the case structure to either graph 1 or 2, then the output to the other graph will be unwired. Is this correct?
I'm not sure you can achieve what you want with on-the-fly reporting.
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor