LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Variables in SubVIs reinitialize on every call on MCB2400 in LV2009 Embedded ARM

Solved!
Go to solution

Hello,

 

I have a problem with variables in SubVIs. If I bring them onto my MCB2400 (ARM) they reinitialize on every call. So it´s impossible to Build a Counter in a SubVI. If I run the same VI on my PC everything works fine. Just on the ARM it doesn´t work anymore.

 

In my example (see Attachment) I build two counter. One hat the Variable to increment in the mainVI and the other in the subVI. And that in the mainVI works the other not (on the MCB2400). But if I run the same on the PC both work without any Problem.

 

Has somebody an idea where is m mistake or is it a bug in LV2009 Embedded ARM ?

 

bye & thanks

 

amin

0 Kudos
Message 1 of 3
(6,769 Views)
Solution
Accepted by topic author aminat

This is not a bug.
When it comes to read the local variable the program gets a value from the indicator which is in your PC, not on the target. Control/indicators are not updated continuosly but with the period specified in "Configure Target" dialog. In your application you didn't give any chance to that indicator to be updated until next iteration.
However, it is not recommended to use local variables. You can use instead something like this:

 

feedback node.png

 

 As an alternative you can use 1 iteration loops storing that local into a shift register.

0 Kudos
Message 2 of 3
(6,764 Views)

OK thanks,

 

this solution works. But I still don´t understand why it works with variables in the mainVI and not in a subVI.

 

bye & thanks

 

amin

0 Kudos
Message 3 of 3
(6,762 Views)