03-04-2015 12:56 PM
Hello,
Iam trying to (using scripting) update an event structure (add event cases) on a vi that is not on memory.
i get error 1054 The specified object was not found.
here is a picture of it.
any help in this will be greatly apreaciated.
Solved! Go to Solution.
03-04-2015 02:59 PM
The error comes from the open, because you're looking for the structure in the wrong place. While it makes perfect sense that the owner would be the loop, in practice scripting still isn't that friendly - you have to get the reference of the loop's diagram and use that as the owner.
03-04-2015 03:03 PM
Another option you could use is the traverse VI. This searches the entire BD by class, so you can get all the event structures and then find the one with the label you want. This has the advantage of being simpler and of not breaking if you change the code you're working with.
03-04-2015 03:50 PM
Another suggestion, the following VI is a wrapper for Traverse for GObjects VI and allows you to specify the name of the object you want. I always use this VI, I never use the Open VI Object Reference function, for the reasons tst mentioned:
vi.lib\Utility\traverseref.llb\TRef Find Object By Label.vi
03-04-2015 03:55 PM
Darren, how about adding that to palette for LV 2015, so that it's not a hidden gem?
03-04-2015 04:00 PM
yes..
03-04-2015 04:02 PM
It's too late for 2015, but we'll consider it for 2016.