 |
ApossC SDK
V01.15
|
Go to the documentation of this file.
87 switch(status & 0x006F)
123 default: printf(
"%d", state);
160 printf(
"...: execute Transition: DS402_TRANSITION_SHUTDOWN\n", busId);
161 controlWord = (controlWord & 0xFF78) | 0x06;
165 printf(
"...: execute Transition: DS402_TRANSITION_SWITCH_ON\n", busId);
167 controlWord = (controlWord & 0xFF78) | 0x07;
171 printf(
"...: execute Transition: DS402_TRANSITION_ENABLE_OPERATION\n", busId);
173 controlWord = (controlWord & 0xFF70) | 0x0F;
177 printf(
"...: execute Transition: DS402_TRANSITION_DISABLE_VOLTAGE\n", busId);
179 controlWord = (controlWord & 0xFF7D);
183 printf(
"...: execute Transition: DS402_TRANSITION_QUICK_STOP\n", busId);
185 controlWord = (controlWord & 0xFF79) | 0x02;
189 printf(
"...: execute Transition: DS402_TRANSITION_DISABLE_OPERATION\n", busId);
191 controlWord = (controlWord & 0xFF70) | 0x07;
195 printf(
"...: execute Transition: DS402_TRANSITION_FAULT_RESET\n", busId);
197 controlWord = (controlWord & 0xFF7F);
200 controlWord = controlWord | 0x80;
203 controlWord = controlWord & 0xFF7F;
207 printf(
"Invalid state transition\n");
232 long transition = -1;
235 printf(
"Bus Id %d, Transition from ", busId);
310 printf(
"...: invalid actual drive state: %d\n", busId, actState);
320 printf(
"...: invalid state transition\n", busId);
349 long actState, transition;
352 printf(
"Bus Id %d, sdkDS402_WaitTransitionToState\n" ,busId);
362 while(actState != targetState)
364 if(timeout >= 0 && (Time() - time) > timeout)
367 printf(
"...: target state not reached within timeout (%d ms)\n", timeout);
512 printf(
"Bus Id %d, setup profile position mode\n" ,busId);
517 printf(
"Bus Id %d, setup profile velocity mode\n" ,busId);
534 return(operationMode);
546 printf(
"Bus Id %d, Quick Stop\n", busId);
560 printf(
"Bus Id %d, Halt\n", busId);
576 printf(
"Bus Id %d, Reset Fault\n", busId);
597 print(
"STATUS WORD");
600 printf(
"\tREADY_TO_SWITCH_ON:\t%d\n", value);
603 printf(
"\tSWITCHED_ON:\t\t%d\n", value);
606 printf(
"\tOPERATION_ENABLED:\t%d\n", value);
609 printf(
"\tFAULT:\t\t\t%d\n", value);
612 printf(
"\tVOLTAGE_ENABLED:\t%d\n", value);
615 printf(
"\tQUICK_STOP:\t\t%d\n", value);
618 printf(
"\tSWITCH_ON_DISABLED:\t%d\n", value);
621 printf(
"\tWARNING:\t\t%d\n", value);
624 printf(
"\tREMOTE:\t\t\t%d\n", value);
627 printf(
"\tTARGET_REACHED:\t\t%d\n", value);
630 printf(
"\tINTERNAL_LIMIT:\t\t%d\n", value);
635 printf(
"\tSETPOINT_ACK:\t\t%d\n", value);
638 printf(
"\tFOLLWING_ERROR:\t\t%d\n", value);
644 printf(
"\tSPEED:\t\t\t%d\n", value);
665 print(
"CONTROL WORD");
667 printf(
"\tSWITCH_ON:\t\t%d\n", value);
670 printf(
"\tENABLE_VOLTAGE:\t\t%d\n", value);
673 printf(
"\tQUICK_STOP:\t\t%d\n", value);
676 printf(
"\tENABLE_OPERATION:\t%d\n", value);
679 printf(
"\tHALT:\t\t\t%d\n", value);
684 printf(
"\tNEW_SETPOINT:\t%d\n", value);
687 printf(
"\tCHANGE_IMMEDIATELY:\t%d\n", value);
690 printf(
"\tRELATIVE_MOVEMENT:\t%d\n", value);
693 printf(
"\tENDLESS_MOVEMENT:\t%d\n", value);
724 long controlWord = 0;
725 long setpointAcknowlege=1;
729 printf(
"...: new setpoint: %d\n", pos);
733 print(
"...: the previous setpoint has been assumed and no additional setpoint may be accepted");
740 print(
"...: drive state is not in operation enabled");
757 if((Time()-time) > 2)
759 print(
"...: no setpoint acknowledge received");
760 setpointAcknowlege = 0;
773 if(setpointAcknowlege)
775 print(
"...: setpoint acknowleged");
800 printf(
"Bus Id %d, sdkDS402_PPM_PosAbsStart:\n", busId);
821 printf(
"Bus Id %d, sdkDS402_PPM_PosRelStart:\n", busId);
856 long targetReached = 1;
858 printf(
"Bus Id %d, sdkDS402_PPM_WaitTargetReached:\n", busId);
862 if(timeout >= 0 && (Time() - time) > timeout)
865 printf(
"...: target position not reached within timeout (%d ms)\n", timeout);
870 print(
"...: target position reached");
873 return(targetReached);
890 printf(
"Bus Id %d, PVM: Set target velocity to %d\n", busId, targetVelocity);
909 printf(
"Bus Id %d, sdkDS402_PPM_CvelStart: \n", busId);
914 printf(
"...: drive state is not in operation enabled\n");
923 printf(
"...: started\n");
938 printf(
"Bus Id %d, sdkDS402_PPM_CvelStop:\n", busId);
945 printf(
"...: stopped\n");
979 long targetReached = 1;
981 printf(
"Bus Id %d, sdkDS402_PVM_WaitTargetReached:\n", busId);
985 if(timeout >= 0 && (Time() - time) > timeout)
988 printf(
"...: target velocity not reached within timeout (%d ms)\n", timeout);
993 print(
"...: target velocity reached");
996 return(targetReached);
#define DS402_SW_BIT_SWITCH_ON_DISABLED
void sdkDS402_Print_StatusWord(long busId)
Print the status word.
long sdkDS402_ReadStatusWord(long busId)
DS 402 State-Machine functions.
long sdkDS402_PVM_TargetReached(long busId)
Checks whether the target velocity has reached.
void sdkDS402_ResetFault(long busId)
Reset fault.
#define DS402_SW_BIT_TARGET_REACHED
#define DS402_SW_BIT_OPERATION_ENABLED
long sdkDS402_PPM_PosRelStart(long busId, long pos, long startImmediately)
Start relative positioning.
#define DS402_DRIVE_STATE_SWITCH_ON_DISABLED
#define DS402_MAX_PROFILE_VELOCITY
#define DS402_DRIVE_STATE_FAULT_REACTION_ACTIVE
void sdkDS402_SetProfileVelocity(long busId, long vel)
Set the profile velocity DS402_PROFILE_VELOCITY(0x6081)
#define DS402_TARGET_VELOCITY
#define DS402_DRIVE_STATE_QUICK_STOP_ACTIVE
#define DS402_SW_BIT_QUICK_STOP
long sdkDS402_GetActDriveState(long busId)
Get the actual drive state.
#define DS402_TRANSITION_SWITCH_ON
#define DS402_TARGET_POSITION
#define DS402_PROFILE_ACCELERATION
long sdkDS402_GetOpartionMode(long busId)
Get the mode of operation DS402_MODES_OF_OPERATION(0x6060)
#define DS402_MAX_ACCELERATION
#define DS402_CW_BIT_HALT
#define DS402_TRANSITION_DISABLE_VOLTAGE
#define DS402_MOTION_PROFILE_TYPE
long sdkDS402_TransitionToState(long busId, long newState)
Transition to another state.
#define DS402_SW_BIT_VOLTAGE_ENABLED
#define DS402_TRANSITION_FAULT_RESET
#define DS402_SW_BIT_REMOTE
#define DS402_CW_PPM_BIT_RELATIVE_MOVEMENT
#define DS402_CW_BIT_QUICK_STOP
void sdkDS402_SetProfileMovementParameter(long busId, long acc, long dec, long velocity)
Set quick stop deceleration DS402_QUICK_STOP_DECELERATION(0x6085)
#define DS402_SW_BIT_WARNING
#define DS402_MAX_MOTOR_SPEED
void sdkDS402_SetQuickStopDeceleration(long busId, long dec)
Set quick stop deceleration DS402_QUICK_STOP_DECELERATION(0x6085)
#define DS402_TRANSITION_ENABLE_OPERATION
long helperDS402_PPM_PosStart(long busId, long pos, long relative, long startImmediately)
Profile Position Mode functions.
void sdkDS402_Print_ControlWord(long busId)
Print the control word.
#define DS402_PROFILE_VELOCITY
void sdkDS402_SetMaxAcceleration(long busId, long acc)
Set the max acceleration DS402_MAX_ACCELERATION(0x60C5)
#define DS402_DRIVE_STATE_FAULT
long sdkDS402_PPM_WaitTargetReached(long busId, long timeout)
Wait until target is reachd.
void sdkDS402_SetMotionProfileType(long busId, long type)
Set the motion profile type DS402_MOTION_PROFILE_TYPE(0x6086)
void sdkDS402_Halt(long busId)
Stop the motor.
#define DS402_SW_BIT_SWITCHED_ON
#define DS402_CW_BIT_ENABLE_OPERATION
long sdkDS402_ReadControlWord(long busId)
Read control word.
#define DS402_SW_PVM_BIT_SPEED
#define DS402_SW_BIT_FAULT
#define DS402_CW_PPM_BIT_ENDLESS_MOVEMENT
long sdkDS402_PVM_WaitTargetReached(long busId, long timeout)
Wait until target is reachd.
#define DS402_PROFILE_DECELERATION
long sdkDS402_PVM_CvelStart(long busId)
Start continuous velocity (PVM)
long sdkDS402_PPM_PosAbsStart(long busId, long pos, long startImmediately)
Start absolute positioning.
#define DS402_PPM_ABSOLUTE
long helperDS402_ExecuteTransition(long busId, long transition)
Execute a state transition.
#define DS402_MODES_OF_OPERATION
#define DS402_SW_BIT_INTERNAL_LIMIT
#define DS402_TRANSITION_DISABLE_OPERATION
#define DS402_DRIVE_STATE_OPERATION_ENABLED
#define DS402_DRIVE_STATE_NOT_READY_TO_SWITCH_ON
Drive States and Transitions - CiA 402 State Machine.
#define DS402_DRIVE_STATE_READY_TO_SWITCH_ON
void sdkDS402_PrintState(long state)
Print the name of certain drive state.
void sdkDS402_SetProfileDeceleration(long busId, long dec)
Set the profile deceleration DS402_PROFILE_DECELERATION(0x6084)
void sdkDS402_SetMaxMotorSpeed(long busId, long vel)
Set the max profile velocity DS402_MAX_MOTOR_SPEED(0x6080)
Declaration of the DS402 StateMachineFunction.
void sdkDS402_SetProfileAcceleration(long busId, long acc)
Profile Mode settings.
#define DS402_CW_BIT_ENABLE_VOLTAGE
#define DS402_SW_BIT_READY_TO_SWITCH_ON
#define DS402_SW_PPM_BIT_FOLLWING_ERROR
long sdkDS402_PPM_TargetReached(long busId)
Checks whether the target was reached.
#define DS402_QUICK_STOP_DECELERATION
void sdkDS402_QuickStop(long busId)
Execute quick stop.
#define DS402_CW_BIT_SWITCH_ON
#define DS402_SW_PPM_BIT_SETPOINT_ACK
#define DS402_CW_PPM_BIT_NEW_SETPOINT
#define DS402_CONTROLWORD
void sdkDS402_SetOpartionMode(long busId, long operationMode)
Profile Mode functions.
#define DS402_TRANSITION_QUICK_STOP
#define DS402_DRIVE_STATE_SWITCHED_ON
#define DS402_CW_PPM_BIT_CHANGE_IMMEDIATELY
#define DS402_PPM_RELATIVE
long sdkDS402_WaitTransitionToState(long busId, long targetState, long timeout)
Wait transition to another state.
void sdkDS402_SetMaxProfileVelocity(long busId, long vel)
Set the max profile velocity DS402_MAX_PROFILE_VELOCITY(0x607F)
void sdkDS402_PVM_SetTargetVelocity(long busId, long targetVelocity)
Profile Velocity Mode functions.
void sdkDS402_WriteControlWord(long busId, long value)
Write control word.
#define DS402_TRANSITION_SHUTDOWN
long sdkDS402_PVM_CvelStop(long busId)
Stop continuous velocity (PVM)
Data Sheets |
Released Software |
Software Manuals |
Hardware Manuals |
Maxon Shop
Maxon Support Center