01-30-2015 11:47 AM
OK, so there is one problem with that method above - if an actor fails at pre-init, then the last ack is never sent. I realize now, I have done this before - I had a list of booleans that was paired with the queues, and rather than removing actor enqueuers, I simply toggled the boolean to indicate whether the actor was present or not. But, three has to be a way to adjust the above code so that it can account for an actor fail at pre-init? I will think on this...
01-30-2015 12:04 PM
A fail at pre-launch init should cause an error to be returned from Launch Actor. Watch for that error and never add the enqueuer for the failed actor to the list in the first place.
01-30-2015 02:22 PM
I'll be lazy and not look yet, so feel free to disregard this message Matt if you choose, but where is the error picked up? If I use the Launch Nested Actors VI, I don't believe failure here will reverberate through the root actor (i.e. there is no error that can be picked up where the actor is launched). But, I am likely mistaken. I will take a closer look at this.
01-30-2015 02:28 PM
Actually, it is picked up. Dig into Launch Nested Actor, then down to Launch Actor Core. There is a queue that is used to pick up any errors reported from Pre-Launch Init. You can see how it works if you dig down into Actor.vi - an error sent out from Pre-Launch Init will make it all the way back up to the caller of Launch Nested Actor.
01-30-2015 04:01 PM
Great! Thanks a lot, Matt! I will take a look at this. Matt
02-01-2015 11:47 PM
OK...This works great and I learned something in the bargain that seems simple enough but was killing me - if you try to loop through an array of size 0 and expect an error to be passed through, think again...I know this is going to bite me again in the near future, but c'est la vie. Thanks a lot, AQ and Matt.
m
02-02-2015 03:49 AM
Just a note about the 0 sized array in a for loop: You can guarantee any wire to get through if you use shift registers. I always use shift registers for my error wires, as well as for my class wires. In case of 0 iterations the initial value will be passed thorough.
02-02-2015 10:04 AM
When you drop a For Loop around existing code, starting in LV 2014, LV automatically adds shift registers instead of tunnels for error wires. That helps by catching one of the ways you get into this problem.
You need to use shift registers for refnums that you expect to pass through also.