LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Scripting Main Board

Workaround: Try putting a Begin Transaction call before the call to the method and an End Transaction call after the call to the method.

I call it a workaround, but it may not be a bug. Here's the fundamental problem that scripting faces: Should every method/property call return the VI to a runable state? Should every method/property re-evaluate the brokenness of the VI? If you're going to be calling a whole lot of scripting operations in a row, the answer is "no" because you don't want to waste the time redoing good/bad state tests, redoing type prop and redoing compile between every meth/prop call. But if you're only doing a couple of functions, that overhead is less significant and you may not want the bother of a Begin Transaction/End Transaction pair. And, since the transaction wrapper means that your edits are now undoable on the VI, that may also be undesirable.

Most scripting functions were created by a developer who needed them for a reason. It is only in recent years that we started saying, "Everything you can do from the editor should have a method/property to let you do it programmatically." As a result, a lot of functions were added by developers for a particular edit, and some of those edits couldn't waste time with the various "update the VI" procedures. So, to make them faster, they don't do it. Adding them now might make for a more consistent scripting API, but it might slow down those VIs beyond unusable, and LV has no way of knowing who is using that API, so we'd have to build a new meth/property to incorporate the "update the VI" functionality.

You can see why we resisted releasing scripting all those years. The amount to be cleaned up is huge.

0 Kudos
Message 71 of 171
(4,690 Views)

Another possible workaround is to run the VI method Cause Type Propagation.

0 Kudos
Message 72 of 171
(4,690 Views)

Ok, this will update the executableness, but how about stteing the docmod?

There is a method called "Front Panel. Set Mod", but the documentation doesn't tell what values to pass as parameter and I'm not even sure this is what I need.. Any idea how I can set the docmod or do something that will force LabVIEW to update this display?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 73 of 171
(4,690 Views)

1) Make sure that your Open VI Reference function is passing along the flag that says to record doc mods.

2) Assuming that is happening, if you use the Begin Transaction and End Transaction wrappers, I am fairly certain you'll get the docmod you're looking for.

0 Kudos
Message 74 of 171
(4,690 Views)

I'm confused, I'm not sure I understand what you mean by "Make sure that your Open VI Reference function is passing along the flag that says to record doc mods."

If this is what you mean, then for me it doesn't work

Am I missing something?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 75 of 171
(4,690 Views)

TiTou wrote:

I'm confused, I'm not sure I understand what you mean by "Make sure that your Open VI Reference function is passing along the flag that says to record doc mods."

If this is what you mean, then for me it doesn't work

Am I missing something?

He's referring to wiring a '1' to the options input of Open VI Reference so that modifications are recorded.

-D

0 Kudos
Message 76 of 171
(4,690 Views)

There is an input to the Open VI Reference primitive called "options". The online help describes all the flags. One of the options is "record doc mods". Make sure you're setting that flag when you open the VI reference, otherwise whenever you make edits to the VI, my understanding is that LV will supress the docmod.

0 Kudos
Message 77 of 171
(4,690 Views)

Oh.. I see, I didn't know about this option... Thanks, it works great


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 78 of 171
(4,690 Views)

Antonio, is your xml-rpc 'library' for labview avaialble anywhere for download?

0 Kudos
Message 79 of 171
(4,690 Views)

You can now put your scripting skills to use by creating your own plugin for the JKI Right-Click Framework.

Yes, we've finally released it to the public -- thanks for everyone's patience.

0 Kudos
Message 80 of 171
(4,690 Views)