You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old March 4th, 2020, 09:24 AM   #1
ygolohcysp
Member
United States

ygolohcysp is offline
 
Join Date: Feb 2020
Location: PA
Posts: 8
Noob Codesys Question

Hello.

I'm wanting to use a boolean value associated with turning an output on to control the visibility of an image. The visibility option in the visualization uses the true state to make it invisible, which is opposite of what I'm wanting. Is there a way to make it use the inverse value? I know I could do that with logic and another variable, but I'm going to have a lot of these images switching for different states, all applicable to different parts of the system. Easy enough, but that would create a LOT of seemingly unnecessary variables when all I need is the inverse value.

Thank you.
  Reply With Quote
Old March 4th, 2020, 09:36 AM   #2
ygolohcysp
Member
United States

ygolohcysp is offline
 
Join Date: Feb 2020
Location: PA
Posts: 8
Okay, sorry for the dumb question. I've been through training almost 4 years ago, and this is the first I'm using that. Though the training was on AB software. I have a lot more complexity already in this system, but this just didn't function the way my brain was wanting it to.

Simply put, it's Variable_Name=0. That =0 part makes it use the inverse of a boolean value.
  Reply With Quote
Old March 4th, 2020, 09:48 AM   #3
gclshortt
Member
Canada

gclshortt is offline
 
gclshortt's Avatar
 
Join Date: Dec 2014
Location: Ontario
Posts: 3,080
http://www.plctalk.net/qanda/showthread.php?t=95959

https://www.wago.com/wagoweb/documen...000000_1en.pdf

You could also use the NOT instruction. See the above.
Regards,
__________________
Garry
https://www.accautomation.ca
Connect with us on Facebook: facebook.com/accautomation/
  Reply With Quote
Old March 4th, 2020, 09:51 AM   #4
lesmar96
Lifetime Supporting Member
United States

lesmar96 is offline
 
Join Date: May 2017
Location: PA
Posts: 403
Can you use NOT(Variable_Name)?

I have used a Codesys platform that we were able to do that for visualizations.
__________________
Whatever you are, be a good one.

Last edited by lesmar96; March 4th, 2020 at 09:52 AM. Reason: Garry beat me to it!
  Reply With Quote
Old March 4th, 2020, 10:03 AM   #5
ygolohcysp
Member
United States

ygolohcysp is offline
 
Join Date: Feb 2020
Location: PA
Posts: 8
I tried with the NOT instruction. Codesys doesn't seem extremely consistent with syntax, and I'm only now just getting back into this. I could try it with the NOT(Variable_Name) approach.

I'm now getting to the 2nd layer of images, 3rd if you count the background, so now I'll get to see if the layer order affects visible layers when multiple states are true like I think it will.
  Reply With Quote
Old March 4th, 2020, 11:00 PM   #6
Mara
Member
Finland

Mara is offline
 
Join Date: Jan 2017
Location: Finland
Posts: 69
Quote:
Originally Posted by lesmar96 View Post
Can you use NOT(Variable_Name)?

I have used a Codesys platform that we were able to do that for visualizations.

This should work and actually you can use other operands as well like AND , OR, XOR etc. Also you can use multiple boolean variables:


e.g. Var1 OR Var2



You can also use comparators for the numeric values:


Var1 = 5 (Turns your image invisible if the value of the variable equals to 5)


Or you can type Var1 <> 5 (Turns your image invisible if the value of the variable is something else than 5)

Last edited by Mara; March 4th, 2020 at 11:05 PM.
  Reply With Quote
Old March 11th, 2020, 12:17 PM   #7
ygolohcysp
Member
United States

ygolohcysp is offline
 
Join Date: Feb 2020
Location: PA
Posts: 8
Quote:
Originally Posted by Mara View Post
This should work and actually you can use other operands as well like AND , OR, XOR etc. Also you can use multiple boolean variables:


e.g. Var1 OR Var2



You can also use comparators for the numeric values:


Var1 = 5 (Turns your image invisible if the value of the variable equals to 5)


Or you can type Var1 <> 5 (Turns your image invisible if the value of the variable is something else than 5)
I meant to say thank you for this information back when you posted it. I hadn't hit submit, and then got busy. But I definitely wanted to say thank you. I've used some of these tips since then. Absolutely helpful.

Only questionable thing left is setting up modbus connections and pulling real time data from those. I have a bit of info on doing that, so as soon as I get the actual modules to tie in and test with, I'll tackle that. Thank you!
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
wago codesys string question ganutenator LIVE PLC Questions And Answers 3 November 13th, 2019 05:54 PM
CoDeSys Project Platform Ideas ross1219 LIVE PLC Questions And Answers 11 April 26th, 2017 04:49 AM
Codesys noob help Jonas3310 LIVE PLC Questions And Answers 4 July 1st, 2013 04:40 AM
Learning CoDeSys bopol LIVE PLC Questions And Answers 5 July 18th, 2011 09:15 AM
Recent testing question mrtweaver LIVE PLC Questions And Answers 19 August 28th, 2009 03:14 PM


All times are GMT -4. The time now is 11:44 AM.


.