LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Local variable event structure

Solved!
Go to solution

Hi,

I am using an array control and event structure for detecting changes in the array value.

At first,I have performed changes in the array(during runtime) and the event structure detected it.

The next step was adding a parallel while loop in which I am writing to the control array(using local variable).

During the runtime the layout of the array indeed changed,but the event structure didn't detect it.

I have attached 2 figures :1)The loop of the event structure 2)the parallel loop.

Is it possible working in such way?

How can I make the event structure detect changes the software performed in the control array?

Thanks,

Leonid

 

Download All
0 Kudos
Message 1 of 4
(5,871 Views)
Solution
Accepted by topic author Leonid_Pascar

Changes done via a local variable are not user events, hence the event structure will not detect them, by definition. You have to write to the control using the "Value (signaling)" property node.

 

That said, your small showing of your code starts to raise red flags in my mind with the use of local variable and global variables. While not evil, their abuse can lead to poor programming architecture and race conditions. Perhaps you should consider uploading your whole VI so someone can take a look at it and offer suggestions on improving it.

Message 2 of 4
(5,861 Views)

Hi ,

Thanks for the advice.Now it works fine.

I replaced the  'writing'(to local variable) to the value property as you had offered.

The red flags were about writing to local variables?

Thanks,

Leonid

 

0 Kudos
Message 3 of 4
(5,820 Views)

This is a long discussion about "red flags" 😉

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 4
(5,817 Views)