ApossC SDK  V01.15
Macros | Functions
SDK_Amplifier_DS402_StateMachine.mc File Reference

This file provides all the function used for DS402 PPM and PVM. More...

#include <SysDef.mh>
#include "SDK_Amplifier_DS402_StateMachine.mh"

Go to the source code of this file.

Macros

#define DS402_PPM_IMMEDIATELY   1
 

Functions

long sdkDS402_ReadStatusWord (long busId)
 DS 402 State-Machine functions. More...
 
long sdkDS402_ReadControlWord (long busId)
 Read control word. More...
 
void sdkDS402_WriteControlWord (long busId, long value)
 Write control word. More...
 
long sdkDS402_GetActDriveState (long busId)
 Get the actual drive state. More...
 
void sdkDS402_PrintState (long state)
 Print the name of certain drive state. More...
 
long helperDS402_ExecuteTransition (long busId, long transition)
 Execute a state transition. More...
 
long sdkDS402_TransitionToState (long busId, long newState)
 Transition to another state. More...
 
long sdkDS402_WaitTransitionToState (long busId, long targetState, long timeout)
 Wait transition to another state. More...
 
void sdkDS402_SetProfileAcceleration (long busId, long acc)
 Profile Mode settings. More...
 
void sdkDS402_SetProfileDeceleration (long busId, long dec)
 Set the profile deceleration DS402_PROFILE_DECELERATION(0x6084) More...
 
void sdkDS402_SetProfileVelocity (long busId, long vel)
 Set the profile velocity DS402_PROFILE_VELOCITY(0x6081) More...
 
void sdkDS402_SetMotionProfileType (long busId, long type)
 Set the motion profile type DS402_MOTION_PROFILE_TYPE(0x6086) More...
 
void sdkDS402_SetMaxProfileVelocity (long busId, long vel)
 Set the max profile velocity DS402_MAX_PROFILE_VELOCITY(0x607F) More...
 
void sdkDS402_SetMaxMotorSpeed (long busId, long vel)
 Set the max profile velocity DS402_MAX_MOTOR_SPEED(0x6080) More...
 
void sdkDS402_SetMaxAcceleration (long busId, long acc)
 Set the max acceleration DS402_MAX_ACCELERATION(0x60C5) More...
 
void sdkDS402_SetQuickStopDeceleration (long busId, long dec)
 Set quick stop deceleration DS402_QUICK_STOP_DECELERATION(0x6085) More...
 
void sdkDS402_SetProfileMovementParameter (long busId, long acc, long dec, long velocity)
 Set quick stop deceleration DS402_QUICK_STOP_DECELERATION(0x6085) More...
 
void sdkDS402_SetOpartionMode (long busId, long operationMode)
 Profile Mode functions. More...
 
long sdkDS402_GetOpartionMode (long busId)
 Get the mode of operation DS402_MODES_OF_OPERATION(0x6060) More...
 
void sdkDS402_QuickStop (long busId)
 Execute quick stop. More...
 
void sdkDS402_Halt (long busId)
 Stop the motor. More...
 
void sdkDS402_ResetFault (long busId)
 Reset fault. More...
 
void sdkDS402_Print_StatusWord (long busId)
 Print the status word. More...
 
void sdkDS402_Print_ControlWord (long busId)
 Print the control word. More...
 
long helperDS402_PPM_PosStart (long busId, long pos, long relative, long startImmediately)
 Profile Position Mode functions. More...
 
long sdkDS402_PPM_PosAbsStart (long busId, long pos, long startImmediately)
 Start absolute positioning. More...
 
long sdkDS402_PPM_PosRelStart (long busId, long pos, long startImmediately)
 Start relative positioning. More...
 
long sdkDS402_PPM_TargetReached (long busId)
 Checks whether the target was reached. More...
 
long sdkDS402_PPM_WaitTargetReached (long busId, long timeout)
 Wait until target is reachd. More...
 
void sdkDS402_PVM_SetTargetVelocity (long busId, long targetVelocity)
 Profile Velocity Mode functions. More...
 
long sdkDS402_PVM_CvelStart (long busId)
 Start continuous velocity (PVM) More...
 
long sdkDS402_PVM_CvelStop (long busId)
 Stop continuous velocity (PVM) More...
 
long sdkDS402_PVM_TargetReached (long busId)
 Checks whether the target velocity has reached. More...
 
long sdkDS402_PVM_WaitTargetReached (long busId, long timeout)
 Wait until target is reachd. More...
 

Detailed Description

This file provides all the function used for DS402 PPM and PVM.

A DS402 slave can be operated in the different modes PPM and PVM The amplifiers can be controlled via EtherCAT or CAN bus.

Definition in file SDK_Amplifier_DS402_StateMachine.mc.

Macro Definition Documentation

◆ DS402_PPM_IMMEDIATELY

#define DS402_PPM_IMMEDIATELY   1

Function Documentation

◆ helperDS402_ExecuteTransition()

long helperDS402_ExecuteTransition ( long  busId,
long  transition 
)

Execute a state transition.

This function executes a state transition within the DS402 state machine. DO NOT USE this function for state changes. It is just a helper function for the function sdkDS402_TransitionToState(). If you want to execute a state transition, use the function sdkDS402_TransitionToState().

The function writes value to the control word, to set the bits for state changes.

Bit 0: Switched on
Bit 1: Enable voltage
Bit 2: Quick stop
Bit 3: Enable operation
..
Bit 7: Fault reset
T

sdkDS402_TransitionToState()

Parameters
busIdBus ID of the connected slave
transitionValue of the transition to execute
Returns
value: Process value
value > 0 Transition successful
value < 0 Invalid transition

Definition at line 152 of file SDK_Amplifier_DS402_StateMachine.mc.

153 {
154  long controlWord = sdkDS402_ReadControlWord(busId);
155  long retVal = 1;
156 
157  switch(transition) {
159  //Transition Shutdown: CW 0xxx x110
160  printf("...: execute Transition: DS402_TRANSITION_SHUTDOWN\n", busId);
161  controlWord = (controlWord & 0xFF78) | 0x06;
162  sdkDS402_WriteControlWord(busId, controlWord);
163  break;
165  printf("...: execute Transition: DS402_TRANSITION_SWITCH_ON\n", busId);
166  //Transition Switch On: CW 0xxx x111
167  controlWord = (controlWord & 0xFF78) | 0x07;
168  sdkDS402_WriteControlWord(busId, controlWord);
169  break;
171  printf("...: execute Transition: DS402_TRANSITION_ENABLE_OPERATION\n", busId);
172  //Transition Enable Operation: CW 0xxx 1111
173  controlWord = (controlWord & 0xFF70) | 0x0F;
174  sdkDS402_WriteControlWord(busId, controlWord);
175  break;
177  printf("...: execute Transition: DS402_TRANSITION_DISABLE_VOLTAGE\n", busId);
178  //Transition Disable Voltage: CW 0xxx xx0x
179  controlWord = (controlWord & 0xFF7D);
180  sdkDS402_WriteControlWord(busId, controlWord);
181  break;
183  printf("...: execute Transition: DS402_TRANSITION_QUICK_STOP\n", busId);
184  //Transition Quick Stop: CW 0xxx x01x
185  controlWord = (controlWord & 0xFF79) | 0x02;
186  sdkDS402_WriteControlWord(busId, controlWord);
187  break;
189  printf("...: execute Transition: DS402_TRANSITION_DISABLE_OPERATION\n", busId);
190  //Transition Disable Voltage: CW 0xxx 0111
191  controlWord = (controlWord & 0xFF70) | 0x07;
192  sdkDS402_WriteControlWord(busId, controlWord);
193  break;
195  printf("...: execute Transition: DS402_TRANSITION_FAULT_RESET\n", busId);
196  //Transition Fault Resest: CW 0xxx xxxx -> 1xxx xxxx
197  controlWord = (controlWord & 0xFF7F);
198  sdkDS402_WriteControlWord(busId, controlWord);
199  //Delay(1);
200  controlWord = controlWord | 0x80;
201  sdkDS402_WriteControlWord(busId, controlWord);
202  //Transition switch on disable
203  controlWord = controlWord & 0xFF7F;
204  sdkDS402_WriteControlWord(busId, controlWord);
205  break;
206  default:
207  printf("Invalid state transition\n");
208  retVal = -1;
209  break;
210  }
211 
212  return(retVal);
213 }

