LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add shared variables into event structure

I have a PLC and connecting through OPC server. I added tags in OPC server and I can read and write tags from LabView.

I want to add an event structure for <Shared Variable Change> but for that I have to add them at start-up. I want to add Shared Variables in the event structure after button press or whatever, also programmatically after start-up.

How can I do that?

0 Kudos
Message 1 of 4
(2,960 Views)

When you're dynamically registering for events, that event data type is still constant, so you have to create the refnum initially with the same event types as you'll want and same amount of them as well.

 

It's been a while since I worked with shared variables and events. Do you have a code snippet you could share?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 4
(2,895 Views)

I have state machine template. In "idle" mode i have event structure. I also have OPC server, and boolean variables. In case that variable changes from false to true, event handler should change state machine  from idle to step1.

 

How can i do that?

0 Kudos
Message 3 of 4
(2,770 Views)

It is better to proceed with dynamic event But you need to make sure you are Registering the event , Which is an input for Dynamic Event Terminal

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 4
(2,762 Views)