printf
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
- This function works like the printf function of the C language, with a maximum of four integer arguments.
- Use the pragmas A compiler directive communicating additional pragmatic information. Pragmas are processed at compile time, not at run time. They pass information to the compiler. in the FMT trace message to represent the arguments according to their left to right order:
%ld signed value in decimal
%lu unsigned value in decimal
%lx value in hexadecimal
- The trace message is displayed in the LOG window with runtime In computer science, runtime (or run-time) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). In KAS, runtime refers to the virtual machine that manage the program written in a computer language while it is running. messages.
- Trace is supported by the KAS Kollmorgen Automation Suite Simulator.
-
-
The target platform may not support trace functions.
See the OEM Original equipment manufacturer - The company that originally manufactured a product. Refers to containment-based re-branding, where one company uses a component of another company within its product, or sells the product of another company under its own brand. instructions about available features.
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;