SyPTLite Function Block Cross Reference

Navigation:  Libraries >

SyPTLite Function Block Cross Reference

Previous pageReturn to chapter overviewNext page

The table below is cross reference of SyPTLite function blocks supported by the Unidrive SP onboard PLC program to the equivalent function, function block or operator in Machine Control Studio.

 

Some SyPTLite function blocks do not have equivalents in Machine Control Studio, but in most cases an example of given of how operation of the this function block can be achieved using Structured Text.

 

Function Block Group

SyPTLite Function Block

Machine Control Studio Equivalent

Comments

Arithmetic

ABS

ABS

Numeric operator

Add (+)

ADD (+)

Arithmetic operator

Divide (/)

DIV (/)

Arithmetic operator

ILIMIT

LIMIT

Selection operator

iLIMIT2

NO EQUIVALENT

Similar to LIMIT but also sets flags if upper and lower limits are exceeded.

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

HiFlag := FALSE;

LoFlag := FALSE;

 

(* Compare the input to the limits; *)

(* if beyond, output = limit value *)

IF (Value < LoLim) THEN

     Output := LoLim;    (* Clamp the output to low limit *)

     LoFlag := TRUE;     (* Set the low limit flag *)

ELSIF (Value > HiLim) THEN

     Output := HiLim;    (* Clamp the output to high limit *)

     HiFlag := TRUE;     (* Set the high limit flag *)

ELSE Output := Value;    (* Copy input to output *)

END_IF 

MAX

MAX

Selection operator

MIN

MIN

Selection operator

MOVE

MOVE

Arithmetic operator

Multiply (*)

MUL (*)

Arithmetic operator

Remainder (%)

MOD

Arithmetic operator

Subtract (-)

SUB (-)

Arithmetic operator

Bit Manipulation

DATASTUFF

NO EQUIVALENT

Stuffs bits into a 32-bit word.

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

VAR

     Value : DWORD := 2#11010001;

END_VAR

 

(* Write to bits 3 to 5 (overwrites 3 bits of Value –

   can vary number & location of bits to be overwritten) *)

