Calling LoadDataValue method from ST program
DISCLAIMER
The example below is intended to demonstrate one or more features or methods and is presented as a configuration example only. Schneider Electric assumes no liability for the use or application of this example or any portion thereof.
Below an example of Structured Text program that triggers the "LoadDataValue" method from a point:
PROGRAM LoadDataValueExample
(* First declare the method associated to the point you will load data to *)
METHOD
loadValue AT %M(.A2.Historic.LoadDataValue) : BYTE, DINT, DATE_AND_TIME, LREAL;
END_METHOD
(* variable declaration, in this example, local *)
VAR
Reason : BYTE;
Quality : DINT;
TimeStamp : DATE_AND_TIME;
Value : LREAL;
END_VAR
(* setting the values (in a real program, the values will come from other sources, like SQL or user inputs *)
Reason := 0;
Quality := 192;
TimeStamp := NOW(); (*remember that time must be in UTC *)
Value := 5.9;
(* trigger the method *)
loadValue(Reason, Quality, TimeStamp, Value);
;
END_PROGRAM
The example below is intended to demonstrate one or more features or methods and is presented as a configuration example only. Schneider Electric assumes no liability for the use or application of this example or any portion thereof.
Below an example of Structured Text program that triggers the "LoadDataValue" method from a point:
PROGRAM LoadDataValueExample
(* First declare the method associated to the point you will load data to *)
METHOD
loadValue AT %M(.A2.Historic.LoadDataValue) : BYTE, DINT, DATE_AND_TIME, LREAL;
END_METHOD
(* variable declaration, in this example, local *)
VAR
Reason : BYTE;
Quality : DINT;
TimeStamp : DATE_AND_TIME;
Value : LREAL;
END_VAR
(* setting the values (in a real program, the values will come from other sources, like SQL or user inputs *)
Reason := 0;
Quality := 192;
TimeStamp := NOW(); (*remember that time must be in UTC *)
Value := 5.9;
(* trigger the method *)
loadValue(Reason, Quality, TimeStamp, Value);
;
END_PROGRAM
Publicerad för: Schneider Electric Sverige


Behöver du hjälp?
Produktväljare
Hitta snabbt och enkelt rätt produkter och tillbehör för dina ändamål.
Begär en offert
Ställ din fråga online så kontaktar vi dig.
Här köper du
Hitta enkelt närmaste Schneider Electric-distributör på din ort.
Hjälpcenter
Hitta alla supportresurser som du behöver på ett ställe.