Codesys v3.5 sp20+(32bit)
I hope to power up the specified axis through the following code,It worked.
PROGRAM PowerupTest
VAR
MC_Power_0: MC_Power;
Axises:ARRAY[0..5] OF SM3_Drive_ETC_DS402_CyclicSync.AXIS_REF_ETC_DS402_CS;
END_VAR
MC_Power_0(
Axis:=Axis0,
Enable:=1 ,
bRegulatorOn:=1 ,
bDriveStart:=1 ,
Status=> ,
bRegulatorRealState=> ,
bDriveStartRealState=> ,
Busy=> ,
Error=> ,
ErrorID=>
);
Now, to change it a little bit, I save Axis0 into an array first, and then pass the elements of the array into the MC_Power function block.
It doesn’t work properly anymore.
Axises[0]:=Axis0;
MC_Power_0(
Axis:=Axises[0], //Changed here
Enable:=1 ,
bRegulatorOn:=1 ,
bDriveStart:=1 ,
Status=> ,
bRegulatorRealState=> ,
bDriveStartRealState=> ,
Busy=> ,
Error=> ,
ErrorID=>
);
Could you tell me the possible reason?
I hope I can access all axes as an array.
Thank you.