03-10-2024 06:31 AM
03-10-2024 07:26 AM - edited 03-10-2024 07:47 AM
I believe your problem comes from the fact that you use a static reference. As such the VI is part of the executing VI hierarchy and therefore is put in reserved mode. However scripting on VIs that are not in edit mode is not possible.
You need to open the VI reference explicitly through an Open VI Reference node and the correct path to your VI.
I take that back, the Splitter seems not possible to Delete. It also can't be selected in the front panel and deleted. You explicitly have to select the "Remove with Adjoining Splitters" menu but there seems no corresponding scripting method for that.
03-10-2024 08:13 AM
Hi rolfk,
Thanks for your response. Having a static VI reference in a script diagram forces it in memory but does not put it in reserved mode when the script is running. I've always done scripting like that without any problem. Also, opening the VI by path with "Open VI Reference" makes no difference.
Regards,
Raphaël.
03-10-2024 09:54 AM
03-10-2024 10:05 AM
I've never worked with splitters, but could you make a recursive VI that calls itself with a reference to a sub-splitter (if present), otherwise it deletes itself? [I haven't done enough with LabVIEW scripting to try the experiment myself].
Bob Schor
03-10-2024 11:19 AM
03-11-2024 03:25 AM
As mentioned before, splitters seem to be a special object unlike other front panel objects. Apparently it's not so simple to just delete them, since they do interact with each other and the window itself to support the various resizing options. So deleting the object requires to inform all adjunct splitters and the window to be informed about this. And there is a special method for that in the pop-up menu. In the front panel the delete seems explicitly disabled for a splitter (selecting it and pressing delete doesn't do anything unlike for other objects) but in the scripting interface this has been overlooked.
The fact that the Delete method for that object simply crashes is definitely a bug. Even if it would be not possible to implement that method for some reason, it should be stubbed out and produce an error rather than going off into lala land.
03-11-2024 07:04 AM
@rolfk wrote:The fact that the Delete method for that object simply crashes is definitely a bug. Even if it would be not possible to implement that method for some reason, it should be stubbed out and produce an error rather than going off into lala land.
Completely useless, but...
Produces the expected error:
03-11-2024 07:11 AM
wiebe@CARYA wrote:
@rolfk wrote:The fact that the Delete method for that object simply crashes is definitely a bug. Even if it would be not possible to implement that method for some reason, it should be stubbed out and produce an error rather than going off into lala land.
Completely useless, but...
Produces the expected error:
In this case it is the Panel that is not deletable, just as the block diagram. It has nothing to do with splitters.
03-11-2024 07:37 AM
@raphschru wrote:
wiebe@CARYA wrote:
@rolfk wrote:The fact that the Delete method for that object simply crashes is definitely a bug. Even if it would be not possible to implement that method for some reason, it should be stubbed out and produce an error rather than going off into lala land.
Completely useless, but...
Produces the expected error:
In this case it is the Panel that is not deletable, just as the block diagram. It has nothing to do with splitters.
🌴🙄 (:palmface:)
Shouldn't (try to) do scripting right after lunch.