5 implementing ladder to support special functions – ProSoft Technology PTQ-104S User Manual
Page 62

Module Configuration
48TPTQ-104S Rev 1 ♦ 47TQuantum Platform
12TUser Manual
46TIEC 60870-5-104 Server for Quantum
5.3.5 Implementing Ladder to Support Special Functions.
The previous discussions about Command Function 1 and Command Function 2
have not required that you implement any form of logic within the PLC, however if
you are required to use the Command Function 3, 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 an alias for register 401000
MyFunction3 is an alias for register 400500
MyData1-MyData63 are aliases for 400501-400563
The premise for this logic is:
IF MyTrigger = SOMEVALUE THEN
Fill the buffer;
set MyFunction3 to the appropriate value;
Clear MyTrigger with a 0;
END_IF;
*)
IF MyTrigger = 9999 THEN
MyFunction3 := MyTrigger;
MyTrigger := 0;
END_IF;
Example: Setting / Retrieving the time of day
(*
Block ID 9971 - Set Modules Time using the PLC’s Time
Assumption:
The MyYear, MyMonth and so on... values for time and date represent
aliases for your time source.
MyTrigger is an alias for register 401000.
*)
IF MyTrigger = 9971 THEN;
MyData1 := MyYear;
MyData2 := MyMonth;
MyData3 := MyDay;
MyData4 := MyHour;
MyData5 := MyMinute;
MyData6 := MySeconds;
MyData7 := MyMillisec;
MyFunction3 := 9971;
MyTrigger := 0;
END_IF;
(*
Block ID 9970 - Set PLC’s time using the modules time
Assumption:
The MyYear, MyMonth and so on... values for time and date are
representative of your aliases for your time source.
Page 62 of 201
ProSoft Technology, Inc.
March 4, 2013