2-417
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Conversion Instructions
2
PIDAT
ST
PV1:=INT_TO_REAL(AI1)/REAL#10.0;
PIDAT_instance(
Run :=Run1,
ManCtl :=Manctl1,
StartAT :=StartAT1,
PV :=PV1,
SP :=SP1,
OprSetParams :=OprSetParams1,
InitSetParams :=InitSetParams1,
ProportionalBand:=PB1,
IntegrationTime :=TI1,
DerivativeTime :=TD1,
ManMV :=ManMV1,
ATDone =>ATDone1,
ATBusy =>ATBusy1,
Error =>Error1,
ErrorID =>ErrorID1,
MV =>MV1);
PulseOnTime:=MULTIME(PulseCycTime, MV1/REAL#100.0);
TOF_instance(In:=BOOL#FALSE, PT:=PulseOnTime, Q=>DO1);
TON_instance(In:=BOOL#TRUE, PT:=PulseCycTime, Q=>ResetPulse);
IF (ResetPulse=BOOL#TRUE) THEN
TOF_instance(In:=BOOL#TRUE);
TON_instance(In:=BOOL#FALSE);
END_IF;
IF ( (ATBusy1=BOOL#TRUE) & (MV1=REAL#100.0) ) THEN
DO1:=BOOL#TRUE;
END_IF;
// Convert PV AI1 to real number.
// Execute PIDAT instruction.
// Time-proportional output
Run1
ManCtl1
StartAT1
PV1
SP1
OprSetParams1
InitSetParams1
PB1
TI1
TD1
ManMV1
ATDone1
ATBusy1
Error1
ErrorID1
MV1
PulseOnTime
PulseCycTime
ResetPulse
PIDAT_instance
TOF_instance
TON_instance
False
False
False
0.0
90
(MVLowLmt:=0.0, MVUpLmt:=100.0,
ManResetVal:=0.0, MVTrackSw:=False,
MVTrackVal:=0.0, StopMV:=0.0,
ErrorMV=0.0, Alpha:=0.65,
ATCalcGain:=1.0, ATHystrs:=0.2)
(SampTime:=T#100ms, RngLowLmt:=0.0,
RngUpLmt:=1000.0, DirOpr:=False)
10
T#0S
T#0S
0.0
False
False
False
16#0
0.0
T#0s
T#1s
False
BOOL
BOOL
BOOL
REAL
REAL
_sOPR_SET_PARAMS
_sINIT_SET_PARAMS
REAL
TIME
TIME
REAL
BOOL
BOOL
BOOL
WORD
REAL
TIME
TIME
BOOL
PIDAT
TOF
TON
Execution condition
Manual/auto control
Autotuning execution condition
Process value
Set point
Operation setting parameters
Initial setting parameters
Proportional band
Integration time
Derivative time
Manual manipulated variable
Autotuning normal completion
Executing autotuning
Error
Error ID
Manipulated variable
Control output ON time
Control period
Timer reset
// CJ1W-PH41U output is ten times the process value, so divide by 10.0.
// Calculate ON time output control value.
// Switch between ON and OFF with TOF instruction.
// Measure timer reset time with TON instruction.
// Reset timer.
// If MV1 = 100% for autotuning...
// Turn ON the output immediately.
Variable
Data type
Initial value
Retain
Comment