printf

PLCopen motion icon

 FunctionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. - Display a trace output.

Inputs

Input

Data Type

Range

Unit

Default

Description

FMT

STRING

 

 

 

Trace message.

ARG1.ARG4

DINT

 

 

 

Numerical arguments included in the trace.

Outputs

Output

Data Type

Range

Unit

Description

Q

BOOL

FALSE, TRUE

 

Return check.

Remarks

%ld    signed value in decimal
%lu    unsigned value in decimal
%lx    value in hexadecimal

Example

(* i1, i2, i3, i4 are declared as DINT *)4
i1 := 1;
i2 := 2;
i3 := 3;
i4 := 4;
printf ('i1=%ld; i2=%ld; i3=%ld; i4=%ld', i1, i2, i3, i4);

Output Message

i1=1; i2=2; i3=3; i4=4;