LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior feedback node in shared clone

Solved!
Go to solution

@crossrulz wrote:


But if both classes are accessing that VI at the same time, Shared Clone rules dictate that a new clone would be added to the pool.  So you will not have the "cached" data as the new fresh clone will be used.  What you are describing sounds more like it should be non-reentrant.


Perhaps. But nearly everything can be done differently.

 

On a totally different note, Dynamic Dispatch VIs need to be set to "Shared Reentrant" on FPGA. They get flattened and inlined (where SRs are again not a problem) but that is definitely a combination where shared reentrant and feedback nodes totally work and don't really have a "better" way of doing it.

0 Kudos
Message 11 of 12
(429 Views)

@Kevin_Price wrote:

@RavensFan wrote:

As long as the SR or FBN is initialized when the clone starts executing when it is called, you're fine.


Am I being dense?  If you initialize the SR or FBN when the clone starts executing, why even have the SR or FBN?

 

Oh, I think maybe I get it -- you're thinking specifically of clones with their own internal looping, not the classic single-iteration loop with a USR that I was thinking of.  Right?

 

 

-Kevin P


Correct.

 

I need to loop through an array of data keeping track of a value like a summation.  Obvious shift register.  But you start at 0 (or whatever) with an initialized shift register.   All good.

 

But if your clone needs to keep track of what happened from a previous call to it, then that is the bad situation.

 

I felt like the statement "shift registers in clones" is bad is too generalized and might be misinterpreted as applying to all shift registers.

 

It's kind of like saying all local variables are bad.  They can be if misused.

 

Also saying more than 1 event structure in a VI is bad.  I have many VI's that have a few event structures.  And if you use them carefully and correctly, you'll have no problems.  But put them in the hands of a newbie, then you've got event structures in case,, structures, or other event structures, and set to lock front panel, with unreachable code, and you have an easy to lock up VI.  I tell people to only have 1 event structure in a VI.  Actually you can have more, but if you don't know what you are doing, then just don't do it.

Message 12 of 12
(409 Views)