6.1 PlcAxis
INCON-M86/M86R have two PLC axes and two spindles that can be PLC axis, one of PLC axis is using if relatives LagError, cmdData0, cmdData1, Position, servoOn and posLoopOn were setting at plcOpen. A cmdFlag is using to send a command to NC and NC will clear it when done command.
For example:
First PLC axis is using, that program at plcOpen as following:
- plc.axisPmyServo.cmdFlag = PLC_AXIS_SET_PARA;
- plc.axisPmyServo.stsLagError = paPmyLagError; // set lag error
- plc.axisPmyServo.cmdData0 = paPmyGain; // loop gain
- plc.axisPmyServo.cmdData1 = paPmyAccDec; // Acceleration
- plc.axisPmyServo.stsPosition = paPmyPosition; // set position
- plc.axisPmyServo.state.servoOn = 1; // servo on
- plc.axisPmyServo.state.posLoopOn = 1; // loop control on
To move the PLC axis, set this axial movement mode (incremental, absolute), travel distance, and travel speed in PlcRun:
- plc.axisPmyServo.cmdFlag = PLCAXIS_CMD_REL_MOVE;
- plc.axisPmyServo.cmdData0 = rel_position;
- plc.axisPmyServo.cmdData1 = move_speed;
If you want to stop the axial movement during the movement of the PLC axis, the following commands can be issued in PlcRun to stop the movement of the PLC axis:
- plc.axisPmyServo.cmdFlag = PLCAXIS_CMD_STOP;
The below table shows out all commands that for PLC axis:
Command |
Value |
Description |
PLCAXIS_CMD_NONE |
0 |
Null or NC command finished |
PLCAXIS_CMD_STOP |
1 |
Stop current motion |
PLCAXIS_CMD_SET_PARA |
2 |
Set PLC axis parameter |
PLCAXIS_CMD_SET_STATE |
3 |
Set PLC axis state |
PLCAXIS_CMD_REL_MOVE |
4 |
PLC axis moves a distance |
PLCAXIS_CMD_ABS_MOVE |
5 |
PLC axis moves to absolute position |
PLCAXIS_CMD_JOG_POSITIVE |
6 |
PLC axis jog to positive direction |
PLCAXIS_CMD_JOG_NEGATIVE |
7 |
PLC axis jog to negative direction |
Each PLC axis has an ID to identify itself:
ID |
Value |
Description |
PLCAXIS_ID_NONE |
0 |
Null |
PLCAXIS_ID_PMY_SPINDLE |
1 |
Primary spindle |
PLCAXIS_ID_2ND_SPINDLE |
2 |
Sub spindle |
PLCAXIS_ID_PMY_SERVO |
3 |
First PLC axis |
PLCAXIS_ID_2ND_SERVO |
4 |
Second PLC axis |
The relevant signals of the positive and sub spindles and the two PLC axes are as follows:
Signal name |
Description |
plc.axisPmySpindle.cmdFlag |
Command for primary spindle |
plc.axisPmySpindle.cmdData0 |
Command data 0 for primary spindle |
plc.axisPmySpindle.cmdData1 |
Command data 1 for primary spindle |
plc.axisPmySpindle.state.inPosition |
Primary spindle in position |
plc.axisPmySpindle.state.servoOn |
Primary spindle servo on |
plc.axisPmySpindle.state.posLoopOn |
Primary spindle position loop on |
plc.axisPmySpindle.state.posLoopFail |
Primary spindle position loop fail |
plc.axisPmySpindle.state.jogPositive |
Primary spindle jog positive direction |
plc.axisPmySpindle.state.jogNegative |
Primary spindle jog negative direction |
plc.axisPmySpindle.state.reserved |
Reserved |
plc.axisPmySpindle.stsPosition |
Primary spindle current position |
plc.axisPmySpindle.stsLagError |
Primary spindle current lag error |
plc.axisPmySpindle.id |
Primary spindle ID |
plc.axisPmySpindle.encoder |
Primary spindle encoder current count |
plc.axisPmySpindle.da |
Primary spindle VCMD (DA) |
plc.axisPmySpindle.index |
Primary encoder index signal |
plc.axis2ndSpindle.cmdFlag |
Command for sub spindle |
plc.axis2ndSpindle.cmdData0 |
Command data 0 for sub spindle |
plc.axis2ndSpindle.cmdData1 |
Command data 1 for sub spindle |
plc.axis2ndSpindle.state.inPosition |
Sub spindle in position |
plc.axis2ndSpindle.state.servoOn |
Sub spindle servo on |
plc.axis2ndSpindle.state.posLoopOn |
Sub spindle position loop on |
plc.axis2ndSpindle.state.posLoopFail |
Sub spindle position loop fail |
plc.axis2ndSpindle.state.jogPositive |
Sub spindle jog positive direction |
plc.axis2ndSpindle.state.jogNegative |
Sub spindle jog negative direction |
plc.axis2ndSpindle.state.reserved |
Reserved |
plc.axis2ndSpindle.stsPosition |
Sub spindle current position |
plc.axis2ndSpindle.stsLagError |
Sub spindle current lag error |
plc.axis2ndSpindle.id |
Sub spindle ID |
plc.axis2ndSpindle.encoder |
Sub spindle encoder current count |
plc.axis2ndSpindle.da |
Sub spindle VCMD (DA) |
plc.axisPmyServo.cmdFlag |
Command for first PLC axis |
plc.axisPmyServo.cmdData0 |
Command data 0 for first PLC axis |
plc.axisPmyServo.cmdData1 |
Command data 1 for first PLC axis |
plc.axisPmyServo.state.inPosition |
First PLC axis in position |
plc.axisPmyServo.state.servoOn |
First PLC axis servo on |
plc.axisPmyServo.state.posLoopOn |
First PLC axis position loop on |
plc.axisPmyServo.state.posLoopFail |
First PLC axis position loop fail |
plc.axisPmyServo.state.jogPositive |
First PLC axis jog positive direction |
plc.axisPmyServo.state.jogNegative |
First PLC axis jog negative direction |
plc.axisPmyServo.stsPosition |
First PLC axis current position |
plc.axisPmyServo.stsLagError |
First PLC axis current lag error |
plc.axisPmyServo.id |
First PLC axis ID |
plc.axisPmyServo.encoder |
First PLC axis encoder current count |
plc.axisPmyServo.da |
First PLC axis VCMD (DA) |
plc.axisPmyServo.index |
First PLC axis encoder index signal |
plc.axis2ndServo.cmdFlag |
Command for second PLC axis |
plc.axis2ndServo.cmdData0 |
Command data 0 for second PLC axis |
plc.axis2ndServo.cmdData1 |
Command data 1 for second PLC axis |
plc.axis2ndServo.state.inPosition |
Second PLC axis in position |
plc.axis2ndServo.state.servoOn |
Second PLC axis servo on |
plc.axis2ndServo.state.posLoopOn |
Second PLC axis position loop on |
plc.axis2ndServo.state.posLoopFail |
Second PLC axis position loop fail |
plc.axis2ndServo.state.jogPositive |
Second PLC axis jog positive direction |
plc.axis2ndServo.state.jogNegative |
Second PLC axis jog negative direction |
plc.axis2ndServo.stsPosition |
Second PLC axis current position |
plc.axis2ndServo.stsLagError |
Second PLC axis current lag error |
plc.axis2ndServo.id |
Second PLC axis ID |
plc.axis2ndServo.encoder |
Second PLC axis encoder current count |
plc.axis2ndServo.da |
Second PLC axis VCMD (DA) |
plc.axis2ndServo.index |
Second PLC axis encoder index signal |
Note: |
There are many statements defined in plc.h, which are defined by the PLC program. Not all statements are listed in this manual, please refer to your plc.h. |