LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is 764 diagrams too many?

Mike,

Since when has the forum been designated a negative critique and personal attack site.  With all due respect to your superior understanding of software engineering, I have to beg your pardon. 

You are wrong! 

The question is, not "Although you have not seen my code, and although you know nothing about this project, please, explain to me the ways my smoothly functioning code is flawed?"  The question is still, why am I unable to edit my vi.  Your comments did nothing to contribute positively to that answer.  The NI engineer did help me answer my question, and all your snobbery and snubbery did nothing but elicit my defense. 

Please, have the self control to stick to the topic and avoid the personal attacks motivated for some bizarre reason known only to you.  The point of the topic is not coding technique.  That topic is addressed frequenctly on this forum.  Let us concentrate on the point of post, not use it as a blunt instrument to beat newbies into "their place", far below the skilled and experienced veteran.

Jayme

jc
Mac 10.4
LV7.1
CLD
0 Kudos
Message 11 of 14
(783 Views)

Mike,

Since you have turned this into a coding technique thread, and since I am ultimately interested in doing things better, I would like to ask a question about running the state machines as separate processes.  I understand how to write data to central structures using events and queues, but I do not know how to instantiate a single vi in several separate processes.  Do I have to make N versions of the vi to run it in N separate processes by running the vis with invoke nodes?

If you have the time, please, tell me how this is done.

Jayme

jc
Mac 10.4
LV7.1
CLD
0 Kudos
Message 12 of 14
(776 Views)
Hello Jayme,

you can make subVi's reentrant in the vi properties->execution. This way each call of this subvi will run independently and in parallel from the other.
But you loose the ability to debug it at runtime 😞

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 14
(768 Views)
Hi Jayme,

As GerdW describes, one way to run one VI in multiple instances simultaneously is by setting the execution of the VI to "reentrant". However, please be aware that doing this for the increase of efficiency might not give you the results you were looking for. When running one VI multiple times simultaneously (SubVI or dynamically called) in reentrant mode, the memory space of the VI is being multiplied by the number of instances. Reentrancy basically creates a clone of the VI for every instance it needs to run and since it can't share the memory space between the clones. Therefore, by encapsulating your state machines in reentrant SubVIs, the biggest benefit will be increased readability, maintainability and modularity of your code, but NOT necessarily an improvement in speed or memory consumption.

Let me know if you have other questions, thanks.

Have fun!
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 14 of 14
(722 Views)