LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Efficient way to move graph value from SubVi to main vi ?

I would like to seek your opinion on the most efficient way to move mixed graph data ( value and if possible together with all the other associated properties ( plot name, Yscale.namelbltext etc) from the SubVi to the main vi. Currently I am using a good number of property nodes in the SubVi ( Necessary because I need to customize certain things such as plot area height dynamically) with refnum controls to transfer the graph data and the associated properties from the SubVi to the main Vi, but I would like to know if there is a more efficient way to do this.

[BADGE NAME]

0 Kudos
Message 1 of 15
(3,535 Views)

Use a queue.  Enqueue the data in the subVI.  Have the main VI dequeue it in a loop and write the values to the graph's terminal.

0 Kudos
Message 2 of 15
(3,527 Views)
Sounds very interesting. At your convenience kindly include a litttle vi to illustrate the process of enqueue and dequeuing. I am still learning a lot of things.

[BADGE NAME]

0 Kudos
Message 3 of 15
(3,516 Views)
Also, would the associated properties also be transferred along, or just the values?

[BADGE NAME]

0 Kudos
Message 4 of 15
(3,513 Views)

In a queue generally you can transfer anything you want but the point is whether you really need to do it. Why are you setting all the properties in a sub vi? Are you going to display the sub vi front panel to the user? In that case why would you want to transfer everything to main vi and also how is your main vi and sub vi related? If possible attach the main and the sub vi for getting into a proper solution.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 15
(3,508 Views)

Search the forums for producer/consumer.  Also the example finder in LabVIEW and the New... file menu has a producer/consumer template.

 

The queue sends along values.  You asked for an "efficient way to send values" and you said you were doing the manipulation of control properties in teh subVI.  You can send along combinations of data in whatever format you want.  You can define a cluster that can be any combination of datatypes you want.  A very flexible cluster is one that contains a cluster of an enum so you can send a "command" and a variant which can package any different type of data.  On the receiving end, you read the enum out of the cluster and decide what to do.  You can then convert the variant back to a specific datatype.

 

Message 6 of 15
(3,504 Views)

For an example, take a look at the Producer/Consumer architecture.

 


@blessedk wrote:
Also, would the associated properties also be transferred along, or just the values?

Only the values would be transfered between the VIs.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 15
(3,501 Views)
Thanks "worthy Knights" :). I will take a look at the producer/consumer example

[BADGE NAME]

0 Kudos
Message 8 of 15
(3,499 Views)
One quick question that comes up just taking a glance at producer/consumer vi is: what happens if my SubVi is not in a Loop? Actually I have the subvis placed inside case structures in the main vi loop

[BADGE NAME]

0 Kudos
Message 9 of 15
(3,491 Views)

Attached vi shows what I am thinking of doing. Becasuse i can not have both vis side by side i am thinking i should place the "queue out" on a connector pane out of the subvi which will then feed into the "queue in" on the main vi. What I dont know is whether this is as good as placing the 2D array directly into a connector node which i guess  impacts negatively on memory and performance?

[BADGE NAME]

0 Kudos
Message 10 of 15
(3,484 Views)