Example: setting the time of day to the module – ProSoft Technology PTQ-101M User Manual

Page 124

Advertising
background image

PTQ-101M ♦ Quantum Platform

Reference

IEC 60870-5-101 Master Communication Module

Page 124 of 181

ProSoft Technology, Inc.

May 14, 2008

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 4000001
InputControl variable array starts at register 3000001
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;

Once the request was 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. *)

Advertising