LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
EMAHJ

Edit code during execution

Status: New

It would be great to have possibility to change/edit the code when a VI is running in "Suspend when called mode".

 

This would be a code developer ultimate dream when you are into development of new code or just fault finding in old code.

 

During development or fault finding when/if you are using "suspend when called"-functionallity for a sub VI in your code.

I mean when the sub VI is "paused" and waiting for you to press the "run" button, right there, possibility to edit the code for that VI and run it ones, change the code (perhraps changing some timing or changing a formula of an calculation or both or change execution order for some settings of the DUT etc etc) a little bit and run it again, tweak it a little bit more and run it again... AND THEN exit the sub VI (with "suspend when called") and CONTINUE with the rest of the CODE like nothing have changed!

 

A kind of possibility to change the code during execution, just for  VI/s that you have chosen "suspend when called" for.

 

What a functionality when you are into fault finding and testing out of new developed code! ! ! !

I think that this functionallity would make a big difference between text-based coding and using LabVIEW in matter of how easy development or fault finding can be done.

 

 

 

 

13 Comments
Dragis
Active Participant

I would love to see LabVIEW put in the effort to support this some day. It is a very useful feature, I use it all the time in Visual Studio and Eclipse when debugging C# and Java code.

 

http://msdn.microsoft.com/en-us/library/x17d7wxw.aspx

 

Like others mentioned, there are situations where it is not worth the effort to try and swap out code at run-time, too many links to other code and data sections to deal with properly. But in the majority of cases it is possible and is done in other tools.

 

http://msdn.microsoft.com/en-us/library/ms164927.aspx

 

And there is a lot of research on how to do this well, in many cases the overhead is on the order of a a few percent in run-time and memory usage. And given that the LabVIEW run-time with scripting included does know how to compile, it isn't as far a reach as you might think.

 

That said, it is a big undertaking so this would need a lot of support behind it to push it through. To get things started, post anytime you hit a use case where it would have been nice to quickly modify the code to build up a set of user stories that would need to be supported.

FelixAeschimann
Member

I'd like to have this feature, too.

I've read all the comments, and I'm aware that this might have a big impact on how LabVIEW handles things during execution.

 

Nevertheless, I see a big impact on our development techniques. We're using LabVIEW for controlling production machines. So we're not just doing the measurements with LabVIEW, we control the actors to move parts forward etc, too. When I'm testing these systems, I have to intialize the machine, load a batch, insert material, wait until the production starts etc. So, it often takes a while until I reach the point I'm interested in.

 

Pausing the execution an switching some things right then would be nice. For example True/Fals mistakes, mathematic formulas and so on. Changeing the connector pane of course would still need to fully stop the execution. But mostly, the problems arise from the examples mentioned above and are not really big changes to the code.

 

When using a standard PLC like Siemens or B&R, this is a standard feature of the environment and boosts development.

Felix Aeschimann | LabVIEW CLA
Intaris
Proven Zealot

Could it not be possible to "spoof" editing the VI by creating a parallel copy of the original VI and copying over any values which may be available while the original is paused?  That was we could re-run the "spoofed" VI and make changes until the code returns the correct results (genetic programming 🙂 ).  Like a parallel sandbox in the same application instance.

 

Porting the changes back to the original is perhaps a bit more difficult, but maybe LV could swap out the internal references for the VIs?