From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-14-2014 06:59 AM
Hi!
I'm building a system with some instruments and I want to use the same instrument-VI for all instruments.
One way is to do it set it up as 'Possible solution..' (see image).
Is there some way where I can loop through the 'hardware settings'-array and create as many as necessary? Like the 'More what I want...' (see image)?
01-14-2014 07:09 AM
01-14-2014 07:17 AM
Your first solution should work if you set the Run! to reentrant, in which case you'll spawn X copies.
/Y
01-14-2014 07:35 AM
Hmm I might have been a little confusing.
1. The Run!-VI is a loop that runs forever (or until the user exits it). It handles the instrument communication with that specific instrument.
2. I do NOT want it as 'Possible solution..'. since that means I have set up a specific number of loops and I want to be dynamic...
3. In the 'More what I want'- part if I do it as stated, doesn't the first iteration have to end until the next one starts?
I've never worked with 'Configure Iteration Parallelism' so I will look into that!
01-14-2014 08:45 AM
Then start the VI as VI server without waiting on finish (or asynchronous call) and you can start as many as you want. 🙂
Check out the AsynchronousCallAndForget.vi example, or DataserverUsingReentrantRun on how to start VI's as free threads.
/Y
01-14-2014 09:05 AM - edited 01-14-2014 09:06 AM
@ByDesign wrote:
3. In the 'More what I want'- part if I do it as stated, doesn't the first iteration have to end until the next one starts?
I've never worked with 'Configure Iteration Parallelism' so I will look into that!
If the Run! vi has no outputs wired to it's connector pane, then the For loop should start N instances independently (as long as the Run! vi is reentrant).
01-15-2014 06:31 AM
02-13-2014 05:10 AM - edited 02-13-2014 05:11 AM
Hello again thread!
So I'm back on the same problem...
Summary:
What I want to do is something like in the new picture 'parallel loops2.png'. Start X parallel loops that each handle the communication with a specific instrument. At the moment I have 9 instruments connected.
If I use 'Configure Iteration Parallelism' I can set the 'Number of generated parallel loop instances' to the max number (=64 for me) and then use the P terminal with the 'array size' VI to get my 9 instrumentloops running.
When reading this white paper
http://www.ni.com/white-paper/9393/en/ ('Improving Performance with Parallel For Loops')
I'm getting the feeling that the way I solved it is not the way right way. Since the P-terminal should equal the number of cores in the computer.
The Run! VI does not have any outputs wired to its connector pane. It is reentrant (Preallocate clones - No debugging allowed).
I havn't looked at Asyncchronous calls yet. Is that the way to go?
02-13-2014 07:20 AM
I think Asynchronous calls is the easiest route, just gather up the references so you can handle the VI's when needed. (Or just send an Event refnum to them so you can easily shut them down)
/Y