User manual
PTQ-104S Rev2 ♦ Quantum Platform Module Configuration
IEC 60870-5-104 Server for Quantum User Manual
ProSoft Technology, Inc. Page 63 of 195
February 22, 2013
IF (MyTrigger=9970) THEN
OutputControl1[1] :=MyTrigger;
Temp:=WORD_TO_INT(OutputControl1[0]);
Temp:=Temp+1;
OutputControl1[0]:=INT_TO_WORD(Temp);
END_IF;
When the request is processed, the module will send the block response and
increment the received output sequence number by 1. So the output sequence
number is one less than the input sequence number the module has sent a new
block. Once the block is received the processor logic copies the received data to
the appropriate variables. The logic also clears the trigger for the next request.*)
IF (InputData[1]=9970) THEN
GetTime.MyYear :=InputData[2];
GetTime.MyMonth :=InputData[3];
GetTime.MyDay :=InputData[4];
GetTime.MyHour :=InputData[5];
GetTime.MyMinute :=InputData[6];
GetTime.MySecond :=InputData[7];
GetTime.MyMillisecond :=InputData[8];
END_IF
Example: Setting the time of day to the module.
This logic shows an example on how to request a block 9971 from the module
(Read Module’s Time).
Assumptions:
MyTrigger is a variable that triggers this logic
OutputControl variable array starts at register 400,001
InputControl variable array starts at register 300,001
MyTime variables store the date and time values to be written to the module
Sets the Block Number (9971=Write Module’s Time) and then increments the
output sequence number (OutputControl[1]) by one. Once the module reads a
new output sequence number from the processor it will process this request. So
remember that the actual trigger is moving a new output block sequence number
value to the module. Moving the block number (9970) is not the trigger to request
this task from the module. MyTrigger is set to -1 as an indication that the logic is
waiting for the response from the module.
IF (MyTrigger=9971) THEN
OutputControl1[1] :=MyTrigger;
OutputControl1[2] :=SetTime.MyYear;
OutputControl1[3] :=SetTime.MyMonth;
OutputControl1[4] :=SetTime.MyDay;
OutputControl1[5] :=SetTime.MyHour;
OutputControl1[6] :=SetTime.MyMinute;
OutputControl1[7] :=SetTime.MySecond;
OutputControl1[8] :=SetTime.MyMillisecond;
Temp:=WORD_TO_INT(OutputControl1[0]);
Temp:=Temp+1;
OutputControl1[0]:=INT_TO_WORD(Temp);
END_IF;