Value.3 := TRUE;        (* Value = 2#11011001 *)

Value.4 := FALSE;       (* Value = 2#11001001 *)

Value.5 := TRUE;        (* Value = 2#11101001 *)

 

DECODER4

NO EQUIVALENT

Decodes a decimal value to four binary outputs.

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

VAR

     Value : BYTE := 2#11010001;

     Bit0 : BOOL;

     Bit1 : BOOL;

     Bit2 : BOOL;

     Bit3 : BOOL;

END_VAR

 

(* Decode Value to 4 binary outputs *)

Bit0 := Value.0;          (* = TRUE *)

Bit1 := Value.1;          (* = FALSE *)

Bit2 := Value.2;          (* = FALSE *)

Bit3 := Value.3;          (* = FALSE *)

DECODER8

UNPACK

Util Library > Bit/Byte Functions

DIGSEL8

NO EQUIVALENT

Eight-input digital select.

Can be achieved with user code using the relevant data types.

See DECODER4 for example of getting bits in Structured Text.

ENCODER4

NO EQUIVALENT

Forms a decimal value from four binary inputs.

Can be achieved with user code using the relevant data types.

See DATASTUFF for example of setting bits in Structured Text.

ENCODER8

PACK

Util Library > Bit/Byte Functions

SHIFT

SHL, SHR

Bit-Shift operator

SHIFTLR (<<, >>)

SHL, SHR

Bit-Shift operator

SPLITTER

NO EQUIVALENT

Splits a 32-bit integer into two outputs each of n-bits long.

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

VAR

     Value : DWORD := 16#01020304;

     LowWord : WORD := 0;             (* LS word *)

     HighWord : WORD := 0;            (* MS word *)

     Byte0 : BYTE := 0;               (* LS byte *)

     Byte1 : BYTE := 0;

     Byte2 : BYTE := 0;

     Byte3 : BYTE := 0;               (* MS byte *)

END_VAR

 

(* Split 32-bit Value into two 16-bit outputs and four 8-bit outputs *)

LowWord := ANY_TO_WORD(Value AND 16#FFFF);          (* = 16#0304 *)

HighWord := ANY _TO_WORD(SHR(Value, 16));           (* = 16#0102 *)

Byte0 := ANY _TO_BYTE(Value AND 16#FF);             (* = 16#04 *)

Byte1 := ANY _TO_BYTE(SHR(Value, 8) AND 16#FF);     (* = 16#03 *)

Byte2 := ANY _TO_BYTE(SHR(Value, 16) AND 16#FF);    (* = 16#02 *)

Byte3 := ANY _TO_BYTE(SHR(Value, 24) AND 16#FF);    (* = 16#01 *)

STUFF2

NO EQUIVALENT

Stuffs two bits into a 32-bit word.

Can be achieved with user code using the relevant data types.

See DATASTUFF for example of setting bits in Structured Text.

STUFF4

NO EQUIVALENT

Stuffs four bits into a 32-bit word.

Can be achieved with user code using the relevant data types.

See DATASTUFF for example of setting bits in Structured Text.

STUFF8

NO EQUIVALENT

Stuffs eight bits into a 32-bit word.

Can be achieved with user code using the relevant data types.

See DATASTUFF for example of setting bits in Structured Text.

Comparison

EQ (=)

EQ (=)

Comparison operator

GE (>=)

GE (>=)

Comparison operator

GT (>)

GT (>)

Comparison operator

LE (<=)

LE (<=)

Comparison operator

LT (<)

LT (<)

Comparison operator

NE (<>)

NE (<>)

Comparison operator

Counters

CTD

CTD

Standard Library > Counter

CTU

CTU

Standard Library > Counter

CTUD

CTUD

Standard Library > Counter

Latches

RS

RS

Standard Library > Bistable Function Blocks

SR

SR

Standard Library > Bistable Function Blocks

Logic

AND (&)

AND

Bitstring operator

AND4

ANDN

Bitstring operator

In FBD/LD, insert AND and “Append Input”.

 

Example in Structured Text,

 

Output := Value1 AND Value2 AND Value3 …;

bInvert

NOT

Bitstring operator

NAND4

ANDN & negate

Bitstring operator

In FBD/LD, insert AND and “Append Input”, then negate output.

 

Example in Structured Text,

 

Output := NOT(Value1 AND Value2 AND Value3 …);

NOR4

ORN & negate

Bitstring operator

In FBD/LD, insert OR and “Append Input”, then negate output.

 

Example in Structured Text,

 

Output := NOT(Value1 OR Value2 OR Value3 …);

OR (|)

OR

Bitstring operator

OR4

ORN

Bitstring operator

In FBD/LD, insert OR and “Append Input”.

 

Example in Structured Text,

 

Output := Value1 OR Value2 OR Value3 …;

XOR (^)

XOR

Bitstring operator

XOR4

XORN

Bitstring operator

In FBD/LD insert XOR and “Append Input”.

 

Example in Structured Text,

 

Output := Value1 XOR Value2 XOR Value3 …;

Mathematical

ADDDIV32

NO EQUIVALENT

Adds two values then divides result by another (addition is stored as 32-bit value).

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

Output := (Value1 + Value2) / Value3;

iOS

NO EQUIVALENT

Performs integer offset and scale.

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

Output := (Value + Offset) * Scale;

iSO

NO EQUIVALENT

Performs integer scale and offset.

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

Output := (Value * Scale) + Offset;

MULDIV

N/A

Multiplies two values then divides by another (multiplication is stored as 64-bit value).

64-bit maths not available onboard.

MULDIV32

NO EQUIVALENT

Multiplies two values then divides result by another (multiplication is stored as 32-bit value).

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

Output := (Value1 * Value2) / Value3;

MULDIVOFF32

NO EQUIVALENT

Multiplies two values, adds an offset then divides result by another (multiplication is stored as 32-bit value).

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

Output := ((Value1 * Value2) + Offset) / Value3;

NEG

NO EQUIVALENT

Changes the sign of a value.

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

Output := Value * (-1);

SGN

NO EQUIVALENT

Returns 1 of value is positive, -1 if value is negative.

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

IF (Value >= 0) THEN

     Output := 1;

ELSE

     Output := -1;

END_IF

SUBDIV32

NO EQUIVALENT

Subtracts one value from another then divides result by another (subtraction is stored as 32-bit value).

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

Output := (Value1 - Value2) / Value3;

Miscellaneous

BLKDEF

NO EQUIVALENT

Block parameter write.

 

Example in Structured Text,

 

VAR

     Slot : INT := 0;          (* Required slot (0 = drive) *)

     Menu : INT := 18;         (* Required menu *)

     StartParam : INT := 17;   (* Start parameter *)

     NumParams: INT := 10;     (* Number of parameters to write *)

     Value : INT := 123;       (* Value to write to all parameters *)

     Param : INT;

END_VAR

 

(* Write 123 to drive parameters 18.017 to 18.026 *)

FOR Param := StartParam TO (StartParam + NumParams - 1) DO

     WriteUserParameterINT(Slot, Menu, Param, Value);

END_FOR

CMODEXFER

DRIVE_MODE_CHANGE

CTStandard Library > Miscellaneous

FIRSTSCAN

NO EQUIVALENT

Only runs a set of code on the first scan through the program.

Can be achieved with user code using the relevant data types.

 

Example in Structured Text,

 

VAR

     Initial : BOOL := TRUE;

END_VAR

IF (Initial) THEN

     (* Perform initial set-up task *)

     Initial := FALSE;

END_IF

MODEXFER

DRIVE_MODE_CHANGE

CTStandard Library > Miscellaneous

Read4DPS

N/A

Reads a parameter value with four decimal place accuracy.

Not required with Machine Control Studio.

Write4DPS

N/A

Writes a parameter value with four decimal place accuracy.

Not required with Machine Control Studio.

Multiplexers

iDMUX

EXTRACT

Util Library > Bit/Byte Functions

iMUX

MUX

Selection operator

IMUX2

MUX

Selection operator

Timers

DELAY

NO EQUIVALENT

Pauses execution for a specified period.

Can be achieved with user code.

 

Example in Structured Text,

 

VAR

     StartTime : UDINT;

     Delay: UDINT := 3000;      (* Required delay in milliseconds *)

END_VAR

StartTime := GetMillisecondCounter();

WHILE (GetMillisecondCounter() < StartTime + Delay) DO

     (* Do nothing *)

END_WHILE

PT

TP

Standard Library > Timer

TCYCLIC

BLINK

Util Library > Signals

TIME

GetMillisecondCounter

CT User Programming Runtime

TOFF

N/A

Superseded by TOFF2 in SYPTLite

TOFF2

TOF

Standard Library > Timer

TOFFRET

TOFF_RET

CTStandard Library > Timers

TON

N/A

Superseded by TON2 in SYPTLite.

TON2

TON

Standard Library > Timer

TONRET

TON_RET

CTStandard Library > Timers