10-09-2017 12:39 PM
Hi there,
I was wondering if there is a way I can send data from one VI to another.
Currently i have a an array that is auto-indexed into a for loop with a wait delay. My array contains elements "1,2,3,4,5", and i am looking to sequentially transfer these elements every ___ ms to another VI (hence the use of the wait delay), which will perform operations on these elements as they come in.
Can someone please help me understand how i can do this? Would i need to create an indicator, and then create a reference from this indicator? Or would i need a global variable?
Thank you!!!
10-09-2017 12:48 PM
VI#1 output to VI#2 input
10-09-2017 12:53 PM
Right, but i am unsure of how to create an 'output' variable from VI #1 under my desired conditions unfortunately.
10-09-2017 12:57 PM
The answer is yes. Now as to the how, that is more dependent on what you are trying to achieve.
Are these running sequentially or in parallel? Would this be event driven (do X when Y is selected)? Is one of these vi's an instrument interface? Is a timeout involved? ...
The more data that you provide, the better the results.
10-09-2017 01:49 PM
Thanks for the response,
I am still very new to LabVIEW so I apologize for the lack of detail
These VIs would be running in parallel, and neither VIs are instrument interfaces.
Ultimately this is what I am trying to do:
VI#1 - Generates an array, and then sends the elements of that array sequentially every so often. I was hoping to achieve this by having the array auto-index into the for loop with the wait timer implemented.
VI#2 (running simultaneously to VI#1 for now) - Takes the outputted elements from VI#1 and creates a data string for each of the elements, which is then sent to a client device as a data packet.
I am not really sure if this constitutes as an event driven situation
Right now I am just trying to find the best way to send that data from VI#1 to VI#2. Maybe for my purposes it seems like having VI#2 call VI#1 would be the best option?
Thanks
10-09-2017 01:53 PM
Use a queue or channel wire to transfer the data.
10-09-2017 02:04 PM
If you still have questions, posting your vi (not just a picture of it - unless it is the .png snippet), will get you even better results.
10-09-2017 06:06 PM
Use a Queue. You can use the Producer/Consumer as a quick reference.
10-10-2017 12:57 AM
I am a bit confused about why you want to delay transmitting an array element by element to your other vi???
Just send the whole array at once, easier, then you can do whatever you want with the individual elements in the second vi...