Read here how to install the GRAFCET Engine on a SIEMENS S7-300/S7-400 or a VIPA S7 controller.
The GRAFCET-Engine can be installed directly in the controller with GRAFCET-Studio. The IP address should already be configured and known.
This ensures support for SIEMENS controllers from CPU 314 (128 KB RAM) and above. CPU312 is not supported, because it has only 32 KB of RAM. The PLC should support a max. block size of 64 KB. If your PLC is too old, this is unfortunately not the case and an error message will appear when downloading the Grafcet engine.
Recommendation: The MicroPLC and the SLIO from VIPA GmbH are best suited for the GRAFCET engine, as these CPUs achieve the shortest cycle times during our tests.
The following adapters are supported:
A serial connection with a serial MPI adapter is not supported.
When you install the GRAFCET Engine, all user blocks are deleted before the GRAFCET Engine is transferred.
An attempt is now made to establish a connection to the device. If this is successful, the GRAFCET engine is loaded into the controller. If problems occur, e. g. not enough memory available in the PLC, an error message appears. After download, switch the PLC state back to RUN mode.
The way to the 'Install GRAFCET Engine' button:
If you needed: You can now load the blocks of the Grafcet engine into your Step7 project with your programming system. In this way, you can continue to load the GRAFCET engine with your programming system into the PLC in the future. If required, you can supplement the GRAFCET with your own user program. It is important that the Grafcet engine in OB1 is called cyclically.
Once the GRAFCET engine has been transferred, it is immediately ready for use. There is already an OB1 and an OB100 that call the GRAFCET Engine correctly.
This section describes how to call the GRAFCET engine in OB1 if OB1 and OB100 do not yet exist.
Template for starting up the OB: In this case, the M0.0 flag is set to TRUE, so that you can recognise whether a start-up takes place in the OB1.
OB start-up (OB100) in instruction list (STL):
SET = Set "CompleteRestart" //M0.0 to TRUE, so that start-up is recognized in the OB1
The GRAFCET Engine is called up in the OB1:
OB1 in instruction list (STL):
O "CompleteRestart" //M0.0 = #InitGrafcet //InitGrafcet is a temp variable, created in the OB1 CALL "GrafcetStart" //Call up the GRAFCET Engine (FC993) and transfer the information on whether to initialise Init :=#InitGrafcet CLR = "CompleteRestart" //Set M0.0 to FALSE (very important!!!)
Please note: A bool operand needs to be transferred to the "Init" parameter, which is TRUE for the 1st cycle only (on start-up). The two lines after the CALL make sure of this. If the "Init" parameter is always TRUE, the GRAFCET Engine does not work.
You do not need to make any special settings in the CPU for the GRAFCET Engine to work.
A S7 controller now needs to be added as a device in the GRAFCET Engine window in GRAFCET Studio:
If your device has several modules for inputs/outputs, one type of modules (e.g. digital inputs) should be addressed in one range without gaps. Otherwise you can't access all signals with the Grafcet Engine.
After confirming the Settings for the S7-300... dialog, the new device appears in the list.
Select the new device in the list, and click on the Connect button in the GRAFCET Engine window.
If everything is correct, the window should now look as follows:
|If the two counters are incremented, the GRAFCET Engine is correctly installed in the PLC and is called up in the OB1.|
If the two values are not incremented, then check the following:
For the first test, you can write the following GRAFCET to the PLC. The GRAFCET makes the output "Q0" flash.
If you use the default settings, output "Q0" is connected to the output address "A0.0". As shown in the previous section, you can adjust the address freely with the I/O settings. If the PLC is correctly wired and the GRAFCET Engine is installed in the PLC, the output should now flash.
Check the following if problems occur:
For further interesting GRAFCET examples and "best practice" procedures go here.
This link provides you with examples of: