2 Instruction Descriptions
2-602
NJ-series Instructions Reference Manual (W502)
TraceSamp
The TraceSamp instruction performs sampling for a data trace.
The TraceSamp instruction performs sampling for a data trace. The sampling settings are specified
from the Sysmac Studio. The present values for all variables that are set to be sampled are read and
stored with trace number TraceNo and sampling point number Point in trace memory. This instruction is
executed only during execution of data tracing and only when the sampling timing is set to sampling
instructions from the Sysmac Studio.
The following figure shows a programming example. Trace number 1 and sampling point number 2 are
attached, and the present values of all variables to be sampled are stored in trace memory.
Instruction Name FB/FUN Graphic expression ST expression
TraceSamp Data Trace Sam-
pling
FUN TraceSamp(TraceNo, Point);
Variables
Name Meaning I/O Description Valid range Unit Default
TraceNo Trace num-
ber
Input
Trace number 0 to 3
--- 0
Point Sampling
point num-
ber
Sampling point number Depends on data type.
Out Return
value
Output Always TRUE TRUE only
--- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
TraceNo OK
Point OK
Out OK
Function
(@)TraceSamp
EN ENO
TraceNo Out
Point
TraceSamp(USINT#1, USINT#2);
LD ST
USINT#1
USINT#2
TraceSamp
EN ENO
TraceNo
Point