LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph in a XY from Subvi

 

Grettins

 

for my project I have to adquire datos from a DAQ so I made a states machines and I saved that datas in a array. in another state I export that datas to excel by local variables

 

I have another state "Graph", in this state I want to Graph that datas but I need to Graph in another VI, this is more confortable than others options for the user, but this its the big problem that I have.

 

I have looked about the Subvis and I try to apply to my project, but the Subvi doesn´t have any inputs, so i couldn´t set.

 

thanks a lot if someone can help to me for graph that datas that I saved in a array, and later when I choose the Graph state, I can graph that datas in a XY Graph.

 

PD: Sorry for my English :)cuando selecciono el estado graficar, pueda graficar estos datos en un XY Graph

0 Kudos
Message 1 of 5
(3,117 Views)

If your "Producer" (the VI that makes the data) is finished when it's time to graph it, then you just pass the data via output terminals on the producer's panel, and the "grapher" (where the graph is) takes the data and wires it to the graph.

 

If your "Producer" must keep running after producing the data, then there are several methods to choose from:

1... Pass a REFERENCE to the graph into the producer when it starts up.  The producer then uses a VALUE property attached to that reference, and the data appears.

2... Create a QUEUE, or a NOTIFIER in the "grapher", and wait for data to show up.  The "Producer" obtains the same queue or notifier, and posts the new data to the queue.

3... Create a third VI. The producer calls it to STORE the new data, the grapher calls it  to RETRIEVE it.

4... Use a global variable.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 5
(3,108 Views)

thanks a lot for answer this topic

 

I try to apply your options but I couldn´t do it.

 

for example, I tryed to create a global variable (its the eaisiest option), but the program showed that the sources aren´t of the same type.

 

can you help me with this problem?

 

 

the program begins in wait mode, you can choose "Toma de Datos" from the menu ring, the program ask if you want to start the data aquisition. if you say "SI" the program will generate random data and the program will write in an array this data...

when you say "No", the program stop the data aquisition, and come back to wait mode...

 

i want to Graph that data with the Graficar 3 vi..

 

 

thanks a lot for your Help

Download All
0 Kudos
Message 3 of 5
(3,101 Views)

Well the way you have it set up makes it easy.

"Graficar" needs TERMINALS to pass data in (or out).

I created two arrays of DBL controls, 1 X, 1 Y.

You connect the controls to TERMINALS on the CONNECTOR (see the orange terminals).

I replaced the express BUILD X-Y GRAPH with a simple BUNDLE operation - it's more appropriate here.

In the "Trabajogrado", you connect whatever data you want for X and for Y to the terminals on the icon. Those represent the controls on the subVI - that's how data gets passed from one VI to another.

(I just picked two arrays - I don't know which data you want to plot).

When you get it working right, you can hide the X and Y controls so they don't show - they will still work.

 

 

Screen shot 2011-06-29 at 11.07.19 PM.png

 

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 5
(3,098 Views)

Thanks a lot for your help

 

I can apply your ideas in my project...the program can call the subVI Graficar3 without it is open ... how I can do?

 

Thanks a lot again

 

 

0 Kudos
Message 5 of 5
(3,096 Views)