====== SMC / UNITY path general informations ====== This chapter gives the general informations for SMC 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, …). These variables are renamed with a suffix or a prefix. ==== Internal variables ==== Below internal variables have no equivalent counterpart in UNITY:\\ * Bits R416 to R468 * Bits R473 to R509 * C89 to C95 (self control) Manual conversion is necessary. === Mapping === ^**SMC**^**UNITY**^**Description**^ |Bx|%M(x + 1024)| Boolean variable | |Mx|%MWx| Integer variable | |Rx|%M0 to %M1023| Boolean system variable | Others internal variables are not mapped. Manual conversion is necessary. ==== Digital input/output ==== Manual mapping of the digital input/output is necessary. ==== Analog input/output ==== Manual mapping of the digital input/output is necessary. ===== Code module translation schemes ===== ==== Init File ==== Init section is generated automatically. It initializes some variables used by the stack, and set some variables Rx. ==== Sequential File ==== The sequential file is translated in ladder section named **Mast_seq**.\\ The comment of each sequence is kept.\\ The sequence number is translated as label of rung for each sequence. ===Calling Immediate Calculation=== the line calculation request is copied in Mast_seq in the place of the calling sequence number. ===Calling Calculation=== when a calculation is requested, the calculation line number and the sequence number are pushed in the stack. ==== Calculation File ==== The calculation file is translated in literal section named **Mast_calcul**.\\ The comment of each calculation line is kept.\\ The line number is translated as label for each calculation line. ==== Stack ==== There are two stacks of 8 items. * one stack for the calling sequence number * one stack for the calculation line number request The stack is managed by 2 subroutines. * **Mast_put_calcul()** called in Mast_seq for each calculation request. The line sequence number and the line calculation number are pushed on stack. * **Mast_pop_calcul()** called once at the beginning of the section Mast_calcul. The program jump to the label corresponding at the popped line number. ==== System functions ==== === Timer and counter === Timers and counters are converted by specific DFBs that reproduce their behaviors. === Others === Others functions are converted by DFB. Some DFBs might be empty if no translation is available for the corresponding function. ==== Special functions ==== Special functions (communications, regulation, axes, motion, etc.) are not translated. Manual conversion is required. ===== Limitation of conversion ===== Below is a list of known issues. * No Import of files containing the initial values ​​of constants. * No management of memory zones with a double addressing bit/word. * Indirect jumps are not taken into account * No resolution of labels declared in double * Indirect addressing is not fully supported * No distinction between different ranges of PLCs and their memory organization: not automatically taken into account the specific characteristics of different memory models (B-flops bits of the SMC 35, etc …).