Table of Contents

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 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:

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:

CCOrphee NameUNITY Section
1StartCc1_Start

CF (Background Code)

CF is converted in sections. The section name is made with the CF number and the CF name. Example:

CFOrphee NameUNITY Section
1StartCf1_Start

EP (Program Event)

EP is converted in subroutines. The SR name is made with the EP number and the EP name. Example:

EPOrphee NameUNITY Subroutine
1InitG7Ep1_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. <note>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.</note>

ES (System Event)

ES is in Mast_Es_Sections written in literal language.

ORPHEEComment
ES0ON→OFF
ES1DIAG
ES2OFF>ON
ES3RUN>STOP
ES4STOP>RUN
ES51/100s
ES61/10s
ES71s

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.

<note> ES5, ES6 and ES7 may be considered like periodic tasks. The user must choose the best conversion scheme. </note>

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.

TD (Default Processing)

TD is converted by SR (subroutine).

TD calls can be configured for each card:

<note> 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. </note>

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.

<note> The notion of SFC slave does not exist in UNITY. SFC slave are converted as simple SFC. </note> <note> 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. </note>

XE (Macro SFC)

Converted in SFC Macro State.

TR (Transition Management)

Converted in one section for one SFC, where all transitions are evaluated.
<note> 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. </note>

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.

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 ORPHEEUNITY DFB
TONBfc_ton
TOFBfc_toff
TPBfc_tp
PULSORBfc_pulsor
COUNTBfc_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

See TD (Default Processing)

Calling EI

See EI (interface Event)

Calling ES

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.

<note>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.</note> <note>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.</note>

TR with code in addition to the evaluation of the transition

See TR (Transition Management)

Scaling the 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 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:

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”.