LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting IDLE state on the main VI from a Sub VI

Skip below to read the english version of the question, first i will ask in Italian because is my mother lenguage. 

 

Ciao a tutti, non sono molto esperto di labview e da qualche mese mi sono messo a imparare ad utilizzare questo software sviluppando parti di programmi dove lavoro. Fatta questa premessa la mia domanda è la seguente: Come faccio a mettere in pausa (Idle) la mia VI principale da una subVI? Ho bisogno di questa operazione per poter aggiungere oggetti tramite VI scripting alla VI principale ( Se non è in IDLE non posso modificarla). Una volta finite le modifiche ho bisogno anche di rimettere la VI principale in run. Finora ho provato varie strategie (anche suggerite dalla deficenza artificiale) come il nodo SetBusy, ho provato anche con proprietà e invoke node ma niente non ne vengo fuori e ottengo in varie situazioni questi codice di errore: 1000;1026 e 1055.

Avete una soluzione semplice, diretta e funzionale per risolvere questo problema??? Grazie in anticipo a chi troverà il tempo per rispondere, in caso di bisogno domandate pure e provvederò ad aggiungere ulteriori informazioni appena possibile.    PS: sto usando labview 2021

-------------------------------------------------------------------------------------------------------------------------------------------------ENGLISH-------------------------------------------------------------------------------------------------------------------------------

Hello, i'm new with labview and i'm still learning so i need your help (AI didn't help out much). i need to do the following things in my program:

1) at one point (Init phase) automatically set the idle state of my MAIN VI (When needed and only one time) 

2) from SubVI i need to create via scripting some objects in the MAIN VI ( But it have to be on idle state or will give me back error)

3) When exiting from the SubVI i neeed to put on RUN the main VI and keep working with my main VI 

4) The solution have to be reliable and easy to use! 

 

I already tried many ways without success, it's seems that i can't properly set those function like:  set busy, invoke and property nodes, notifier and other ways that always gives one of those error: 1000; 1026 and 1055. 

PS: i'm using labview 2021

 

 

 

0 Kudos
Message 1 of 9
(291 Views)

Hi Marione,

 


@IlMarione wrote:

Hello, i'm new with labview and i'm still learning so i need your help (AI didn't help out much). i need to do the following things in my program:

1) at one point (Init phase) automatically set the idle state of my MAIN VI (When needed and only one time) 

2) from SubVI i need to create via scripting some objects in the MAIN VI ( But it have to be on idle state or will give me back error)

3) When exiting from the SubVI i neeed to put on RUN the main VI and keep working with my main VI 

4) The solution have to be reliable and easy to use! 

 

I already tried many ways without success, it's seems that i can't properly set those function like:  set busy, invoke and property nodes, notifier and other ways that always gives one of those error: 1000; 1026 and 1055. 

PS: i'm using labview 2021


You cannot stop the mainVI from a subVI without stopping the subVI too…

 

  • Do you really want to edit the MainVI by scripting?
  • When you exchange the roles of "main VI" and "sub VI" then you can edit your "subVI" from the MainVI and call that "subVI" dynamically afterwards!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(280 Views)

You can't create items via scripting on a running VI. That's like trying to change tires on a running car.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 9
(270 Views)

Hi, thank you for your answer...

Let's make a step back, my final goal is to have a table structure with the first 3 rows made with String array and the last one have to be a control associated to the corrisponding type of data, it can be a Bool, a String, A numeric or a Ring (or Enum). I already make the selection and association part. 

 

Initially i had a different strategy, i had created a cluster with 3 string indicator and 4 different types of controls and then inserted into an array, but with this strategy i have all the limitation of the array and i can't properly access the various data types via reference and property node so after 2 weeks of try and fails i left behind the idea and started with this one... i don't have others idea than this last one of dinamically creating the table structure from a sub VI... So this is more a last hope than a will. 

 

Sorry i don't understand all the second point, maybe i'm using wrong therminology... My first VI call a second VI that exist only for the time needed to create the structure in the first VI then it shut down...  I don't change the roles of the VI's setting one as Main and one as Sub ( if it's possible maybe i'm understanding wrong). 

 

Can you be more specific about your solution (or other methods to archive the result). 

 

0 Kudos
Message 4 of 9
(257 Views)

They say a picture is worth a thousand words... but a VI is worth a thousand pictures.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 5 of 9
(244 Views)

@IlMarione wrote:

Sorry i don't understand all the second point, maybe i'm using wrong therminology... My first VI call a second VI that exist only for the time needed to create the structure in the first VI then it shut down...  I don't change the roles of the VI's setting one as Main and one as Sub ( if it's possible maybe i'm understanding wrong). 

 


You still can't create controls in a running VI ... you can however show and hide existing ones. Do you also write programs in Python that writes Pyhon and change the running program?

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 9
(200 Views)

Hi Yamaeda, i already said that i'm not an experts and i'm learning on my own for my job... I tried many ways to reach my goal but none of them worked... If i'm doing such things is because i haven't any more ideas left, and also this one seem it will not work... 

I don't know if you have read my other replies on this topic...  Someone said that i'm trying to changes tires on a running car, very good exemple that fit this situation. 

However i already tried to use visible property with arrays, it applies to all the element. My final goal is to have a sort of table structure that contains rows with this type of data: 3 Strings and one control between String, Enum ( or ring); boolean and Numeric. I don't know from the start how many rows i will need so i have to create dinamically the structure and then put data in the correct place (Control). Do you have any ideas how to do such a thing? I'm thinking about opening a new Thread with my entire question because i need a path that leads to results because i have already wasted 2/3 weeks on this application without succes.

Thank you for your time,

IlMarione 

0 Kudos
Message 7 of 9
(192 Views)

My advice is to draw a simple picture of the indicator you desire and LET US tell you the best way to create it in LabVIEW.  As a beginner in LabVIEW, you may not realize when something has a simple solution.  Tell us specifically what your end goal is, and we can give better advice on how to achieve it.

 

It sounds like you need a table control, but I can't be sure.  What I would do to show bools, enums and numerics in a table is to simply convert them to strings.  You may need more advanced techniques to get the data to display how you want.

 

Keep in mind though:  LabVIEW is an engineering programming language.  It has great graphs and charts, etc., but it is NOT designed for fancy GUIs like C#/WPF.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 8 of 9
(175 Views)

You're trying to create a Data control or what they're called. Many have tried, non have succeded to a great degree yet. You can e.g. create a Cluster with the different data types and show/hide as needed, but since that applies to all of an array you'll have to simulate an array by e.g. "show 3 rows, but they're actually 3 separate clusters that gets filled by an array".

 

It's easier to simply show it as a String and handle the conversion as needed. 

 

Actually, if you're just showing it and it's not overly important how it looks you can have a Variant as the last element.

Yamaeda_0-1740733696833.png

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 9
(158 Views)