08-15-2005 01:43 PM
I have an application which calls two independently running VI's from a main VI. The three VI's communicate via queue's. I have a command and data queue for each VI where the command queue uses a typedef ring control and the data queue sends flattened data structures as strings. I have created different sets of command and data queues to avoid conflicts but I have used the same VI to send commands, ie the VI "Send Command" could be called simultaneously from any of the three running VI's to place commands on the different command queues. Does this invoke the same VI as reentrant code or does this method invoke copies of the same VI? I am getting some strange results where one of the VI's does not process its commands correctly. Thanks. |
08-15-2005 02:26 PM
08-15-2005 02:31 PM
08-15-2005 03:13 PM
Hi Davidwnypf,
Just a warning on use of reentrant VIs. 1st, it shouldn't be necessary unless your "send-command" VI has some wait-state that would cause serial-executions to "stack-up". In other words, if a call to "send command" should return instantly, it may not need to be reentrant. If you choose to make "send-command" reentrant, and it buffers a "shift-register" value, of course you'll now have multiple independant buffers. And, though nobody uses the dreaded "global" anymore, reading and writing to a global on the reentrant diagram is a sure recipie for headaches.
08-15-2005 06:41 PM
08-15-2005 08:58 PM
08-16-2005 07:44 AM
Davidwnypf,
If your concern is that LabVIEW will use the same data space for the duplicate VI you need not worry. LabVIEW automatically handles the necessary setup of a separate data space for each separate instance of the VI. So if you have the same VI in several places you will not have interfering data.