![Kuhnke 610.441.31 Скачать руководство пользователя страница 51](http://html1.mh-extra.com/html/kuhnke/610-441-31/610-441-31_instruction-manual_2009571051.webp)
KUHNKE Automation
51
10 CoDeSys Library for the Thermo-controller (EtherCAT®)
10.1 CoDeSys
Create a separate HC-type instance for every thermo-controller.
Example
VAR
HC1: HC; (* thermo-controller instance *)
END_VAR
Pointers to the input/output ranges of the EtherCAT® variables to be allo-
cated to every instance (COMPULSORY!).
Range names are
Input variables:
Boxn_Modulestate (n=no. of thermo-controller)
Output variables:
Boxn_Controlword (n=no. of thermo-controller)
Example
(* pointers to input/output ranges of thermo-controller #1 *)
HC1.pInput
:= ADR(Box1_Modulestate);
HC1.pOutput :=ADR(Box1_ControlWord);
The pointers provide direct access to the variables.
Example:
/ Example: Get current mains frequency reading *)
ALF := HC1.pInput^.ActualLineFrequency;
/ Example: Write nominal voltage set-point *)
HC1.pOutput^.NominalVoltage := NNV ;