LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Como leer variables desde un sub VI a un main VI

Solved!
Go to solution

Mi pregunta es la siguiente:

 

Yo cree un programa que es capaz de leer códigos de barras por medio de una cámara Web, además de leer caracteres desde la misma cámara. Este VI esta integrado a un main VI y lo que deseo realizar es leer los datos obtenidos de mi subVI para poder manipularlos en el main VI, los datos de salida del subVI son datos de tipo string si alguien me pudiera orientar para resolver este problema.

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

Hi

 

you can pass the value through reference instead of value to you subVI. You create the reference of the variable you want to display the data in your main VI, and then links that reference as a subVI input. Within the subvi, you use the "Value" property node to update the control of your main VI.

 

(Sorry for english, I can unserstand a little spanish, but can't write at all)

(Perdona por el inglés, yo entiendo un rato de español, pero no puedo escribir nada...)

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

Thanks for answer too soon but i don´t really get it, if is possible that you can show me an exsample please....

(I'm also not good writing in english so sorry if you can understand all)

0 Kudos
Message 3 of 6
(2,592 Views)
Solution
Accepted by topic author dErMoIsTeR

Understood the English, don't worry.

 

Follow an example.

 

I don't know what you camera do, so I created a subvi with a while loop that updates a string for each interaction. One input of the subVI is the String indicator reference from the MainVI. The loops lasts about 10 sec.

 

 Notice that even though the loop in the main VI runs every second, the string value is updated a lot of times between each loop interaction. If you want the updates to be fewer, you need to add a time delay inside the subvi.

 

(In fact, even if you stop the main VI before the 10 seconds the indicator will continue updating!!)

 

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

Thanks again for answer so quick.

 

Now I get it, if you also tell me how can I convert an array output to string output, or select a certain part of the array into a string please....

0 Kudos
Message 5 of 6
(2,585 Views)

If you have a numeric array, you can convert it to a string array with any numeric/string conversion pallete. They accept an entire array as input, as following:

 

Convert2String.png

 

If you want to take a specific part of the array, you can use 2 functions from array pallete:

- Index Array - you select one element of the array

- Array Subset - you select a subarray from main array

 

Array.png

 

Regards,

Mariana

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