LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create different arrays via a trigger from an AI

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

 

 

 

 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 1 of 6
(2,840 Views)

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:

 

18185iCA2BB75A489A12D6

 

Hope this helps,

 

Charlie

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

Message 2 of 6
(2,820 Views)

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?

Richard






0 Kudos
Message 3 of 6
(2,805 Views)

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:

 

18195iD9E65BD0DBC89811

 

Thanks,

 

Charlie

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 4 of 6
(2,800 Views)

Cheers for the help Charlie, sorry but i thought that who ever would look at the post would also see the VI! Smiley Happy

 

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

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


Download All
0 Kudos
Message 5 of 6
(2,791 Views)

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

0 Kudos
Message 6 of 6
(2,778 Views)