◆ helperDS402_PPM_PosStart()

long helperDS402_PPM_PosStart ( long  busId,
long  pos,
long  relative,
long  startImmediately 
)

Profile Position Mode functions.

Start positioning relative or absolute

This function starts positioning of an axis relative or absolute. Do not use this funtion. Use sdkDS402_PPM_PosAbsStart() or sdkDS402_PPM_PosRelStart() instead. This funtion is blocking until the setpoint acknowledge is received (max 2ms)

Parameters
busIdBus ID of the connected slave
postarget position
relativeexcute the positioning relative or absolute
0: absolute
1: relative
startImmediatelystart the movement immediately
0: Finish actual positioning
1: Abort actual positioning and start next positioning
Returns
value: Process value
value = 1 successful, new setpoint acknowlegded
value = -1 failed, new setpoint not acknowlegded
value = -2 failed, previous setpoint has been assumed and no additional setpoint may be accepted

Definition at line 721 of file SDK_Amplifier_DS402_StateMachine.mc.

722 {
723  long retVal = 1;
724  long controlWord = 0;
725  long setpointAcknowlege=1;
726  long time = 0;
727  long actState = -1;
728 
729  printf("...: new setpoint: %d\n", pos);
730 
732  {
733  print("...: the previous setpoint has been assumed and no additional setpoint may be accepted");
734  return(-2);
735  }
736 
737  actState = sdkDS402_GetActDriveState(busId);
739  {
740  print("...: drive state is not in operation enabled");
741  return(-1);
742  }
743 
744  SdoWrite(busId, DS402_TARGET_POSITION, 0 ,pos);
745 
746  controlWord = sdkDS402_ReadControlWord(busId);
747  controlWord.i[DS402_CW_PPM_BIT_NEW_SETPOINT] = 1;
748  controlWord.i[DS402_CW_PPM_BIT_CHANGE_IMMEDIATELY] = startImmediately;
749  controlWord.i[DS402_CW_PPM_BIT_RELATIVE_MOVEMENT] = relative;
750  controlWord.i[DS402_CW_PPM_BIT_ENDLESS_MOVEMENT] = 0;
751 
752  sdkDS402_WriteControlWord(busId, controlWord);
753 
754  time = Time();
756  {
757  if((Time()-time) > 2) //is blocking until the new setpoint has been acknowledged
758  {
759  print("...: no setpoint acknowledge received");
760  setpointAcknowlege = 0;
761  retVal = -1;
762  break;
763  }
764  }
765  controlWord = sdkDS402_ReadControlWord(busId);
766  controlWord.i[DS402_CW_PPM_BIT_NEW_SETPOINT] = 0;
767  controlWord.i[DS402_CW_PPM_BIT_CHANGE_IMMEDIATELY] = 0;
768  controlWord.i[DS402_CW_PPM_BIT_RELATIVE_MOVEMENT] = 0;
769  controlWord.i[DS402_CW_PPM_BIT_ENDLESS_MOVEMENT] = 0;
770 
771  sdkDS402_WriteControlWord(busId, controlWord);
772 
773  if(setpointAcknowlege)
774  {
775  print("...: setpoint acknowleged");
776  }
777 
778  return(retVal);
779 }

◆ sdkDS402_GetActDriveState()

long sdkDS402_GetActDriveState ( long  busId)

Get the actual drive state.

This function gets the actual state in DS402 state machine The state is depending on the folloeing bits in the status word.

