5. Controlling With a PLC¶
Now that you have created your factory it's time to control it with a PLC. But first, you should learn what I/O Drivers are and how to use them.
An I/O Driver is a built-in feature of Factory I/O responsible for "talking" to an external controller. Factory I/O includes many I/O Drivers, each one for a specific technology. You select a driver in Factory I/O based on the controller you want to use. Next, you configure this driver, so it knows how to "talk" to the controller and how to read and write I/O from it.
As an example, this tutorial shows how to use a Siemens S7-1200 PLC. However, most of the steps described here apply to other drivers as well.
Open the Drivers window by clicking on File and next on Drivers (F4). Alternatively, you may open the Drivers window by Left-clicking on the current driver displayed on the status bar.
Select Siemens S7-1200/1500 Ethernet driver from the list by Left-clicking on it.
Click the Configuration button to setup the driver according to your PLC model and IP address.
Choose S7-1200 model and fill in the Host field with your PLC's IP address. Proceed to the next step by clicking on the Back Arrow (or the ESC key).
Press the Connect button to connect to the PLC. A successful connection will be indicated by a green sign displayed next to the drivers list.
Note that you will find some "Factory I/O (...)" tags displayed in the sensors list (highlighted in the image below). These tags can be used by the controller so it can be "aware" of the status and time scale of the simulation (if it's paused, running in slow motion or fast forward).
Start mapping tags by dragging and dropping each one onto the intended port. To remove a tag from a port just drag it back to the list. Once you have mapped all tags, set the simulation to Run Mode and test your PLC logic.