etherlab/plc_cia402node.c
changeset 2094 72b74099b873
parent 2092 c9776ae8b5d0
child 2096 c9b0340ea0f5
equal deleted inserted replaced
2093:3fdf9d56d803 2094:72b74099b873
     9   #include "iec_types.h"
     9   #include "iec_types.h"
    10 #else
    10 #else
    11   #include "iec_std_lib.h"
    11   #include "iec_std_lib.h"
    12 #endif
    12 #endif
    13 
    13 
       
    14 #include "accessor.h"
    14 #include "POUS.h"
    15 #include "POUS.h"
    15 
    16 
    16 IEC_INT beremiz__IW%(location)s_0;
    17 IEC_INT beremiz__IW%(location)s_0;
    17 IEC_INT *__IW%(location)s_0 = &beremiz__IW%(location)s_0;
    18 IEC_INT *__IW%(location)s_0 = &beremiz__IW%(location)s_0;
    18 
    19 
    55 int __init_%(location)s()
    56 int __init_%(location)s()
    56 {
    57 {
    57 %(init_entry_variables)s
    58 %(init_entry_variables)s
    58 	*__IW%(location)s_0 = __MK_Alloc_AXIS_REF();
    59 	*__IW%(location)s_0 = __MK_Alloc_AXIS_REF();
    59 	__CIA402Node_%(location)s.axis = __MK_GetPublic_AXIS_REF(*__IW%(location)s_0);
    60 	__CIA402Node_%(location)s.axis = __MK_GetPublic_AXIS_REF(*__IW%(location)s_0);
    60 %(fieldbus_interface_definition)s
       
    61 	__MK_Set_AXIS_REF_Pos(*__IW%(location)s_0, %(slave_pos)d);
    61 	__MK_Set_AXIS_REF_Pos(*__IW%(location)s_0, %(slave_pos)d);
    62 	*(__CIA402Node_%(location)s.ModesOfOperation) = 0x08;
    62 	*(__CIA402Node_%(location)s.ModesOfOperation) = 0x08;
    63     return 0;
    63     return 0;
    64 }
    64 }
    65 
    65 
    67 {
    67 {
    68 }
    68 }
    69 
    69 
    70 void __retrieve_%(location)s()
    70 void __retrieve_%(location)s()
    71 {
    71 {
       
    72 %(fieldbus_interface_definition)s
       
    73 
    72 	IEC_UINT statusword_inactive = *(__CIA402Node_%(location)s.StatusWord) & __InactiveMask;
    74 	IEC_UINT statusword_inactive = *(__CIA402Node_%(location)s.StatusWord) & __InactiveMask;
    73 	IEC_UINT statusword_active = *(__CIA402Node_%(location)s.StatusWord) & __ActiveMask;
    75 	IEC_UINT statusword_active = *(__CIA402Node_%(location)s.StatusWord) & __ActiveMask;
    74 
    76 
    75 	if (__FirstTick) {
    77 	if (__FirstTick) {
    76 %(init_axis_params)s
    78 %(init_axis_params)s