Bit0: Ready to switch on
Bit1: Switched on
Bit2: Operation enabled
Bit3: Fault
Bit4: *(don't care)
Bit5: Quick stop (low active)
Bit6: switch on disabled

Parameters
busIdBus ID of the connected slave
Returns
value: drive state (value mapping: in SDK_Amplifier_DS402_StateMachine.mh)
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc, and CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 83 of file SDK_Amplifier_DS402_StateMachine.mc.

84 {
85  long status = sdkDS402_ReadStatusWord(busId);
86 
87  switch(status & 0x006F) //mask bits xxxx xxxx x11x 1111
88  {
89 
90  case 0x0000: return(DS402_DRIVE_STATE_NOT_READY_TO_SWITCH_ON); //xxxx xxxx x00x 0000
91  case 0x0040: return(DS402_DRIVE_STATE_SWITCH_ON_DISABLED); //xxxx xxxx x10x 0000
92  case 0x0021: return(DS402_DRIVE_STATE_READY_TO_SWITCH_ON); //xxxx xxxx x01x 0001
93  case 0x0023: return(DS402_DRIVE_STATE_SWITCHED_ON); //xxxx xxxx x01x 0011
94  case 0x0027: return(DS402_DRIVE_STATE_OPERATION_ENABLED); //xxxx xxxx x01x 0111
95  case 0x0007: return(DS402_DRIVE_STATE_QUICK_STOP_ACTIVE); //xxxx xxxx x01x 0001
96  case 0x000F: return(DS402_DRIVE_STATE_FAULT_REACTION_ACTIVE); //xxxx xxxx x00x 1111
97  case 0x0008: return(DS402_DRIVE_STATE_FAULT); //xxxx xxxx x00x 1000
98  default: return(-1);;
99  }
100 }

◆ sdkDS402_GetOpartionMode()

long sdkDS402_GetOpartionMode ( long  busId)

Get the mode of operation DS402_MODES_OF_OPERATION(0x6060)

Get the mode of operation.

Parameters
busIdBus ID of the connected slave
Returns
operationMode Definition of the operation mode
DS402_OP_PPM (1): Profile Position Mode (PPM)
DS402_OP_PVM (3): Profile Velocity Mode (PVM)

Definition at line 531 of file SDK_Amplifier_DS402_StateMachine.mc.

532 {
533  long operationMode = SdoRead( busId, DS402_MODES_OF_OPERATION, 0);
534  return(operationMode);
535 }

◆ sdkDS402_Halt()

void sdkDS402_Halt ( long  busId)

Stop the motor.

This function stops the motor with the defined profile deceleration. The deceleration can be set with method sdkDS402_SetProfileDeceleration

Parameters
busIdBus ID of the connected slave
Examples
CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc.

Definition at line 557 of file SDK_Amplifier_DS402_StateMachine.mc.

558 {
559  long controlWord;
560  printf("Bus Id %d, Halt\n", busId);
561 
562  controlWord = sdkDS402_ReadControlWord(busId);
563  controlWord.i[DS402_CW_BIT_HALT] = 1;
564 
565  sdkDS402_WriteControlWord(busId, controlWord);
566 }

◆ sdkDS402_PPM_PosAbsStart()

long sdkDS402_PPM_PosAbsStart ( long  busId,
long  pos,
long  startImmediately 
)

Start absolute positioning.

This function starts absolute positioning This funtion is blocking until the setpoint acknowledge is received (max 2ms)

Parameters
busIdBus ID of the connected slave
postarget position
startImmediatelystart the movement immediately
0: Finish actual positioning
1: Abort actual positioning and start next positioning
Returns
value: Process value
value = 1 successful, new setpoint acknowlegded
value = -1 failed, new setpoint not acknowlegded
value = -2 failed, previous setpoint has been assumed and no additional setpoint may be accepted
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, and CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 797 of file SDK_Amplifier_DS402_StateMachine.mc.

798 {
799 
800  printf("Bus Id %d, sdkDS402_PPM_PosAbsStart:\n", busId);
801  return helperDS402_PPM_PosStart(busId, pos, DS402_PPM_ABSOLUTE, startImmediately);
802 }

◆ sdkDS402_PPM_PosRelStart()

long sdkDS402_PPM_PosRelStart ( long  busId,
long  pos,
long  startImmediately 
)

Start relative positioning.

This function starts relative positioning This funtion is blocking until the setpoint acknowledge is received (max 2ms)

Parameters
busIdBus ID of the connected slave
posrelative movement value
startImmediatelystart the movement immediately
0: Finish actual positioning
1: Abort actual positioning and start next positioning
Returns
value: Process value
value = 1 successful, new setpoint acknowlegded
value = -1 failed, new setpoint not acknowlegded
value = -2 failed, previous setpoint has been assumed and no additional setpoint may be accepted
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, and CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 819 of file SDK_Amplifier_DS402_StateMachine.mc.

820 {
821  printf("Bus Id %d, sdkDS402_PPM_PosRelStart:\n", busId);
822  return helperDS402_PPM_PosStart(busId, pos, DS402_PPM_RELATIVE, startImmediately);
823 }

◆ sdkDS402_PPM_TargetReached()

long sdkDS402_PPM_TargetReached ( long  busId)

Checks whether the target was reached.

This function verifies whether the axis reached the target position This function is not blocking until the axis reaches the target.

Parameters
busIdBus ID of the connected slave
Returns
value: Process value
value = 1 Target reached
value = 0 Target NOT reached
Examples
CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 836 of file SDK_Amplifier_DS402_StateMachine.mc.

837 {
839 }

◆ sdkDS402_PPM_WaitTargetReached()

long sdkDS402_PPM_WaitTargetReached ( long  busId,
long  timeout 
)

Wait until target is reachd.

This function waits (blocks) until the axis has reached the target position whthin the defined timeout.

Parameters
busIdBus ID of the connected slave
timeoutTimeout until the function is aborted
>=0: timeout in [ms]
< 0: infinite timeout
Returns
value: Process value
value > 0 Target reached
value < 0 Timeout expired
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 853 of file SDK_Amplifier_DS402_StateMachine.mc.

854 {
855  long time = Time();
856  long targetReached = 1;
857 
858  printf("Bus Id %d, sdkDS402_PPM_WaitTargetReached:\n", busId);
859 
860  while(sdkDS402_PPM_TargetReached(busId) == 0 && targetReached)
861  {
862  if(timeout >= 0 && (Time() - time) > timeout)
863  {
864  targetReached = -1;
865  printf("...: target position not reached within timeout (%d ms)\n", timeout);
866  }
867  }
868  if(targetReached)
869  {
870  print("...: target position reached");
871  }
872 
873  return(targetReached);
874 }

◆ sdkDS402_Print_ControlWord()

void sdkDS402_Print_ControlWord ( long  busId)

Print the control word.

This function writes the control word split into individual bits with their description. It is depending on the actual modes of operation (PPM/PVM). This function can be used for debugging purposes.

Parameters
busIdBus ID of the connected slave

Definition at line 656 of file SDK_Amplifier_DS402_StateMachine.mc.

657 {
658  long value;
659  long controlWord;
660  long operationMode;
661 
662  operationMode = SdoRead(busId, DS402_MODES_OF_OPERATION, 0);
663  controlWord = sdkDS402_ReadControlWord(busId);
664 
665  print("CONTROL WORD");
666  value = controlWord.i[DS402_CW_BIT_SWITCH_ON];
667  printf("\tSWITCH_ON:\t\t%d\n", value);
668 
669  value = controlWord.i[DS402_CW_BIT_ENABLE_VOLTAGE];
670  printf("\tENABLE_VOLTAGE:\t\t%d\n", value);
671 
672  value = controlWord.i[DS402_CW_BIT_QUICK_STOP];
673  printf("\tQUICK_STOP:\t\t%d\n", value);
674 
675  value = controlWord.i[DS402_CW_BIT_ENABLE_OPERATION];
676  printf("\tENABLE_OPERATION:\t%d\n", value);
677 
678  value = controlWord.i[DS402_CW_BIT_HALT];
679  printf("\tHALT:\t\t\t%d\n", value);
680 
681  if(operationMode == DS402_OP_PPM)
682  {
683  value = controlWord.i[DS402_CW_PPM_BIT_NEW_SETPOINT];
684  printf("\tNEW_SETPOINT:\t%d\n", value);
685 
686  value = controlWord.i[DS402_CW_PPM_BIT_CHANGE_IMMEDIATELY];
687  printf("\tCHANGE_IMMEDIATELY:\t%d\n", value);
688 
689  value = controlWord.i[DS402_CW_PPM_BIT_RELATIVE_MOVEMENT];
690  printf("\tRELATIVE_MOVEMENT:\t%d\n", value);
691 
692  value = controlWord.i[DS402_CW_PPM_BIT_ENDLESS_MOVEMENT];
693  printf("\tENDLESS_MOVEMENT:\t%d\n", value);
694  }
695 }

◆ sdkDS402_Print_StatusWord()

void sdkDS402_Print_StatusWord ( long  busId)

Print the status word.

This function print the status word split into individual bits with their description. It is depending on the actual modes of operation (PPM/PVM). This function can be used for debugging purposes.

Parameters
busIdBus ID of the connected slave
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, and CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc.

Definition at line 588 of file SDK_Amplifier_DS402_StateMachine.mc.

589 {
590  long value;
591  long status;
592  long operationMode;
593  operationMode = SdoRead(busId, DS402_MODES_OF_OPERATION, 0);
594  status = sdkDS402_ReadStatusWord(busId);
595 
596 
597  print("STATUS WORD");
598 
599  value = status.i[DS402_SW_BIT_READY_TO_SWITCH_ON];
600  printf("\tREADY_TO_SWITCH_ON:\t%d\n", value);
601 
602  value = status.i[DS402_SW_BIT_SWITCHED_ON];
603  printf("\tSWITCHED_ON:\t\t%d\n", value);
604 
605  value = status.i[DS402_SW_BIT_OPERATION_ENABLED];
606  printf("\tOPERATION_ENABLED:\t%d\n", value);
607 
608  value = status.i[DS402_SW_BIT_FAULT];
609  printf("\tFAULT:\t\t\t%d\n", value);
610 
611  value = status.i[DS402_SW_BIT_VOLTAGE_ENABLED];
612  printf("\tVOLTAGE_ENABLED:\t%d\n", value);
613 
614  value = status.i[DS402_SW_BIT_QUICK_STOP];
615  printf("\tQUICK_STOP:\t\t%d\n", value);
616 
617  value = status.i[DS402_SW_BIT_SWITCH_ON_DISABLED];
618  printf("\tSWITCH_ON_DISABLED:\t%d\n", value);
619 
620  value = status.i[DS402_SW_BIT_WARNING];
621  printf("\tWARNING:\t\t%d\n", value);
622 
623  value = status.i[DS402_SW_BIT_REMOTE];
624  printf("\tREMOTE:\t\t\t%d\n", value);
625 
626  value = status.i[DS402_SW_BIT_TARGET_REACHED];
627  printf("\tTARGET_REACHED:\t\t%d\n", value);
628 
629  value = status.i[DS402_SW_BIT_INTERNAL_LIMIT];
630  printf("\tINTERNAL_LIMIT:\t\t%d\n", value);
631 
632  if(operationMode == DS402_OP_PPM)
633  {
634  value = status.i[DS402_SW_PPM_BIT_SETPOINT_ACK];
635  printf("\tSETPOINT_ACK:\t\t%d\n", value);
636 
637  value = status.i[DS402_SW_PPM_BIT_FOLLWING_ERROR];
638  printf("\tFOLLWING_ERROR:\t\t%d\n", value);
639  }
640 
641  if(operationMode == DS402_OP_PVM)
642  {
643  value = status.i[DS402_SW_PVM_BIT_SPEED];
644  printf("\tSPEED:\t\t\t%d\n", value);
645  }
646 }

◆ sdkDS402_PrintState()

void sdkDS402_PrintState ( long  state)

Print the name of certain drive state.

This function prints the state name from a state vlaue. It can be used to create human readable print outputs for debugging reason.

Parameters
statevalue of the state to print (value mapping: in SDK_Amplifier_DS402_StateMachine.mh)

Definition at line 111 of file SDK_Amplifier_DS402_StateMachine.mc.

112 {
113  switch(state)
114  {
115  case DS402_DRIVE_STATE_NOT_READY_TO_SWITCH_ON: printf("DRIVE_STATE_NOT_READY_TO_SWITCH_ON"); break;
116  case DS402_DRIVE_STATE_SWITCH_ON_DISABLED: printf("DRIVE_STATE_SWITCH_ON_DISABLED"); break;
117  case DS402_DRIVE_STATE_READY_TO_SWITCH_ON: printf("DRIVE_STATE_READY_TO_SWITCH_ON"); break;
118  case DS402_DRIVE_STATE_SWITCHED_ON: printf("DRIVE_STATE_SWITCHED_ON"); break;
119  case DS402_DRIVE_STATE_OPERATION_ENABLED: printf("DRIVE_STATE_OPERATION_ENABLED"); break;
120  case DS402_DRIVE_STATE_QUICK_STOP_ACTIVE: printf("DRIVE_STATE_QUICK_STOP_ACTIVE"); break;
121  case DS402_DRIVE_STATE_FAULT_REACTION_ACTIVE: printf("DRIVE_STATE_FAULT_REACTION_ACTIVE"); break;
122  case DS402_DRIVE_STATE_FAULT: printf("DRIVE_STATE_FAULT"); break;
123  default: printf("%d", state);
124  }
125 }

◆ sdkDS402_PVM_CvelStart()

long sdkDS402_PVM_CvelStart ( long  busId)

Start continuous velocity (PVM)

This function start to run the axis in continuous velocity The velocity can be defined with the method sdkDS402_PVM_SetTargetVelocity.

Parameters
busIdBus ID of the connected slave
Returns
value: Process value
value 1 Successful
value -1 Failed, drive is not in 'Operation enabled' state
Examples
CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc.

Definition at line 904 of file SDK_Amplifier_DS402_StateMachine.mc.

905 {
906  long actState;
907  long controlWord;
908 
909  printf("Bus Id %d, sdkDS402_PPM_CvelStart: \n", busId);
910 
911  actState = sdkDS402_GetActDriveState(busId);
913  {
914  printf("...: drive state is not in operation enabled\n");
915  return(-1);
916  }
917 
918  //Reset the Halt bit to start the execution
919  controlWord = sdkDS402_ReadControlWord(busId);
920  controlWord.i[DS402_CW_BIT_HALT] = 0;
921  sdkDS402_WriteControlWord(busId, controlWord);
922 
923  printf("...: started\n");
924 
925  return(1);
926 }

◆ sdkDS402_PVM_CvelStop()

long sdkDS402_PVM_CvelStop ( long  busId)

Stop continuous velocity (PVM)

This function stops the axis.

Parameters
busIdBus ID of the connected slave
Returns
value: Process value
value 1 Successful
Examples
CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc.

Definition at line 935 of file SDK_Amplifier_DS402_StateMachine.mc.

936 {
937  long controlWord;
938  printf("Bus Id %d, sdkDS402_PPM_CvelStop:\n", busId);
939 
940  //Set the Halt bit, to stop the execution
941  controlWord = sdkDS402_ReadControlWord(busId);
942  controlWord.i[DS402_CW_BIT_HALT] = 1;
943 
944  sdkDS402_WriteControlWord(busId, controlWord);
945  printf("...: stopped\n");
946 
947  return(1);
948 }

◆ sdkDS402_PVM_SetTargetVelocity()

void sdkDS402_PVM_SetTargetVelocity ( long  busId,
long  targetVelocity 
)

Profile Velocity Mode functions.

Set target velocity for PVM

This function sets the target velocity for the Profile Position Mode (PVM)

Parameters
busIdBus ID of the connected slave
targetVelocityTarget velocity
Examples
CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc.

Definition at line 888 of file SDK_Amplifier_DS402_StateMachine.mc.

889 {
890  printf("Bus Id %d, PVM: Set target velocity to %d\n", busId, targetVelocity);
891  SdoWrite(busId, DS402_TARGET_VELOCITY, 0, targetVelocity);
892 }

◆ sdkDS402_PVM_TargetReached()

long sdkDS402_PVM_TargetReached ( long  busId)

Checks whether the target velocity has reached.

This function verifies whether the axis reached the target velocity

Parameters
busIdBus ID of the connected slave
Returns
value: Process value
value = 1 Target reached
value = 0 Target NOT reached

Definition at line 959 of file SDK_Amplifier_DS402_StateMachine.mc.

960 {
962 }

◆ sdkDS402_PVM_WaitTargetReached()

long sdkDS402_PVM_WaitTargetReached ( long  busId,
long  timeout 
)

Wait until target is reachd.

This function waits (blocks) until the axis has reached the target velocity whthin the defined timeout.

Parameters
busIdBus ID of the connected slave
timeoutTimeout until the funcition returns
>=0: timeout in [ms]
< 0: infinite timeout
Returns
value: Process value
value > 0 Target reached
value < 0 Timeout expired
Examples
CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc.

Definition at line 976 of file SDK_Amplifier_DS402_StateMachine.mc.

977 {
978  long time = Time();
979  long targetReached = 1;
980 
981  printf("Bus Id %d, sdkDS402_PVM_WaitTargetReached:\n", busId);
982 
983  while(sdkDS402_PPM_TargetReached(busId) == 0 && targetReached)
984  {
985  if(timeout >= 0 && (Time() - time) > timeout)
986  {
987  targetReached = -1;
988  printf("...: target velocity not reached within timeout (%d ms)\n", timeout);
989  }
990  }
991  if(targetReached)
992  {
993  print("...: target velocity reached");
994  }
995 
996  return(targetReached);
997 }

◆ sdkDS402_QuickStop()

void sdkDS402_QuickStop ( long  busId)

Execute quick stop.

This function executes a quick stop with the defined deceleration. The deceleration can be set with method sdkDS402_SetQuickStopDeceleration()

Parameters
busIdBus ID of the connected slave
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc, and CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 544 of file SDK_Amplifier_DS402_StateMachine.mc.

545 {
546  printf("Bus Id %d, Quick Stop\n", busId);
548 }

◆ sdkDS402_ReadControlWord()

long sdkDS402_ReadControlWord ( long  busId)

Read control word.

This function reads the control word form index DS402_CONTROLWORD(0x6040) and subindex 0 The bits have different meaning for Profile Position Mode and Profile Velocity Mode

Parameters
busIdBus ID of the connected slave
Returns
value: control word

Definition at line 46 of file SDK_Amplifier_DS402_StateMachine.mc.

47 {
48  return SdoRead(busId, DS402_CONTROLWORD, 0);
49 }

◆ sdkDS402_ReadStatusWord()

long sdkDS402_ReadStatusWord ( long  busId)

DS 402 State-Machine functions.

Declaration of functions.

Read status word

This function reads the status word form index DS402_STATUSWORD(0x6041) and subindex 0 The bits have different meaning for Profile Position Mode and Profile Velocity Mode

Parameters
busIdBus ID of the connected slave
Returns
value: status word
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc, and CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 33 of file SDK_Amplifier_DS402_StateMachine.mc.

34 {
35  return SdoRead(busId, DS402_STATUSWORD, 0);
36 }

◆ sdkDS402_ResetFault()

void sdkDS402_ResetFault ( long  busId)

Reset fault.

This function resets the fault execute a state transition to 'Switch On disabled'

Parameters
busIdBus ID of the connected slave
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc, and CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 574 of file SDK_Amplifier_DS402_StateMachine.mc.

575 {
576  printf("Bus Id %d, Reset Fault\n", busId);
578 }

◆ sdkDS402_SetMaxAcceleration()

void sdkDS402_SetMaxAcceleration ( long  busId,
long  acc 
)

Set the max acceleration DS402_MAX_ACCELERATION(0x60C5)

Set the maximum allowed acceleration to prevent mechanical damage.

Parameters
busIdBus ID of the connected slave
accacceleration value

Definition at line 464 of file SDK_Amplifier_DS402_StateMachine.mc.

465 {
466  SdoWrite(busId, DS402_MAX_ACCELERATION, 0, acc);
467 }

◆ sdkDS402_SetMaxMotorSpeed()

void sdkDS402_SetMaxMotorSpeed ( long  busId,
long  vel 
)

Set the max profile velocity DS402_MAX_MOTOR_SPEED(0x6080)

Set the maximum allowed speed for the motor. It serves as protection for the motor. The value is given in [rpm].

Parameters
busIdBus ID of the connected slave
velspeed value [velocity unit]

Definition at line 452 of file SDK_Amplifier_DS402_StateMachine.mc.

453 {
454  SdoWrite(busId, DS402_MAX_MOTOR_SPEED, 0, vel);
455 }

◆ sdkDS402_SetMaxProfileVelocity()

void sdkDS402_SetMaxProfileVelocity ( long  busId,
long  vel 
)

Set the max profile velocity DS402_MAX_PROFILE_VELOCITY(0x607F)

Set the velocity limit in a PPM or PVM move.

Parameters
busIdBus ID of the connected slave
velvelocity value [velocity unit]

Definition at line 439 of file SDK_Amplifier_DS402_StateMachine.mc.

440 {
441  SdoWrite(busId, DS402_MAX_PROFILE_VELOCITY, 0, vel);
442 }

◆ sdkDS402_SetMotionProfileType()

void sdkDS402_SetMotionProfileType ( long  busId,
long  type 
)

Set the motion profile type DS402_MOTION_PROFILE_TYPE(0x6086)

Set the type of motion profile trajectory

Parameters
busIdBus ID of the connected slave
typemotion profile type value
0: linear ramp (trapezoidal profile)

Definition at line 427 of file SDK_Amplifier_DS402_StateMachine.mc.

428 {
429  SdoWrite(busId, DS402_MOTION_PROFILE_TYPE, 0, type);
430 }

◆ sdkDS402_SetOpartionMode()

void sdkDS402_SetOpartionMode ( long  busId,
long  operationMode 
)

Profile Mode functions.

Set the mode of operation DS402_MODES_OF_OPERATION(0x6060)

Set the mode of operation.

Parameters
busIdBus ID of the connected slave
operationModeDefinition of the operation mode
DS402_OP_PPM (1): Profile Position Mode (PPM)
DS402_OP_PVM (3): Profile Velocity Mode (PVM)
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc, and CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 508 of file SDK_Amplifier_DS402_StateMachine.mc.

509 {
510  if( operationMode == DS402_OP_PPM)
511  {
512  printf("Bus Id %d, setup profile position mode\n" ,busId);
513  SdoWrite( busId, DS402_MODES_OF_OPERATION, 0, DS402_OP_PPM);
514  }
515  else if(operationMode == DS402_OP_PVM)
516  {
517  printf("Bus Id %d, setup profile velocity mode\n" ,busId);
518  SdoWrite( busId, DS402_MODES_OF_OPERATION, 0, DS402_OP_PVM);
519  }
520 }

◆ sdkDS402_SetProfileAcceleration()

void sdkDS402_SetProfileAcceleration ( long  busId,
long  acc 
)

Profile Mode settings.

Set the profile acceleration DS402_PROFILE_ACCELERATION(0x6083)

Set the acceleration for PPM (Profile Position Mode) and PVM (Profile Velocity Mode)

Parameters
busIdBus ID of the connected slave
accacceleration value [acceleration unit]
Examples
CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc.

Definition at line 389 of file SDK_Amplifier_DS402_StateMachine.mc.

390 {
391  SdoWrite(busId, DS402_PROFILE_ACCELERATION, 0, acc);
392 }

◆ sdkDS402_SetProfileDeceleration()

void sdkDS402_SetProfileDeceleration ( long  busId,
long  dec 
)

Set the profile deceleration DS402_PROFILE_DECELERATION(0x6084)

Set the deceleration for PPM (Profile Position Mode) and PVM (Profile Velocity Mode)

Parameters
busIdBus ID of the connected slave
accdeceleration value [acceleration unit]
Examples
CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc.

Definition at line 401 of file SDK_Amplifier_DS402_StateMachine.mc.

402 {
403  SdoWrite(busId, DS402_PROFILE_DECELERATION, 0, dec);
404 }

◆ sdkDS402_SetProfileMovementParameter()

void sdkDS402_SetProfileMovementParameter ( long  busId,
long  acc,
long  dec,
long  velocity 
)

Set quick stop deceleration DS402_QUICK_STOP_DECELERATION(0x6085)

Set the deceleration of the quick stop profile.

Parameters
busIdBus ID of the connected slave
decdeceleration value
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, and CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 488 of file SDK_Amplifier_DS402_StateMachine.mc.

489 {
492  sdkDS402_SetProfileVelocity(busId, velocity);
493 }

◆ sdkDS402_SetProfileVelocity()

void sdkDS402_SetProfileVelocity ( long  busId,
long  vel 
)

Set the profile velocity DS402_PROFILE_VELOCITY(0x6081)

Set the deceleration for PPM (Profile Position Mode) The target velocity for PVM has to be set with the function sdkDS402_PVM_TargetReached()

Parameters
busIdBus ID of the connected slave
velvelocity value [velocity unit]

Definition at line 414 of file SDK_Amplifier_DS402_StateMachine.mc.

415 {
416  SdoWrite(busId, DS402_PROFILE_VELOCITY, 0, vel);
417 }

◆ sdkDS402_SetQuickStopDeceleration()

void sdkDS402_SetQuickStopDeceleration ( long  busId,
long  dec 
)

Set quick stop deceleration DS402_QUICK_STOP_DECELERATION(0x6085)

Set the deceleration of the quick stop profile.

Parameters
busIdBus ID of the connected slave
decdeceleration value
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc, and CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 476 of file SDK_Amplifier_DS402_StateMachine.mc.

477 {
478  SdoWrite(busId, DS402_QUICK_STOP_DECELERATION, 0, dec);
479 }

◆ sdkDS402_TransitionToState()

long sdkDS402_TransitionToState ( long  busId,
long  newState 
)

Transition to another state.

This function executes a state transition within the DS402 state machine. It gets the actual state and performs a transition to a new state, if the transition between those two states is allowed. It is not checked whether the target state has been achieved.

Parameters
busIdBus ID of the connected slave
newStatetarget state
Returns
value: Process value
value > 0 Transition executed
value < 0 Invalid transition
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, and CAN_MultipleAx_DS402_ProfilePositionMode-ppm-Test.mc.

Definition at line 230 of file SDK_Amplifier_DS402_StateMachine.mc.

230  {
231 
232  long transition = -1;
233  long actState = sdkDS402_GetActDriveState(busId);
234 
235  printf("Bus Id %d, Transition from ", busId);
236  sdkDS402_PrintState(actState);
237  printf(" to ");
238  sdkDS402_PrintState(newState);
239  print();
240 
241  switch(actState) {
243  if (newState == DS402_DRIVE_STATE_SWITCH_ON_DISABLED) {
244  // Automatic transition
245  }
246  break;
248  if (newState == DS402_DRIVE_STATE_READY_TO_SWITCH_ON) {
249  transition = DS402_TRANSITION_SHUTDOWN;
250  }
251  break;
253  if (newState == DS402_DRIVE_STATE_SWITCH_ON_DISABLED) {
255  }
256  else if (newState == DS402_DRIVE_STATE_SWITCHED_ON) {
257  transition = DS402_TRANSITION_SWITCH_ON;
258  }
259  else if (newState == DS402_DRIVE_STATE_OPERATION_ENABLED) {
261  }
262  break;
264  if (newState == DS402_DRIVE_STATE_SWITCH_ON_DISABLED) {
266  }
267  else if (newState == DS402_DRIVE_STATE_READY_TO_SWITCH_ON) {
268  transition = DS402_TRANSITION_SHUTDOWN;
269  }
270  else if (newState == DS402_DRIVE_STATE_OPERATION_ENABLED) {
272  }
273  break;
275  if (newState == DS402_DRIVE_STATE_SWITCH_ON_DISABLED) {
277  }
278  else if (newState == DS402_DRIVE_STATE_READY_TO_SWITCH_ON) {
279  transition = DS402_TRANSITION_SHUTDOWN;
280  }
281  else if (newState == DS402_DRIVE_STATE_SWITCHED_ON) {
283  }
284  else if (newState == DS402_DRIVE_STATE_QUICK_STOP_ACTIVE) {
285  transition = DS402_TRANSITION_QUICK_STOP;
286  }
287  break;
289  if (newState == DS402_DRIVE_STATE_SWITCH_ON_DISABLED) {
290  transition = DS402_TRANSITION_SHUTDOWN;
291  }
292  else if (newState == DS402_DRIVE_STATE_OPERATION_ENABLED) {
294  }
295  break;
297  if (newState == DS402_DRIVE_STATE_FAULT) {
298  // Automatic transition
299  }
300  else if (newState == DS402_DRIVE_STATE_SWITCH_ON_DISABLED) {
301  transition = DS402_TRANSITION_FAULT_RESET;
302  }
303  break;
305  if (newState == DS402_DRIVE_STATE_SWITCH_ON_DISABLED) {
306  transition = DS402_TRANSITION_FAULT_RESET;
307  }
308  break;
309  default:
310  printf("...: invalid actual drive state: %d\n", busId, actState);
311  break;
312  }
313 
314  if(transition != -1)
315  {
316  helperDS402_ExecuteTransition(busId, transition);
317  }
318  else
319  {
320  printf("...: invalid state transition\n", busId);
321  }
322 
323  return(transition);
324 }

◆ sdkDS402_WaitTransitionToState()

long sdkDS402_WaitTransitionToState ( long  busId,
long  targetState,
long  timeout 
)

Wait transition to another state.

This function waits (block) until a target state in DS402 state machine has been reached or the timeout expierd. It gets the actual state and performs a transition to a new state, if the transition between those two states is allowed. Because this function is blocking, just use it for a single axis. If you would like to change the state of several axis use sdkDS402_TransitionToState() funciton and verify the transition in the application.

sdkDS402_TransitionToState

Parameters
busIdBus ID of the connected slave
newStatetarget state
Timeoutuntil the function is aborted >=0: timeout in [ms]
< 0: infinite timeout
Returns
value: Process value
value > 0 Transition executed (number of transition)
value -1 Invalid transition
value -2 Timeout expired
value -3 Invalid actual state
Examples
CAN_1Ax_DS402_ProfilePositionMode-ppm-Test.mc, and CAN_1Ax_DS402_ProfileVelocityMode-pvm-Test.mc.

Definition at line 347 of file SDK_Amplifier_DS402_StateMachine.mc.

348 {
349  long actState, transition;
350  long time = Time();
351 
352  printf("Bus Id %d, sdkDS402_WaitTransitionToState\n" ,busId);
353 
354  transition = sdkDS402_TransitionToState(busId, targetState);
355  if(transition < 0)
356  {
357  //Invalid transition
358  return(-1);
359  }
360 
361  actState = sdkDS402_GetActDriveState(busId);
362  while(actState != targetState)
363  {
364  if(timeout >= 0 && (Time() - time) > timeout)
365  {
366  //Timeout elapsed
367  printf("...: target state not reached within timeout (%d ms)\n", timeout);
368  return(-2);
369  }
370  actState = sdkDS402_GetActDriveState(busId);
371  }
372 
373  return(transition);
374 }

◆ sdkDS402_WriteControlWord()

void sdkDS402_WriteControlWord ( long  busId,
long  value 
)

Write control word.

This function writes the control word to index DS402_CONTROLWORD(0x6040) and subindex 0 The bits have different meaning for Profile Position Mode and Profile Velocity Mode

Parameters
busIdBus ID of the connected slave
valueValue of the control word
Returns
value: control word

Definition at line 60 of file SDK_Amplifier_DS402_StateMachine.mc.

61 {
62  SdoWrite(busId, DS402_CONTROLWORD, 0, value);
63 }
DS402_SW_BIT_SWITCH_ON_DISABLED
#define DS402_SW_BIT_SWITCH_ON_DISABLED
Definition: SDK_Amplifier_DS402_StateMachine.mh:103
sdkDS402_ReadStatusWord
long sdkDS402_ReadStatusWord(long busId)
DS 402 State-Machine functions.
Definition: SDK_Amplifier_DS402_StateMachine.mc:33
DS402_SW_BIT_OPERATION_ENABLED
#define DS402_SW_BIT_OPERATION_ENABLED
Definition: SDK_Amplifier_DS402_StateMachine.mh:99
DS402_SW_BIT_TARGET_REACHED
#define DS402_SW_BIT_TARGET_REACHED
Definition: SDK_Amplifier_DS402_StateMachine.mh:106
DS402_DRIVE_STATE_SWITCH_ON_DISABLED
#define DS402_DRIVE_STATE_SWITCH_ON_DISABLED
Definition: SDK_Amplifier_DS402_StateMachine.mh:61
DS402_STATUSWORD
#define DS402_STATUSWORD
Definition: SDK_Amplifier_DS402_StateMachine.mh:96
DS402_MAX_PROFILE_VELOCITY
#define DS402_MAX_PROFILE_VELOCITY
Definition: SDK_Amplifier_DS402_StateMachine.mh:139
DS402_DRIVE_STATE_FAULT_REACTION_ACTIVE
#define DS402_DRIVE_STATE_FAULT_REACTION_ACTIVE
Definition: SDK_Amplifier_DS402_StateMachine.mh:66
sdkDS402_SetProfileVelocity
void sdkDS402_SetProfileVelocity(long busId, long vel)
Set the profile velocity DS402_PROFILE_VELOCITY(0x6081)
Definition: SDK_Amplifier_DS402_StateMachine.mc:414
DS402_TARGET_VELOCITY
#define DS402_TARGET_VELOCITY
Definition: SDK_Amplifier_DS402_StateMachine.mh:184
DS402_DRIVE_STATE_QUICK_STOP_ACTIVE
#define DS402_DRIVE_STATE_QUICK_STOP_ACTIVE
Definition: SDK_Amplifier_DS402_StateMachine.mh:65
DS402_SW_BIT_QUICK_STOP
#define DS402_SW_BIT_QUICK_STOP
Definition: SDK_Amplifier_DS402_StateMachine.mh:102
sdkDS402_GetActDriveState
long sdkDS402_GetActDriveState(long busId)
Get the actual drive state.
Definition: SDK_Amplifier_DS402_StateMachine.mc:83
DS402_TRANSITION_SWITCH_ON
#define DS402_TRANSITION_SWITCH_ON
Definition: SDK_Amplifier_DS402_StateMachine.mh:71
DS402_TARGET_POSITION
#define DS402_TARGET_POSITION
Definition: SDK_Amplifier_DS402_StateMachine.mh:136
DS402_PROFILE_ACCELERATION
#define DS402_PROFILE_ACCELERATION
Definition: SDK_Amplifier_DS402_StateMachine.mh:142
DS402_MAX_ACCELERATION
#define DS402_MAX_ACCELERATION
Definition: SDK_Amplifier_DS402_StateMachine.mh:175
DS402_CW_BIT_HALT
#define DS402_CW_BIT_HALT
Definition: SDK_Amplifier_DS402_StateMachine.mh:88
DS402_TRANSITION_DISABLE_VOLTAGE
#define DS402_TRANSITION_DISABLE_VOLTAGE
Definition: SDK_Amplifier_DS402_StateMachine.mh:73
DS402_MOTION_PROFILE_TYPE
#define DS402_MOTION_PROFILE_TYPE
Definition: SDK_Amplifier_DS402_StateMachine.mh:145
sdkDS402_TransitionToState
long sdkDS402_TransitionToState(long busId, long newState)
Transition to another state.
Definition: SDK_Amplifier_DS402_StateMachine.mc:230
DS402_SW_BIT_VOLTAGE_ENABLED
#define DS402_SW_BIT_VOLTAGE_ENABLED
Definition: SDK_Amplifier_DS402_StateMachine.mh:101
DS402_TRANSITION_FAULT_RESET
#define DS402_TRANSITION_FAULT_RESET
Definition: SDK_Amplifier_DS402_StateMachine.mh:76
DS402_SW_BIT_REMOTE
#define DS402_SW_BIT_REMOTE
Definition: SDK_Amplifier_DS402_StateMachine.mh:105
DS402_CW_PPM_BIT_RELATIVE_MOVEMENT
#define DS402_CW_PPM_BIT_RELATIVE_MOVEMENT
Definition: SDK_Amplifier_DS402_StateMachine.mh:93
DS402_CW_BIT_QUICK_STOP
#define DS402_CW_BIT_QUICK_STOP
Definition: SDK_Amplifier_DS402_StateMachine.mh:86
DS402_SW_BIT_WARNING
#define DS402_SW_BIT_WARNING
Definition: SDK_Amplifier_DS402_StateMachine.mh:104
DS402_MAX_MOTOR_SPEED
#define DS402_MAX_MOTOR_SPEED
Definition: SDK_Amplifier_DS402_StateMachine.mh:140
DS402_TRANSITION_ENABLE_OPERATION
#define DS402_TRANSITION_ENABLE_OPERATION
Definition: SDK_Amplifier_DS402_StateMachine.mh:72
helperDS402_PPM_PosStart
long helperDS402_PPM_PosStart(long busId, long pos, long relative, long startImmediately)
Profile Position Mode functions.
Definition: SDK_Amplifier_DS402_StateMachine.mc:721
DS402_PROFILE_VELOCITY
#define DS402_PROFILE_VELOCITY
Definition: SDK_Amplifier_DS402_StateMachine.mh:141
DS402_DRIVE_STATE_FAULT
#define DS402_DRIVE_STATE_FAULT
Definition: SDK_Amplifier_DS402_StateMachine.mh:67
DS402_SW_BIT_SWITCHED_ON
#define DS402_SW_BIT_SWITCHED_ON
Definition: SDK_Amplifier_DS402_StateMachine.mh:98
DS402_CW_BIT_ENABLE_OPERATION
#define DS402_CW_BIT_ENABLE_OPERATION
Definition: SDK_Amplifier_DS402_StateMachine.mh:87
sdkDS402_ReadControlWord
long sdkDS402_ReadControlWord(long busId)
Read control word.
Definition: SDK_Amplifier_DS402_StateMachine.mc:46
DS402_SW_PVM_BIT_SPEED
#define DS402_SW_PVM_BIT_SPEED
Definition: SDK_Amplifier_DS402_StateMachine.mh:114
DS402_SW_BIT_FAULT
#define DS402_SW_BIT_FAULT
Definition: SDK_Amplifier_DS402_StateMachine.mh:100
DS402_CW_PPM_BIT_ENDLESS_MOVEMENT
#define DS402_CW_PPM_BIT_ENDLESS_MOVEMENT
Definition: SDK_Amplifier_DS402_StateMachine.mh:94
DS402_OP_PPM
#define DS402_OP_PPM
Definition: SDK_Amplifier_DS402_StateMachine.mh:120
DS402_PROFILE_DECELERATION
#define DS402_PROFILE_DECELERATION
Definition: SDK_Amplifier_DS402_StateMachine.mh:143
DS402_PPM_ABSOLUTE
#define DS402_PPM_ABSOLUTE
Definition: SDK_Amplifier_DS402_StateMachine.mh:189
helperDS402_ExecuteTransition
long helperDS402_ExecuteTransition(long busId, long transition)
Execute a state transition.
Definition: SDK_Amplifier_DS402_StateMachine.mc:152
DS402_MODES_OF_OPERATION
#define DS402_MODES_OF_OPERATION
Definition: SDK_Amplifier_DS402_StateMachine.mh:119
DS402_SW_BIT_INTERNAL_LIMIT
#define DS402_SW_BIT_INTERNAL_LIMIT
Definition: SDK_Amplifier_DS402_StateMachine.mh:107
DS402_TRANSITION_DISABLE_OPERATION
#define DS402_TRANSITION_DISABLE_OPERATION
Definition: SDK_Amplifier_DS402_StateMachine.mh:74
DS402_DRIVE_STATE_OPERATION_ENABLED
#define DS402_DRIVE_STATE_OPERATION_ENABLED
Definition: SDK_Amplifier_DS402_StateMachine.mh:64
DS402_DRIVE_STATE_NOT_READY_TO_SWITCH_ON
#define DS402_DRIVE_STATE_NOT_READY_TO_SWITCH_ON
Drive States and Transitions - CiA 402 State Machine.
Definition: SDK_Amplifier_DS402_StateMachine.mh:60
DS402_DRIVE_STATE_READY_TO_SWITCH_ON
#define DS402_DRIVE_STATE_READY_TO_SWITCH_ON
Definition: SDK_Amplifier_DS402_StateMachine.mh:62
sdkDS402_PrintState
void sdkDS402_PrintState(long state)
Print the name of certain drive state.
Definition: SDK_Amplifier_DS402_StateMachine.mc:111
sdkDS402_SetProfileDeceleration
void sdkDS402_SetProfileDeceleration(long busId, long dec)
Set the profile deceleration DS402_PROFILE_DECELERATION(0x6084)
Definition: SDK_Amplifier_DS402_StateMachine.mc:401
sdkDS402_SetProfileAcceleration
void sdkDS402_SetProfileAcceleration(long busId, long acc)
Profile Mode settings.
Definition: SDK_Amplifier_DS402_StateMachine.mc:389
DS402_CW_BIT_ENABLE_VOLTAGE
#define DS402_CW_BIT_ENABLE_VOLTAGE
Definition: SDK_Amplifier_DS402_StateMachine.mh:85
DS402_SW_BIT_READY_TO_SWITCH_ON
#define DS402_SW_BIT_READY_TO_SWITCH_ON
Definition: SDK_Amplifier_DS402_StateMachine.mh:97
DS402_SW_PPM_BIT_FOLLWING_ERROR
#define DS402_SW_PPM_BIT_FOLLWING_ERROR
Definition: SDK_Amplifier_DS402_StateMachine.mh:111
sdkDS402_PPM_TargetReached
long sdkDS402_PPM_TargetReached(long busId)
Checks whether the target was reached.
Definition: SDK_Amplifier_DS402_StateMachine.mc:836
DS402_QUICK_STOP_DECELERATION
#define DS402_QUICK_STOP_DECELERATION
Definition: SDK_Amplifier_DS402_StateMachine.mh:144
DS402_CW_BIT_SWITCH_ON
#define DS402_CW_BIT_SWITCH_ON
Definition: SDK_Amplifier_DS402_StateMachine.mh:84
DS402_SW_PPM_BIT_SETPOINT_ACK
#define DS402_SW_PPM_BIT_SETPOINT_ACK
Definition: SDK_Amplifier_DS402_StateMachine.mh:110
DS402_CW_PPM_BIT_NEW_SETPOINT
#define DS402_CW_PPM_BIT_NEW_SETPOINT
Definition: SDK_Amplifier_DS402_StateMachine.mh:91
DS402_CONTROLWORD
#define DS402_CONTROLWORD
Definition: SDK_Amplifier_DS402_StateMachine.mh:83
DS402_OP_PVM
#define DS402_OP_PVM
Definition: SDK_Amplifier_DS402_StateMachine.mh:121
DS402_TRANSITION_QUICK_STOP
#define DS402_TRANSITION_QUICK_STOP
Definition: SDK_Amplifier_DS402_StateMachine.mh:75
DS402_DRIVE_STATE_SWITCHED_ON
#define DS402_DRIVE_STATE_SWITCHED_ON
Definition: SDK_Amplifier_DS402_StateMachine.mh:63
DS402_CW_PPM_BIT_CHANGE_IMMEDIATELY
#define DS402_CW_PPM_BIT_CHANGE_IMMEDIATELY
Definition: SDK_Amplifier_DS402_StateMachine.mh:92
DS402_PPM_RELATIVE
#define DS402_PPM_RELATIVE
Definition: SDK_Amplifier_DS402_StateMachine.mh:190
sdkDS402_WriteControlWord
void sdkDS402_WriteControlWord(long busId, long value)
Write control word.
Definition: SDK_Amplifier_DS402_StateMachine.mc:60
DS402_TRANSITION_SHUTDOWN
#define DS402_TRANSITION_SHUTDOWN
Definition: SDK_Amplifier_DS402_StateMachine.mh:70

Data Sheets | Released Software | Software Manuals | Hardware Manuals | Maxon Shop

Maxon Support Center