This chapter gives the general informations for PLC5 to UNITY conversion path.
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.
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 :
<note>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.</note>
I Data is translated in unlocalized variables of EBOOL or INT type depending on the usage.
see outputs translation scheme.
The S Data are translated in unlocalized variables of EBOOL or INT type depending on the usage.
Example :
<note>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.</note>
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:
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:
The F Data is converted in variables of REAL type, and localized in %MW memory plan:
%MW28000 to %MW29299
Example:
The A Data is converted in variables of INT type, and localized in %MW memory plan:
%MW30600 to %MW31499
Example:
The ST Data is converted in variables of STRING type, and localized in %MW memory plan:
%MW31500 to %MW32300
Example:
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:
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:
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 |
The D Data are translated in unlocalized variables of INT type and named Dfilex_y for the original Dx:y PLC5 address.
Example:
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 |
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 |
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 |
Not supported.
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:
<note>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…</note>
The PLC5 ladder routines (LADx) are converted in Unity-Pro as sub-routines named 'Mast_Ladx_<LadName>', with x and LadName the number and name of the corresponding LAD section.
This language is not currently supported by our converter.
This language is not currently supported by our converter.
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
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).
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).
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.
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.
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.
There is no user function blocs in PLC5 like the ADD_ON of RSLogix5000, FB or FC of STEP7 and DFB of Unity_PRO.
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.
Indirection on File number is not supported on I/O. Please revise the destination code or modify the source code.
The comment inside expressions are not translated in Unity-Pro. Please revise the destination code.
Some instruction in Ladder are not supported (eg: ACN, MSG, FOR, BRK, NXT, …)
This language is not currently supported by our converter.
This language is not currently supported by our converter.
Some instruction parameters of COP instructions are not supported
The meta information attached to comment are not translated.
The MCR instruction (Master Control Relay) has no equivalence in Unity-Pro. The Logic must be revised.