LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reentrant vi's, in theory, use 'em with reckless abandon?

I have a vi where I am going through hoops to avoid using too many of a certain sub-vi. Said sub-vi is reentrant, so IN THEROY (and assuming I don't care about disk space), I could just plop down the sub-vi wherever I want it, correct? (in theory).

The sub-vi in question is Serial Port Write.vi. No problems with stepping on/over itself.
Richard






0 Kudos
Message 1 of 2
(2,572 Views)
Serial Port Write.vi is a good example of a VI that you typically don't want to make reentrant. If you're writing to different ports which each new instance of Serial Port Write.vi, it may be OK to make it reentrant. But if you're only using one serial port, you're asking for trouble and you need to be sure your calling VI is controlling the order of the writes or you could end up with jibberish on the other end. If you're using only one serial port, you don't gain anything by making it reentrant because your real bottleneck is the UART hardware, not the VI. If you have an application where you can justify making it reentrant, I'd suggest making a copy of it (called Serial Port Write - reentrant.vi) so other applications can still use the standard non-reentrant defa
ult.
0 Kudos
Message 2 of 2
(2,572 Views)