User manual

Module Configuration PTQ-104S Rev2 Quantum Platform
User Manual IEC 60870-5-104 Server for Quantum
Page 62 of 195 ProSoft Technology, Inc.
February 22, 2013
Note: The command code in the I/O area is also referred to as the block ID.
Implementing Ladder to Support Special Functions
In order to use Special Functions, some form of control logic must be
implemented. 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 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.