06-19-2012 09:42 AM
This never really occured to me until now but when you place the same vi on the front panel twice, are two instances of the vi created or is one vi just a copy of the other. I'm not sure if what I'm saying makes sense but take a look at my vis below, top level vi being "Multiple Instance of Same VI.vi"
The vi below is merely an illustration as to what seems to be happening in my large program. In my VI below I'm wondering are the two controls accessing the same instance of the VI or have each control their own instance?
Strokes
Solved! Go to Solution.
06-19-2012 10:02 AM - edited 06-19-2012 10:07 AM
Read this excellent summary of the re-entrant modes that Altenbach wrote.
http://forums.ni.com/t5/LabVIEW/Re-entrant-modes/m-p/2007811#M660105
The value of the feedback node in your subVI will be shared between the instances. Go to Properties/Execution and enable Reentrant execution. Click on Preallocate clone for each instance.
06-19-2012 10:08 AM
@Steve Chandler wrote:
Read this excellent summary of the re-entrant modes that Altenbach wrote.
http://forums.ni.com/t5/LabVIEW/Re-entrant-modes/m-p/2007811#M660105
The value of the feedback node in your subVI will be shared between the instances. Go to Properties/Execution and enable Reentrant execution. Click on Preallocate clone for each instance.
Excellent resource and put in layman's terms as well for non-jargon enthuasiasts
Just what I was looking for!
06-19-2012 10:14 AM
Because your subVI is not reentrant your code shares a simgle copy of the VI. Also, as a result of this they cannot run in parallel. Only one call to the subVI will execute even though it appears they should run in parallel. Because you have a shared copy the internal shift register will be shared therefore you could have side effects if you wanted each to have it's own data.
02-13-2015 10:03 PM
Hello all,
any hints ?
I have tried using the re-entrantcy settings in VI properties for the attached vi but still have a problem with my application using RT on myRIO. They dont improve the situation.
I have created the attached vi to replace the "picture to pixmap" block which is not supported in RT. I gleaned this idea from the forum and it works when the sub vi is only called once. I need to extract the pixmap infor from a picture.
However when I call it twice, either in parallel or in a sequential frame (to avoid calling at the same time) it doesnt function properly.
I wish to convert several independent pictures into independent pixmal arrays.
Can anyone see why this vi cannot operate on more than one set of data ? is it to do with the "picture1" property nodes not being shareable ? or is it a RT issue ?
Thanks,
carloman
02-16-2015 07:28 AM
What do you mean by "Doesn't function properly".
If this is running on RT, then it doesn't really work. Property nodes to controls are not supported on RT. I don't think the Simple Error Hanlder is either. In general, you should not have any GUI elements on an RT target, that includes the myRIO.
If you are trying to truely make two instances of this VI run completely in parallel, then you need to be more careful about what VIs you call. That Draw Text in Rect.vi is NOT set to be reentrant. So only a single instance of that VI can exist in a system.
02-17-2015 03:46 AM
Thanks for your reply. Much appreciated. I believe it hits the nail on the head.
It doesnt work propoerly in the sense that either need to open up the sub vis front panel in order for the sub vi to execute , and /or it doesnt pass the correct picture value eg: only displays the first image or the second or neither...its not obvious what it will do.
I believe this is consistent with the issue you mentioned about RT not supporting "property nodes" .... as they are sampled asynchronously.
All I want to do is create multiple text strings to be placed in a 2D "pixel" array of size 64 x 128 which is passed to a small LCD display hanging off the RT system. I to be able to accumulate several seperate strings of text eg to display a table of text on this little 64 x 128 display.
So since "picture to pixmap" is not supported in RT, and the only work around I can find uses "invoke node" to "get image" I think this is a dead end.
What do you think of my alternative being to write my own "create text" subvi which is specifically written for my simple 64 x 128 application. The input is multiple strings, positions and custom font info, and output is a 64 x 128 pixel array (pixmap). This bypasses the use of "pictures" altogether.
Can you foresee any problems with this ?
The benefits would be that if I avoid using property nodes, and just use simple LV code blocks, I should have no problems deploying it to RT as an exe later.
Regards.
carloman