Jump to content

Pop Quiz, LabVIEW Experts


Recommended Posts

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

post-52118-0-95812100-1452097402.png

Link to comment

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].

  • Like 1
Link to comment

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 by ShaunR
Link to comment

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 by alecjcook
Link to comment

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

Link to comment

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.

Link to comment

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).

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.