LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

add event cases to an event structure using scripting

Solved!
Go to solution

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.Pic.JPG

any help in this will be greatly apreaciated.

0 Kudos
Message 1 of 7
(3,643 Views)
Solution
Accepted by topic author El_Tipo

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.


___________________
Try to take over the world!
Message 2 of 7
(3,617 Views)

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.


___________________
Try to take over the world!
Message 3 of 7
(3,615 Views)

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

Message 4 of 7
(3,604 Views)

Darren, how about adding that to palette for LV 2015, so that it's not a hidden gem?


___________________
Try to take over the world!
0 Kudos
Message 5 of 7
(3,600 Views)

yes..

0 Kudos
Message 6 of 7
(3,595 Views)

It's too late for 2015, but we'll consider it for 2016.

0 Kudos
Message 7 of 7
(3,593 Views)