Jump to content

Help with shared variable between my computer and compactRIO PLC


Filippo

Recommended Posts

Hello everyone, I'd like to start saying that I'm a beginner with LabVIEW.

I was trying out a very simple code to get acquainted with shared variables. In this code, I want that, by pressing 'OK' on scada.vi, the LED in rt.vi turns on. To do this, I created a 'start_S' variable in 'My Computer' as shown with there features:

-Type boolean;
- Network-Published
- Initial value equal to "False"


I can't understand why this very simple programm can't work, when i run scada.vi and rt.vi, i press the ok button and the led in rt.vi doesn't turn on!

Canyou please help me? Thanks.

 

image.png.dd8fc7eef010ae195164f97b31e863e9.png

Edited by Filippo
Link to comment

Hi Filippo.

My guess is that your "OK Button" has its mechanical action set to "Latched when released". Since you update the shared variable with the value from "OK Button" every 100 ms you will not even see the "Boolean" blink.

I would use an Event structure in your "scada.vi" and create a "Value Changed" event for the "OK Button". In that event case I would update the shared variable from the "New Value" terminal. I would also create a "Value Changed" case for the "stop" button and wire the value from the "New Value" terminal to the loop termination terminal. Then you can remove the 100 ms delay.

I hope this helps.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.