From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple instances of main VI(clones), need solution to seperate the FGV (SubVI) or its replacement

Hello,

I am using 5 clones of the Main VI.

The main VI uses 3 FGVs(Fa,Fb,Fc) and 7 other SubVIs. 

I need to seperate the FGVs for each of the 5 instances while maitaining the property of the FGV.

 

FGV within Clones is a Quagmire !

 

Is a DVR (Data Value reference ) using an In-place element a solution  ? Can you suggest any example links ?

 

 

0 Kudos
Message 1 of 11
(1,275 Views)

You could make your FGV preallocate-clone reentrant, have one reference/clone per main vi, and call the FGV by-reference. 

0 Kudos
Message 2 of 11
(1,270 Views)

Or you could use an SEQ (Single Element Queue) and maintain the Data in there.
you can then chose to use the 1 SEQ queue or duplicate for each instance of the clone launched as required - again pre-allocate.


is the FGV truly functional, or is it merely a data storage? - that could dictate your approach.
DVRs do work if used correctly. - but can be a headache as you need to delete all references to close them.


James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 3 of 11
(1,262 Views)

Thanks guys , will try the Preallocate option ..

0 Kudos
Message 4 of 11
(1,258 Views)

Hello ,

I tried the FGVs with "Preallocated clone reentrant execution" , but this solution is not clean because the Main VI's which are clones are not able to seggregate the FGV's. I get data which is jumbled  which is contraproductive.

 

Best

Akshay

0 Kudos
Message 5 of 11
(1,165 Views)

Sounds like you didn't call your reentrant FGV by reference.  

 

This link shows how to do that:

https://forums.ni.com/t5/LabVIEW/Multiple-copies-of-functional-global-using-vi-references/m-p/272219...

0 Kudos
Message 6 of 11
(1,158 Views)

What exactly are these FGVs being used for?

 

My first instinct would be to go the DVR route as a replacement.  I would need more details to think about to give other alternatives.


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
0 Kudos
Message 7 of 11
(1,157 Views)

Hello Crossrulz,

What I have here is a Driver for single or multiple Testunits with CAN Interface.

The labview part "main_CAN.vi" is a State machine which accepts commands thr' a QMH and does the part.

The FGVs here transfer data (SDos PDOs and other Variables) throughout the main & subordinate  VIs.

I have here 5 CAN Interfaces which call preallocated clones  of "Main_CAN.vi".

 

The FGV is also a Preallocated Clone.

I expect the FGV clone to remain in its limit and only interact with the respective Main clone i.e.

Clone1_Main_CAN.vi < > Clone1_FGV.vi

Clone2_Main_CAN.vi < > Clone2_FGV.vi

 

aparab_0-1646731410532.png

 

Best 

 

 

0 Kudos
Message 8 of 11
(1,131 Views)

I would ditch the "Open VI Reference" part as that is unneeded (as you are just creating a second clone and never using the first one), but otherwise that should work.  

 

A reference image for FGV by reference (no Open VI ref):

Reentrant+Action+Engine+v3.png

0 Kudos
Message 9 of 11
(1,125 Views)

I would implement your FGV as a class (with your data as private data of the class) and pass the object wire around wherever you need it.

 

Each main VI creates its own version and from then on it's a wire. Implement DVR / accessors as needed.

 

Done.

0 Kudos
Message 10 of 11
(1,115 Views)