03-29-2012 12:14 PM
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.
Solved! Go to Solution.
03-29-2012 01:02 PM
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...)
03-29-2012 02:10 PM
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)
03-29-2012 03:03 PM
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!!)
03-29-2012 03:50 PM
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....
03-30-2012 05:23 AM
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:
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
Regards,
Mariana