Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Event issue

I hope this explains all the strange things you saw. 

Here is something I noticed while testing Olivier's code.  I don't think it's related to this bug, but I thought I'd mention it.  (This is easier to see if you increase the delay time between data updates.)

1. Launch a clone

2. Let it get a data sample

3. Close the clone

4. Launch another clone

5. Observe the chart before the first sample is collected

Observed: New clone is prepopulated with data from prior clone.

Expected: New clone is pristine and has no stored data.

Obviously Labview is reusing the same memory space, but it does make me wonder if it is safe to assume newly spawned clones are guaranteed to be pristine.

0 Kudos
Message 21 of 25
(1,026 Views)

Daklu wrote:

Observed: New clone is prepopulated with data from prior clone.

Expected: New clone is pristine and has no stored data.

Obviously Labview is reusing the same memory space, but it does make me wonder if it is safe to assume newly spawned clones are guaranteed to be pristine.

This behavior is due to "Share clones between instances" for reentrant exection option of Actor Core. The second run reuse the first clone with its data --> newly spawned clones are not pristine. We need to initialise correctly object in front panel...

As a side note, non initialized shift register and "Share clones between instances" option can be the source of some really *interesting* bug


Olivier Jourdan

Wovalab founder | DQMH Consortium board member | LinkedIn |

Stop writing your LabVIEW code documentation, use Antidoc!
0 Kudos
Message 22 of 25
(1,026 Views)

This behavior is due to "Share clones between instances" for reentrant exection option of Actor Core. The second run reuse the first clone with its data --> newly spawned clones are not pristine. We need to initialise correctly object in front panel...

Right, that makes sense.  I hadn't fully thought through the consequences of creating UI actors.

My confusion was that we're told LV discards data "when it's no longer needed."  I expected LV to discard all the clone memory space (and data) if they had all been closed, since it's obviously no longer needed.  But in the dev environment LV can't tell if we're *really* done with the clones.  We can click on the run button to spawn more at any time, so that memory space stays allocated (and the data persists) for some amount of time.

0 Kudos
Message 23 of 25
(1,026 Views)

Daklu wrote:

This behavior is due to "Share clones between instances" for reentrant exection option of Actor Core. The second run reuse the first clone with its data --> newly spawned clones are not pristine. We need to initialise correctly object in front panel...

Right, that makes sense.  I hadn't fully thought through the consequences of creating UI actors.

My confusion was that we're told LV discards data "when it's no longer needed."  I expected LV to discard all the clone memory space (and data) if they had all been closed, since it's obviously no longer needed.  But in the dev environment LV can't tell if we're *really* done with the clones.  We can click on the run button to spawn more at any time, so that memory space stays allocated (and the data persists) for some amount of time.

It's not just the dev environment. The "shared clones" feature is *designed* to have the clones stick around to minimize the time needed to create a new one. That's why when you write anything for a shared clone VI, you need to take the same approach that you would take with a non-reentrant VI and assume that the panel and any storage you create is in the same state it was in when you last ran it. It might be a fresh clone, but it might not be.

0 Kudos
Message 24 of 25
(1,026 Views)

rliu, this is good news but I have run into situations where simply forcing a recompile fixed the developer code but left errors in the application when built. The only fix I could find was to create an entirely new project and re-populate the project tree + create a new application. I did try clearing the cache, force recompiling, and recompiling with the project closed. None worked. Unfortunately, I cannot post example code since I deleted the old project and it is too big to post all of. I don't have time to try and recreate it on a smaller scale, just wanted you to be aware of this happening.

In my case, the application would unexpectedly close when switching from one UI to another. This only happened when I had altered something acting on or acted on by the next UI's Actor Core. It was like the change made the whole vi unexecutable in the application. It would open and then close before any front panel updates were processed. I could not find a way to capture any error message either. Sorry...I'll try to be more detailed in the future.

0 Kudos
Message 25 of 25
(1,026 Views)