06-07-2012 12:09 PM
Hi, I hope you can help me.
Well, I want to know how I can disable code when some condition (true, false) is achieved. Of course without stop the execution of VI.
Thank you.
06-07-2012 12:11 PM
06-07-2012 12:34 PM
As mentioned above, the case structure is probably want you want.
However you should use different terminology for your question. In the context of the LabVIEW development environment, "disabled code" is code inside a "diagram disable structure". It is ingored by the compiler completely, and is never available during a run. In contrast, you simply want to select between code alternatives at run time and the case structure is the correct tool here. 🙂
06-08-2012 02:40 AM
Hi altenbach, thank you for your answer but I know how use the case structure. Precisely like you have mentioned in your answer, I really want "disable code" like when I use "diagram disable structure" but with the big diference that I want to do it when the VI is running.
I hope you can help me.
06-08-2012 04:43 AM - edited 06-08-2012 04:45 AM
Hi Mr.
1) Switching "Disable..." to a different condition requires recompilation of the code.
2) At runtime you cannot recompile a VI.
So, no you can't use a conditional disable structure at runtime...
Use case structures as suggested before! What's the problem to draw a case structure around your code?
06-08-2012 01:18 PM
Hi GerdW.
I'm working with shared variables to transfer information between cRIO 9022 and my PC. There are two VI's running into cRIO, one is for stablish the communication and the other is for adquisicion code, in fact I'm using the structure of 'real time wizard of LabVIEw', also I have a VI running into PC to receive data.
Inside of the VI in charge to stablish the commication and in which there are 30 different shared variables, I want that just work 10 shared variables when I want to read from 'acquisition VI' and the rest (20) work when I want to write to 'acquisition VI'.
Like summary, I want to disable shared variables to save data traveling in the conection and avoid crash of the conection for try to write and read at the same time.
Maybe I don't need 'disable code' because there is a form to disable the shared variables and I don't know. I supose that even when I use 'case structure' the shared variables keep taking space in the conection.
Thank you for answer, I hope you can help me.
06-12-2012 10:46 AM
Hello Mr.farmcorp,
What migh be useful for you is if you are using the LabVIEW DSC Module, there are some VIs that allows you to create or destroy variables programatically. The only restriction is that you must have installed and after the 30 days of trial activated your DSC Module.
Is this anyhow helpful for you? I mean, do you have the DSC module?
Regards,