08-02-2024 01:52 PM
@GRCK5000 wrote:
Most programmers advise not to pass data between two or more VIs using global variables. I had a post some time ago and I asked if it was possible to pass data between two VIs and @mcDuff said that it was possible and even provided great examples. In these examples, events are being used to pass data between two loops, more like producer-consumer architecture, but not between VIs.
I have attached a VI called sender and I would like to pass string "hello" to receiver.vi
You could use a named Queue, although caution is needed when using them.
The following example will work, if and only if, your receiver VI is started before the sender.
08-02-2024 03:28 PM - edited 08-02-2024 03:33 PM
@mcduff wrote:
You could use a named Queue, although caution is needed when using them.
I use them all the time - did you know, you can spawn up to 1Billion named queues on 2014 intel I7 @ 12 gb ram before running in any problems?! (labview reports a warning or error too many queues, if I remember correctly)
and you are meant to close them, by "close queue"
probably, no good advice...
08-02-2024 03:34 PM
@alexderjuengere wrote:
@mcduff wrote:
You could use a named Queue, although caution is needed when using them.
I use them all the time - did you know, you can spawn up to 1Billion named queues on 2014 intel I7 @ 12 gb ram before running in any problems?! (labview reports a warning or error too many queues, if I remember correctly)
probably, no good advice...
Named Queues, Bytes at Port, Global Variables, etc. are like religion and politics on this forum; don't want to get into a flame war, thus a warning. 🙂
PS I use them too.
08-02-2024 09:20 PM - edited 08-02-2024 09:22 PM
Thanks McDuff! I will definitely go with queue, just turn the two codes into subVIs. Boom!