====== PLC5 / UNITY path general informations ======
This chapter gives the general informations for PLC5 to UNITY conversion path.
===== Variables translation schemes =====
The name and comment of the variables are kept with their initial values.
Some variable names may be not supported under destination IDE (i.e. reserved mnemonic, etc.).
These variables are renamed by adding a suffix or a prefix to the original mnemonic.
If no mnemonic exist in the source code, then a mnemonic is created in the destination code using the address of the variable. i.e. a variable in the data Bx:y/z with no associated mnemonic, is translated in a variable named B_x_y_z whose location depending on the type of data.
==== O data - Digital and Analog output ====
The mapping of the digital outputs of the source must be done by the user to define the new location in the new hardware configuration.
The O Data is converted in unlocalized variable of EBOOL or INT type depending on the usage.
example :
* O:011/7 is converted in a unlocalized variable named O_0_11_7 and of EBOOL type.
* O:011/16 is converted in a unlocalized variable named O_0_12_0 and of EBOOL type.
* O:011 is converted in a unlocalized variable named O_0_11 and of INT type.
When setting the location of those variables in the new hardware configuration, be sure to recreate the overlap existing between INT and EBOOL variables. Example: O_0_11_7 should be localized on the bit 7 of the O_0_11 word.
==== I data - Digital and Analog Input ====
I Data is translated in unlocalized variables of EBOOL or INT type depending on the usage.
see outputs translation scheme.
==== S data - System ====
The S Data are translated in unlocalized variables of EBOOL or INT type depending on the usage.
Example :
* S:22 is translated in a unlocalized variable named S_22 of INT type.
* S:10/0 is translated in a unlocalized variable named S_10_0 of EBOOL type.
The behavior of those system variables are not reproduced in Unity-Pro. Please check the usage of those system variables. Eg: S_24 is used for indexation and its calculation must be reviewed in the destination code.
==== B data - Boolean ====
The B Data is translated in variables of BOOL or INT type depending on the usage, and localized in %MW memory plan:\\
** %MW100.0 to %MW999.15 **
Example:
* B3:0 is translated in a variable named B3_0_Int of INT type and localized in %MW100.
* B3:1/10 is translated in a variable named B3_1_10 of BOOL type and localized in %MW101.10.
==== N data - Integers ====
The N Data are converted in variables of BOOL or INT type depending on the usage, and localized in %MW memory plan:\\
** %MW1000 to %MW26999 **
Example:
* N7:60 is converted in a variable named N7_60 of INT type and localized in %MW1060.
* N7:60/0 is converted in a variable named N7_60_0 of BOOL type and localized in %MW1060.0.
==== F data - Floats ====
The F Data is converted in variables of REAL type, and localized in %MW memory plan:\\
** %MW28000 to %MW29299 **
Example:
* F8:3 is converted in a variable named N8_3 of REAL type and localized in %MW28006.
==== A data - ASCII ====
The A Data is converted in variables of INT type, and localized in %MW memory plan:\\
** %MW30600 to %MW31499 **
Example:
* A35:2 with initial value 51 is converted in a variable named A35_2 of INT type, localized in %MW30603 and with initial value 51.
==== ST data - Strings ====
The ST Data is converted in variables of STRING type, and localized in %MW memory plan:\\
** %MW31500 to %MW32300 **
Example:
* ST12:7 is converted in a variable named St12_7 of STRING type and localized in %MW31794.
==== T data - Timers ====
The T data is converted in unlocalized instances of a structure named 'timer' whose structure contains evolution information for the timer as PLC5 does.
Example:
* T4:10 is converted in an unlocalized variable named T4_10_0 of 'timer' type.
==== C data - Counters ====
The C data in converted in unlocalized instances of a structure named 'counter' whose structure contains evolution information for the counter as PLC5 does.
Example:
* C25:4 is converted in an unlocalized variable named C25_4_0 of 'counter' type.
==== R data - Control ====
The PLC5 R data located at Rx:y is converted in Unity-Pro as unlocalized instances, named R_x_y_0, of the UDT named 'control' whose structure contains the information of the corresponding control R data.
Example:
^ PLC5 address ^ Converted in unlocalized variable ^
| R6:3 | R6_3_0 |
| R6:3/15 | R6_3_0.EN |
| R6:3/EN | ::: |
| R6:3.0/EN | ::: |
| R6:3.1 | R6_3_0.LEN |
| R6:3.LEN | ::: |
==== D data - Decimal ====
The D Data are translated in unlocalized variables of INT type and named Dfilex_y for the original Dx:y PLC5 address.
Example:
* D0:20 is translated in an unlocalized variable named Dfile0_20 of INT type.
==== BT data - Bloc Transfer ====
The BT Data is converted in unlocalized variables named Btx_y_0 and of 'block_transfers' type whose structure contains the information of the corresponding BTx:y data.
Example:
^ PLC5 address ^ Converted in unlocalized variable ^
| BT14:1 | Bt1_20 |
| BT14:1/EN | Bt14_20.R_En |
| BT14:1/DN | Bt14_20.Dn |
==== MG data - Message ====
The MG Data is converted in unlocalized variables named Mgx_y and of 'mg' type whose structure contains the information of the corresponding MGx:y data.
Example:
^ PLC5 address ^ Converted in unlocalized variable ^
| MG14:20 | Mg14_20 |
| MG14:20/15 | Mg14_20.R_En |
| MG14:20/EN | ::: |
| MG14:20.0/EN | ::: |
| MG14:20.1 | Mg14_20.Len |
| MG14:20.LEN | ::: |.
==== PD data - PID ====
The PD Data is converted in unlocalized variables named Pdx_y and of 'pd' type whose structure contains the information of the corresponding PDx:y data.
Example:
^ PLC5 address ^ Converted in unlocalized variable ^
| PD15:2 | Pd15_2 |
| PD15:2/EN | Pd15_2.R_En |
| PD15:2/PV | Pd15_2.Pv |
==== CT data - ControlNet ====
Not supported.
===== Codes modules translation schemes =====
Here are described the way each type of code (Ladder, SFC, System codes, …) is translated to the destination file.
Only one section named Main is created in Unity-Pro. It calls:
- the 'Mast_Calculate_System_Data' sub-routine, created to update the PLC5 system variables according to the Unity-Pro system bits/words.
- and the 'Mast_Lad2_...' sub-routine, that is the entry point of the program translated from PLC5 application.
In Unity-Pro, each section is executed one after the other and can call some sub-routines which can also call other sub-routines etc... In PLC5, the LAD2 routine is the entry point and can call other LADx routines that can call other LADx routines etc...
==== LADx - Ladder routines ====
The PLC5 ladder routines (LADx) are converted in Unity-Pro as sub-routines named 'Mast_Ladx_', with x and LadName the number and name of the corresponding LAD section.
==== SFC/Grafcet ====
This language is not currently supported by our converter.
==== Structured Text/Literal ====
This language is not currently supported by our converter.
==== Comments of code ====
The title and description of the ladder rungs in the PLC5 Ladder routines (LADx) are kept in the destination code and merged in the comments of the corresponding instructions.
Note: the rung concept does not exist in Unity-Pro, so each rung of PLC5 is translated in Unity-Pro as instruction(s) whose comment contains at least the rung number.
Example: In the PLC5 LAD3 routine named 'MyName', the Rung 4, whose title is 'my title' and whose description is 'my description', is converted in Unity-Pro in the Mast_Lad3_MyName as instruction(s) whose comment is Rung: 4: my title
my description
==== System functions ====
=== Timer ===
The timer function is converted in an instance named 'T_TON' (or 'T_TOF', 'T_RTO') of a DFB named 'Slc_Ton' (or 'Slc_Tof' or 'Slc_Rto') that reproduces the behavior of the TON (or TOF or RTO) timers of the PLC5. This instance uses the unlocalized variables named 'T_x_y_0' of 'timer' type, that stores the evolution informations of the timer Tx:y from PLC5, to update the status of the corresponding timer.
The instance named 'T_RES' of the DFB named 'Slc_Res_T' is used to reset the timers structures (named 'T_x_y_0' for Tx:y from PLC5).
=== Counter ===
The timer function is converted in an instance named 'C_CTU' (or 'C_CTD') of a DFB named 'Slc_Ctu' (or 'Slc_Ctd') that reproduces the behavior of CTU (or CTD) counters of the PLC5. This instance uses the unlocalized variables named 'C_x_y_0' of 'counter' type, that stores the evolution informations of the counter Cx:y from PLC5, to update the status of the corresponding counter.
The instance named 'C_RES' of the DFB named 'Slc_Res_C' is used to reset the counters structures (named 'C_x_y_0' for Cx:y from PLC5).
==== STI - Selectable Timed Interrupts ====
The configuration (id of the involved LADx, time interval, ...) of STI is not converted to Unity-Pro. However, the ladder code is converted like the other LADx as a sub-routine in Unity-Pro. The usage of the S:2/1 system bit is also converted to a variable named s_2_1 and an error message is deliver for each usage. Please review the launch of periodic task and the enabling/disabling of this task with s_2_1 variable.
==== PII - Input Interrupts (PLC5 only) ====
The configuration (id of the involved LADx, input selection, ...) of PII is not converted to Unity-Pro. However, the ladder code is converted like the other LADx as a sub-routine in Unity-Pro. The usage of the S:x/y system bits and words is also converted as a variable named s_x_y and an error message is deliver for each usage. Please review the launch of event task and the enabling/disabling of this task.
==== DII - Discret Input Interrupts (SLC500 only) ====
The configuration (id of the involved LADx, input selection, ...) of DII is not converted to Unity-Pro. However, the ladder code is converted like the other LADx as a sub-routine in Unity-Pro. The usage of the S:x/y system bit is also converted as a variable named s_x_y and an error message is deliver for each usage. Please review the launch of event task and the enabling/disabling of this task.
==== User function blocs ====
There is no user function blocs in PLC5 like the ADD_ON of RSLogix5000, FB or FC of STEP7 and DFB of Unity_PRO.
==== Special functions ====
The body of special functions (i.e. communications, regulation, axes, motion, …) are not translated. Only interfaces are kept.
Manual conversion is necessary, and rewriting of the code where these blocks are called is recommended in most cases.
===== Intrinsic limitations of the conversion =====
==== Indirection on File number ====
Indirection on File number is not supported on I/O. Please revise the destination code or modify the source code.
==== Lose comment inside expressions ====
The comment inside expressions are not translated in Unity-Pro. Please revise the destination code.
==== Unsupported ladder instruction ====
Some instruction in Ladder are not supported (eg: ACN, MSG, FOR, BRK, NXT, ...)
==== Unsupported structured text files ====
This language is not currently supported by our converter.
==== Unsupported SFC/Grafcet files ====
This language is not currently supported by our converter.
==== Unsupported Parameters for COP instruction ====
Some instruction parameters of COP instructions are not supported
==== Lost meta information attached to a comment ====
The meta information attached to comment are not translated.
==== Unsupported MCR instruction behavior ====
The MCR instruction (Master Control Relay) has no equivalence in Unity-Pro. The Logic must be revised.