====== ORPHEE / UNITY path general informations ======
This chapter gives the general informations for ORPHEE to UNITY conversion path.
===== Variable translation schemes =====
The name and comment of the variables are kept with their initial values.
Some ORPHEE variables names may not be supported under Unity (i.e. reserved mnemonic …).
These variables are renamed by adding a suffix or a prefix to the original mnemonic.
==== Internal variables ====
The internal variables are kept except for the [[#Rx memory plan|RX bits]].
==== Digital inputs/outputs ====
The mapping of the digital input/output of the source must be done by the user to define the new location in the new hardware configuration.
==== Analog inputs/outputs ====
The mapping of the analog input/output of the source must be done by the user to define the new location in the new hardware configuration. \\
Warning for the analog format: \\
* With ORPHEE, the analog format for input and output is between 0-32767 points. Each analog board is associated to an array of word whose size corresponds to the number of analog input/output of the board.\\
* With UNITY, the format is between 0-10000 points for each analog input/output.\\
A scaling (for inputs and outputs) must be performed manually and the scaling output must be assigned to the corresponding word.
===== Codes modules translation schemes =====
==== CC (Cyclic Code) ====
CC is converted in sections. The section name is made with the CC number and the CC name. Example:
^**CC**^**Orphee Name**^**UNITY Section**^
|1|Start|Cc1_Start|
==== CF (Background Code) ====
CF is converted in sections. The section name is made with the CF number and the CF name. Example:
^**CF**^**Orphee Name**^**UNITY Section**^
|1|Start|Cf1_Start|
==== EP (Program Event) ====
EP is converted in subroutines. The SR name is made with the EP number and the EP name. Example:
^**EP**^**Orphee Name**^**UNITY Subroutine**^
|1|InitG7|Ep1_Initg7|
==== EI (Interface Event) ====
EI is translated in subroutines. EI is a subroutine called on rising and/or falling edge on a combination of inputs. These combinations of inputs are configured directly on the input board.
The calls for EI are not converted. Hardware configuration has to be manually edited and needs to have a complete listing of the program to find the combinations of inputs triggering the call to an EI.
==== ES (System Event) ====
ES is in Mast_Es_Sections written in literal language.
^**ORPHEE**^**Comment**^
|ES0|ON->OFF|
|ES1|DIAG|
|ES2|OFF>ON|
|ES3|RUN>STOP|
|ES4|STOP>RUN|
|ES5|1/100s|
|ES6|1/10s|
|ES7|1s|
The translation scheme in UNITY is:
if Es0 then
.....;
end_if;
if Es1 then
.....;
end_if;
....
if Es7 then
.....;
end_if;
All ESx variables are translated by non-addressed Boolean.\\
The code needs to be manually revised.\\
ES5, ES6 and ES7 may be considered like periodic tasks. The user must choose the best conversion scheme.
==== Restart after Power ON =====
This part describes the different restart of an April PLC and their impact on the variable initialization.
The initialization to be made manually in Unity for a conversion is described here under.
* **%ES0 : Shutdown: ON > OFF and %ES3 : Run -> Stop**
* On April PLC: This does the %MX initialization to 0
* Under Unity: a section needs to be manually created to initialize all variables of %M type to 0 on Warm-start (%S1) or on First Cycle (%S13).
* **%ES2 : Restart: OFF > ON and %ES4 : Stop => Run**
* Case 1: Usage of %CONT (by default)
* On April PLC: This does the %MX initialization to 0
* Under Unity: a section needs to be manually created to initialize all variables of %M type to 0 on Warm-start (%S1) or on First Cycle (%S13).
* Case 2: Usage of %INIT
* On April PLC: This does
* the %MX initialization to the initial value defined in the declaration for variables that have initial value and to 0 for the others.
*the %RX and %MW initialization to the initial value defined in the declaration for variables that have initial value and the others do not change.
* Under Unity: It needs to create
* a section to initialize all variables of %M type to 0 or to the initial value on Cold-start (%S0) or First Cycle (%S13).
* a section to initialize %MW (%RX or %MW) to the initial value (for those that have one) on Cold-start (%S0) or First Cycle (%S13).
==== TD (Default Processing) ====
TD is converted by SR (subroutine).
TD calls can be configured for each card:
* default setting
* internal fault
* external fault
* No Run
* Run
The calls for TD are not converted. The TD calls must be converted manually according to the event that triggers (board setting) the call of TD.
==== SFC ====
=== GM (Master SFC) ===
Converted in SFC.
There is no need to program the initialization of the GM because on Unity-Pro the SFC are initialized by default when application starts.
=== GE (Slave SFC) ===
Converted in SFC.
The notion of SFC slave does not exist in UNITY. SFC slave are converted as simple SFC.
The user has to revise the destination code to deactivate the slave SFCs when application starts in oder to reproduce the behavior of April PLCs.
=== XE (Macro SFC) ===
Converted in SFC Macro State.
=== TR (Transition Management) ===
Converted in one section for one SFC, where all transitions are evaluated.\\
Conversion may contain code in addition to the evaluation of the transition. In this case, the user has to make this part of the code to the previous step deactivation or the next step of activation.
=== TT (Task Management) ===
Converted in one SR by State. This SR is called in Actions directory of the SFC
=== TG (Graph Management) ===
Converted in one SR by Slave SFC. This SR is called in Actions directory of the Master SFC.
=== BFC SFC Management ==
These constructor function blocs that manage the SFCs are converted in DFB without code. The user has to revise the management of those functions.
* DESACGE - see Unity-Pro Clearchart function
* DESACGM - see Unity-Pro Clearchart function
* INITGE - see Unity-Pro Initchart function
* INITGM - see Unity-Pro Initchart function
* DEGELGE
* DEGELGM
* DESACGE
* DESACGM
* FORCGE
* FORCGM
* FORCXE
* GACGE
* GACGM
* GINGE
* GINGM
* MEMGE
* MEMGM
* MEMXE
==== Comments of the program ====
The comments of the program are kept.
==== BFC ====
The Constructor defined Function Bloc (BFC) are converted under Unity as DFB. The content of those DFB is empty for the non-translated BFCs.
=== Timers and Counters ===
The BFC TON, TOF, TP, PULSOR, COUNT are converted as DFB
^**BFC ORPHEE**^**UNITY DFB**^
|TON|Bfc_ton|
|TOF|Bfc_toff|
|TP|Bfc_tp|
|PULSOR|Bfc_pulsor|
|COUNT|Bfc_count|
==== BFU ====
The user defined function blocs (BFU) are converted under Unity as DFB.
==== Special functions ====
Special functions (i.e. communications, regulation, axes, motion, etc.) are not converted.
Manual conversion is necessary.
===== intrinsic limitations of the conversion =====
==== Array indexation ====
With APRIL PLCs, the index of array can go out of the range of the array. This behavior is not supported by Unity.
The conversion works only for index inside the array range. It means that if in your application an index goes over the range of the array, the behavior of the application is not reproduced in Unity.
This overflow can appear for all type of array depending on the value of the index. But for the arrays that contain 0 element, it appears for all value of index, so a specific message identifies those arrays used as pointer.
==== Timers and counter scan ====
When timers or counters are not scanned (in a conditional jump in a non-validated CC ...) the current value is frozen. At the resumed of the scan, the evolution of the current value is from this frozen value.\\
The user must check the timers or counter potentially not scanned in the code, and choose the best translation.\\
==== Timers and counter Arrays ====
ORPHEE allows the use of counters and timers arrays.\\
The user must identify the Indexed access to arrays or counters in the code, and choose the best translation.
==== Calling TD ====
[[#TD (Default Processing)|See TD (Default Processing)]]
==== Calling EI====
[[#EI (interface Event)|See EI (interface Event)]]
==== Calling ES ====
[[#ES (System Event)|See ES (System Event)]]
==== RX memory plan====
RX bits have no correspondence with UNITY.\\
RX bits are memorized bits of the APRIL PLCs. It means that the value before a loss of power is kept after the power on of the PLC.\\
Moreover, it is possible to use arrays of RX.\\
To reproduce this behavior under Unity-Pro, the simple RX bits (not the RX arrays) should be manually mapped on bits of words in the %MW memory plan, which is the only one memory plan saved during power loss in Unity-Pro PLCs.\\
The RX arrays cannot be mapped in %MW memory plan, because this plan does not reproduce the bits array structure. So the RX array must be unmapped. But the unmapped variables are not saved during power loss. So a copy of the RX arrays values to bits of words of the %MW memory plan, must be manually programmed at each end of PLC cycle.\\ As well, at the beginning of the PLC cycle, the memorized values located in the %MW must be copied in the RX array variables.\\
**IMPORTANT**: These parts of %M memory plan must be mapped outside the other parts of this memory plan used by the codes and other variables of this applications.
**IMPORTANT**: The option "Reset %MW on cold start" must be disabled, otherwise the RX memorized values in %MW will be erased on PLC power on.
==== TR with code in addition to the evaluation of the transition ====
[[#TR (Transition Management)|See TR (Transition Management)]]
==== Scaling the Analog Inputs/Outputs ====
[[#Analog inputs/outputs|See Analog inputs/outputs]]
==== LI temporary variables ====
In graphical languages, for some $li* temporary variables used between two functional boxes, the type can not be determined automatically. The type is then set to undefined. The user has to revise the undefined types in the destination code. See [[74000|specific message.]]
==== Array of Timer/Counter ====
On ORPHEE it is possible to use arrays of timers or counters. It is not possible Under Unity-Pro.
Those arrays can be detected if:
* for the timers, the ET input or the PT or Q outputs have the Array(i) form.
* for the counters, the R_MIN or R_MAX inputs or Q_MIN or Q_MAX or CV outputs have the Array(i) form.
If it is array of timers/counters, the simplest solution is to create as many instances of timer or counter as the array size and to validate the instance with the index of the array.
==== DFB outputs internally read before written and written outside the DFB ====
On ORPHEE it is possible to write a formal output of a BFU/BFC from a section extern of the BFU/BFC. Under Unity it is not possible and the formal output of the DFB keeps its value of the previous cycle.\\
So in a DFB, all formal parameters declared as "OUTPUT" and that are read internally before been written and whose associated effectiv parameter is written outside the DFB, must be manually defined as "INPUT/OUTPUT" instead of "OUTPUT".