alecjcook Posted January 6, 2016 Report Share Posted January 6, 2016 Hi LabVIEW experts. I have a question, and I'm going to pose it as a quiz. I have 2 VIs, a main one and a sub on (see attached picture) When I run the main VI, it calls the sub VI (which is essentially a functional global variable). The question is. What is the value of the indicator "Array" after execution? Cheers, Alec Quote Link to comment
ShaunR Posted January 6, 2016 Report Share Posted January 6, 2016 Any 3 values between 1 and 9 in any order.? Quote Link to comment
crelf Posted January 6, 2016 Report Share Posted January 6, 2016 With the load option as 0x48, that means your Sub.vi is going to have to be set for shared clone reentrant execution, so I'd say you'll get [3,6,9]. 2 Quote Link to comment
drjdpowell Posted January 6, 2016 Report Share Posted January 6, 2016 Not sure how 0x8 and 0x40 options interact, but with 0x40 you are creating three shared clone pools, so the answer would be three values between 1 and 3, depending on how LabVIEW assigns idle clones in the pool. With just 0x8, you’re making three clones, and the answer is [3,3,3]. 1 Quote Link to comment
ShaunR Posted January 6, 2016 Report Share Posted January 6, 2016 (edited) Not sure how 0x8 and 0x40 options interact, but with 0x40 you are creating three shared clone pools, so the answer would be three values between 1 and 3, depending on how LabVIEW assigns idle clones in the pool. With just 0x8, you’re making three clones, and the answer is [3,3,3]. I think it is one pool because of the strict type ref. Called in any order because of the Asych call and as if parallel iterations was enabled of the for loop.. For those who haven't seen this before. It is a demonstration of this behaviour. Foot Shooting factor 9000! What do we get if we win? Can I go home early? Edited January 6, 2016 by ShaunR Quote Link to comment
Ryan Podsim Posted January 6, 2016 Report Share Posted January 6, 2016 3,6,9 Due to data dependency and loop iteration, the calls are sequential. Since the subVI must be a shared clone, only 1 clone is ever needed and thus 1 data space. 1 Quote Link to comment
alecjcook Posted January 7, 2016 Author Report Share Posted January 7, 2016 (edited) OK, so The answer is 3,6,9. Well done crelf and Ryan! I would LIKE the answer to be "3,3,3". So the real question is... What do I have to do to this VI to achieve this? With the load option as 0x48, that means your Sub.vi is going to have to be set for shared clone reentrant execution, so I'd say you'll get [3,6,9]. 3,6,9 Due to data dependency and loop iteration, the calls are sequential. Since the subVI must be a shared clone, only 1 clone is ever needed and thus 1 data space. Edited January 7, 2016 by alecjcook Quote Link to comment
drjdpowell Posted January 7, 2016 Report Share Posted January 7, 2016 I would LIKE the answer to be "3,3,3". So the real question is... What do I have to do to this VI to achieve this? Stop using the 0x40 pool option. You don’t want a reference to pool of clones. Try just 0x8. 1 Quote Link to comment
ShaunR Posted January 7, 2016 Report Share Posted January 7, 2016 (edited) OK, so The answer is 3,6,9. Doh! It wasn't a call by asynch node that was used. Opticians appointment confirmed. Edited January 7, 2016 by ShaunR Quote Link to comment
alecjcook Posted January 8, 2016 Author Report Share Posted January 8, 2016 Stop using the 0x40 pool option. You don’t want a reference to pool of clones. Try just 0x8. nono, i DO want to reference a pool of clones. I want to open 3 clones of the same VI, and be able to run them independently, and store the references so I know which clone instance i'm talking to Quote Link to comment
drjdpowell Posted January 8, 2016 Report Share Posted January 8, 2016 nono, i DO want to reference a pool of clones. I want to open 3 clones of the same VI, and be able to run them independently, and store the references so I know which clone instance i'm talking to That’s not a “poolâ€. That is three independent clones. A pool is when you don’t care which instance you are talking to. Quote Link to comment
ShaunR Posted January 8, 2016 Report Share Posted January 8, 2016 nono, i DO want to reference a pool of clones. I want to open 3 clones of the same VI, and be able to run them independently, and store the references so I know which clone instance i'm talking to Don;t wire anything to the "options" terminal of the open primitive. You don't really want a shared pool, you want pool of 3 individual instances (pre-allocated). Quote Link to comment
crelf Posted January 18, 2016 Report Share Posted January 18, 2016 So, how did you get on? Did you get what you were looking for? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.