Troubleshooting
If the PLC communication seems to be not working, check on the PLC component that the status variable says “RUNNING”. If it displays “ERROR” or “STANDBY”, the connection has not been properly established. More information about the state can be seen in the info property.
An example is shown below, where the variables are not named the same way in Simumatik and the PLC software. If you have any issue, please check that the PLC project has OPCUA enabled, that the URL is correct, and the I/O variables have the correct name and size.

Practice
To practice your programming skills, you could try to implement the following logic behaviors (separately):
‘H01’ should be switched on while ‘S01’ and ‘S03’ but not ‘S02’ is pressed.
‘H02’ should be switched on when ‘S01’ is pressed and switched off when ‘S03’ is pressed.
‘H01’, ‘H02’, and ‘H03’ should switch on for 1 sec, one after each other and on a loop, while ‘S02’ is pressed.
We hope you enjoyed this PLC Tutorial. Head over to our Community Forum to join the discussion, get inspiration or support!