Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

2 Instruction Descriptions
ST
Internal
Variables
SensorOut
ElapsedTime
SensorTime
LongTime
SensorDone
ThresholdTime
Result
TON_instance
F_TRIG_instance
External
Variables
RecentMode
// Execute TON instruction.
TON_instance(
In:=SensorOut,
PT:=LongTime,
ET=>ElapsedTime); // Elapsed time
// Set sensor ON time to the elapsed time of TON.
IF (SensorOut=TRUE) THEN
SensorTime:=ElapsedTime;
END_IF;
// Detect when sensor output turns OFF.
F_TRIG_instance(Clk:=SensorOut, Q=>SensorDone);
Result:=FALSE;
// Set the threshold.
IF (SensorDone=TRUE AND RecentMode=SET) THEN
ThresholdTime:=TruncTime(
// Determine if result is normal or error.
ELSIF (SensorDone=TRUE AND RecentMode=EXEC) THEN
IF (SensorTime >= ThresholdTime) THEN
Result:=TRUE;
END_IF;
END_IF;
2-654
Variable
Data type
BOOL
TIME
TIME
TIME
BOOL
TIME
BOOL
TON
F_TRIG
Variable
Data type
Mode
// Timer input
// Set time
In
:=SensorTime,
Accuracy:=_MILLISEC);
Initial value
FALSE
Sensor output
T#0s
Elapsed time
T#0s
Sensor ON time
A time that is sufficiently longer than the
T#1h
sensor ON time
FALSE
Sensor output OFF flag
T#0s
Threshold
FALSE
Result, TRUE: Normal, FALSE: Error
Comment
The current operation mode
// Accuracy is milliseconds.

NY-series Instructions Reference Manual (W560)

Comment

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents