CIF to PLC should support Siemens S7
Currently, we support TwinCAT, IEC, and PLCOpen XML output. We should add support for Siemens S7. Notice that there are multiple versions, Siemens S7-300, S7-400, S7-1200, and S7-1500.
At the TU/e there is an S7-300 and an S7-1200 device.
For Siemens S7-300 I have added the files that we should be able to generate for the button_lamp.cif
test case. Most of the output is very similar to the IEC output.
The main program, similar to IEC, except that here VAR
variables are included in a separate database file. To access these variables "DB0."
prefix has to be added. Input variables are accessible by surrounding them with "<varName>"
. Temporary variables are accessible via #<varName>
.
Main.scl
The separate database file holding the VAR
variables.
DB0.db
The function. derivcvar_M_timer_t.scl
The PLC tag list holding the input variables and the constants. PLCTags.xml
The state structure STATE.udt
The files necessary to include timer0
and timer1
.
timer0.db
timer1.db
I haven't check where to use int
and where to use Dint
Aside from this, it would be nice to have some explenation on the website that describes how to import these files in TIA Portal (the software used to program Siemens PLCs).