For references here is my code to change from X,Y axes to X,Y,A,B axes

`------------4 Axis Mapping-----------`

inst = mc.mcGetInstance()

local xAxis = 0

local yAxis = 1

local aAxis = 3

local bAxis = 4

xAxis = tonumber(xAxis)

yAxis = tonumber(yAxis)

aAxis = tonumber(aAxis)

bAxis = tonumber(bAxis)

--motorId, rc = mc.mcAxisGetMotorId(number mInst, number axis, number childId)

local motorIdX, rc = mc.mcAxisGetMotorId(inst, 0, 0);

local motorIdY, rc = mc.mcAxisGetMotorId(inst, 1, 0);

local motorIdA, rc = mc.mcAxisGetMotorId(inst, 0, 1);

local motorIdB, rc = mc.mcAxisGetMotorId(inst, 1, 1);

--rc = mc.mcAxisUnmapMotor(number mInst, number axisId, number motor)

mc.mcAxisUnmapMotor(inst, 0, motorIdX) --Unmap from X axis

mc.mcAxisUnmapMotor(inst, 1, motorIdY) --Unmap from Y axis

mc.mcAxisUnmapMotor(inst, 0, motorIdA) --Unmap motor 2 from X axis

mc.mcAxisUnmapMotor(inst, 1, motorIdB) --Unmap motor 3 from Y axis

--rc = mc.mcAxisMapMotor(number mInst, number axisId, number motorId)

mc.mcAxisMapMotor(inst, 0, 0) --Map motor 0 to X axis

mc.mcAxisMapMotor(inst, 1, 1) --Map motor 1 to Y axis

mc.mcAxisMapMotor(inst, 3, 2) --Map Motor 2 to A axis

mc.mcAxisMapMotor(inst, 4, 3) --Map motor 3 to B axis

--rc = mc.mcAxisEnable(number mInst, number axisId, number enabled)

mc.mcAxisEnable(inst, 3, true) --Enable A axis

mc.mcAxisEnable(inst, 4, true) --Enable B axis

--rc = mc.mcProfileSave(number mInst)

mc.mcProfileSave(inst)

`-------------2 Axis Mapping-------------`

inst = mc.mcGetInstance()

local xAxis = 0

local yAxis = 1

local aAxis = 3

local bAxis = 4

xAxis = tonumber(xAxis)

yAxis = tonumber(yAxis)

aAxis = tonumber(aAxis)

bAxis = tonumber(bAxis)

--rc = mc.mcAxisUnmapMotor(number mInst, number axisId, number motor)

mc.mcAxisUnmapMotor(inst, xAxis, 0) --Unmap motor 0 from X axis

mc.mcAxisUnmapMotor(inst, yAxis, 1) --Unmap motor 1 from Y axis

mc.mcAxisUnmapMotor(inst, aAxis, 2) --Unmap motor 2 from A axis

mc.mcAxisUnmapMotor(inst, bAxis, 3) --Unmap motor 3 from B axis

--rc = mc.mcAxisMapMotor(number mInst, number axisId, number motorId)

mc.mcAxisMapMotor(inst, xAxis, 0) --Map motor 0 to X axis

mc.mcAxisMapMotor(inst, yAxis, 1) --Map motor 1 to Y axis

mc.mcAxisMapMotor(inst, xAxis, 2) --Map Motor 2 to X axis

mc.mcAxisMapMotor(inst, yAxis, 3) --Map motor 3 to Y axis

--rc = mc.mcAxisEnable(number mInst, number axisId, number enabled)

mc.mcAxisEnable(inst, aAxis, false) --Disable A axis

mc.mcAxisEnable(inst, bAxis, false) --Disable B axis

--rc = mc.mcProfileSave(number mInst)

mc.mcProfileSave(inst)