ProSoft Technology PTQ-104C User Manual
Page 51

49TPTQ-104C ♦ 48TQuantum Platform
Module Configuration
47TIEC 60870-5-104 Client
12TUser Manual
Example: Retrieving the time of day from the module.
This logic shows an example on how to request a block 9970 from the module
(Read Module’s Time) and read the response to the processor.
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 read from the module
Sets the Block Number (9970=Read 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=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
ProSoft Technology, Inc.
Page 51 of 136
March 4, 2013