etherlab/plc_cia402node.c
changeset 2070 dee8d519f3ff
parent 2069 840d328560f8
child 2077 14dfb786c53e
equal deleted inserted replaced
2069:840d328560f8 2070:dee8d519f3ff
   103 		return;
   103 		return;
   104 	}
   104 	}
   105 
   105 
   106 	__CIA402Node_%(location)s.axis->PowerFeedback = __CIA402Node_%(location)s.state == __OperationEnabled;
   106 	__CIA402Node_%(location)s.axis->PowerFeedback = __CIA402Node_%(location)s.state == __OperationEnabled;
   107 	__CIA402Node_%(location)s.axis->ActualPosition = (IEC_REAL)(*(__CIA402Node_%(location)s.ActualPosition)) * __CIA402Node_%(location)s.axis->RatioDenominator / __CIA402Node_%(location)s.axis->RatioNumerator;
   107 	__CIA402Node_%(location)s.axis->ActualPosition = (IEC_REAL)(*(__CIA402Node_%(location)s.ActualPosition)) * __CIA402Node_%(location)s.axis->RatioDenominator / __CIA402Node_%(location)s.axis->RatioNumerator;
   108 
       
   109 	__MK_UpdateAxis(*__IW%(location)s_0);
       
   110 }
   108 }
   111 
   109 
   112 void __publish_%(location)s()
   110 void __publish_%(location)s()
   113 {
   111 {
   114 	__MK_ComputeAxis(*__IW%(location)s_0);
       
   115 
       
   116 	IEC_BOOL power = ((*(__CIA402Node_%(location)s.StatusWord) & __PowerMask) > 0) && __CIA402Node_%(location)s.axis->Power;
   112 	IEC_BOOL power = ((*(__CIA402Node_%(location)s.StatusWord) & __PowerMask) > 0) && __CIA402Node_%(location)s.axis->Power;
   117 
   113 
   118 	// CIA402 node state transition computation
   114 	// CIA402 node state transition computation
   119 	switch (__CIA402Node_%(location)s.state) {
   115 	switch (__CIA402Node_%(location)s.state) {
   120 	    case __SwitchOnDisabled:
   116 	    case __SwitchOnDisabled: