I am trying to write a code that enables the visibility of a button if the machine being used matches a certain IP address using an if/else statement. I’m getting a syntax error on the first line, it doesn’t like the “=” for some reason, and didn’t work when I changed it to “==” either. I’m not the best at this aspect of Ignition, and would really appreciate a nudge in the right direction.
Thanks so much!
ip = system.net.getIpAddress()
if ( ip == “192.168.245.XXX”, event.source.parent.getComponent(‘Button 4’).visible = True,
event.source.parent.getComponent(‘Button 4’).visible = False)