Before reading this topic, you might want to ensure you are familiar with the concepts in Key Concepts About Emulation and Validating PLC Logic.
In this topic, you'll learn more about the phase in which you validate PLC logic by connecting your model to a PLC or server. We'll refer to an OPC DA Connection, but the setup is similar for other connection types.
Once the PLCs have been programmed, you could possibly use FlexSim to then validate whether the PLCs had been programmed correctly before they are actually implemented in a manufacturing system. To validate this logic, you'd need to connect FlexSim to a PLC server.
After inputting all of the server's permissions, you'd also have to assign all your emulation variables to their appropriate tag IDs on the server. You'd then make the connection shared asset active in FlexSim so that it will directly read or write values on the actual server. This will also cause your internal ladder logic to stop working. Sensors will no longer trigger their on Change event, meaning that any event listening activities will no longer be notified when a sensor variable is changed. Instead, this logic will be handled by the PLC.
At this point you could run the simulation model and test that the PLCs are operating the way they should operate in the actual system. In theory, you would have created a simulation of your future business system in FlexSim. So, the PLC will directly control the elements in the simulation model. You can then observe how the actual PLC has been programmed and compare it to the way the simulation model ran before the PLC was directly connected to the model.
To connect a PLC server to a FlexSim simulation model:
1
.localhost
if you're running it locally on the same
machine as the simulation model.One thing you need to pay attention to when running the simulation model while connected to an active server is the speed at which you are running the model. While you can technically set the run speed to a greater value, you should ideally run it at the 1.00 speed, which means it will run in real time.
Be aware that FlexSim will run in high precision time when the server is active. High precision run time means it will keep the run speed of FlexSim in sync with the run speed of the computer. Stepping will be unavailable while you are connected to an active server.
During the simulation run, it might be good to open the server and watch the values change. You'll be able to better ensure that they match what happens in the simulation model. The ladder logic used with Sensors should no longer be used when the connection is active. You should ensure that there are no tokens moving through this ladder logic during the simulation run.