Implementing ladder to support special functions, Example: rebooting the module – ProSoft Technology PTQ-101M User Manual

Page 123

Advertising
background image

Reference PTQ-101M

♦ Quantum Platform

IEC 60870-5-101 Master Communication Module

ProSoft Technology, Inc.

Page 123 of 181

May 14, 2008

Implementing Ladder to Support Special Functions

In order to use Special Functions (Command Control), you must implement some
form of control logic. The following section uses structured text language to
illustrate how a typical function might be implemented.

Example: Rebooting the Module.
MyTrigger is a variable that triggers this logic

OutputControl variable array starts at register 4000001

The first instruction guarantees that the processor requests this block for only
one scan.
The second instructions sets the Block Number (9999 = ColdBoot) and then sets
the sequence number to 1.

IF MyTrigger>0 AND OutputControl1[1]> 0 THEN

OutputControl1[0]:= InputData[0];

OutputControl1[1]:=0;

MyTrigger :=0;

END_IF;

IF (MyTrigger=9999)OR (MyTrigger=9998) OR (MyTrigger=9250) THEN

OutputControl1[1] :=MyTrigger;

Temp:=WORD_TO_INT(OutputControl1[0]);

Temp:=Temp+1;

OutputControl1[0]:=INT_TO_WORD(Temp);

END_IF;

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

Advertising