LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Chris_K.

Run selected code only

Status: New
I often have the situation in which I want to test a portion of my VI without running the entire VI. To accomplish this, I usually copy and paste the code fragment into a new VI and run it. When I'm finished, I close out the new VI without saving it. I've often wanted to simply select a code fragment and run just that part. For example, by right-clicking on the code fragment and selecting "run". It would be a nice little time saver. Of course, this would really only be feasible in certain situations: namely in which the code does not have any dependencies on other code sections. This essentially means that all the inputs are controls or diagram constants and all outputs are indicators.  This seems like it would be easy to add to LabVIEW since it is just a subset of existing functionality. Other implementations would probably be more trouble than they are worth.
4 Comments
elset191
Active Participant
See here, I think.
--
Tim Elsey
Certified LabVIEW Architect
RavensFan
Knight of NI

Already proposed  Enable Diagram (or Inverse Disable Diagram)

 

I'm really suprised though that it only has 8 kudo's at this moment.  Hopefully your post will encourage people to kudo the idea.

altenbach
Knight of NI

I don't think it is exactly the same as the other suggestions and I actually like this. We are not talking about any new structure, just a new way of selective debugging.

 

It should only work if we have "retain wire values" enabled and the code has run once, so all inputs that come from outside the active region would have more or less reasonable data.

 

No we would just place a few probes, select a code region of interest, select highlighting if desired, and run the selected code in a "sandbox". Once data on all output wires leave the selected area, the code stops.

 

Maybe there should also be a way to override incoming data, for example in combination with this suggestion. 😄

Jason_Harrigan
Member

This is a great idea. It would help, for example, with all those array manipulation functions that you forget the exact specifics of. Also, debugging a sub-algorithm. Again, a good idea.