mkbloke
Member
OpenPCS in EPOS Studio "E: S3004: Multiple assignment of a variable/name" errors
Hi,
I'm doing some work on a Maxon Motors EPOS P 24/5 linked to an EPOS 24/5 via CAN bus.
I'm using EPOS Studio 3.0 rev. 1 and with that comes OpenPCS version 6.4.3.
Originally the code read a limit switch to stop two motors travelling in one direction, reverse the motors' direction and then read a limit switch to stop both motors travelling in the reverse direction.
I have modified it now so that each motor is stopped by its own limit switch in the reverse direction. The forward direction single limit switch still applies to both motors and causes them both to reverse however.
Since adding another branch I've been getting the "E: S3004: Multiple assignment of a variable/name" errors from the compiler.
Here is the code from the step that has the issue (this is in a branch after the reverse limit switch for motor 2 has been hit and detected):
By commenting out various bits I have found the problem area to be:
The problem seems to be that the error is generated for each of the fMoveVel2 lines in the IF statement (I can set oTransTravelOutStop2 separately without any errors).
I have the same code in another parallel branch which doesn't seem to have any compilation issues that is the same, except that everything is f*1, oTrans*1, etc. Note that the limit switch read in fReadDigital2 in the code fragment above is on Motor axis 1, however.
I'm a beginner to this and am trying to get some code together for a unit that is used in university research. The unit originally had code on the PLC, but after the unit was lent to researchers at another institution it came back without code on the PLC and nobody seems to have the original code!
Any help or ideas on resolving this would be much appreciated. I have searched on Google quite a bit, but there is very little in the way of open support for OpenPCS it would seem.
Thanks.
--
Cheers, Ian
Hi,
I'm doing some work on a Maxon Motors EPOS P 24/5 linked to an EPOS 24/5 via CAN bus.
I'm using EPOS Studio 3.0 rev. 1 and with that comes OpenPCS version 6.4.3.
Originally the code read a limit switch to stop two motors travelling in one direction, reverse the motors' direction and then read a limit switch to stop both motors travelling in the reverse direction.
I have modified it now so that each motor is stopped by its own limit switch in the reverse direction. The forward direction single limit switch still applies to both motors and causes them both to reverse however.
Since adding another branch I've been getting the "E: S3004: Multiple assignment of a variable/name" errors from the compiler.
Here is the code from the step that has the issue (this is in a branch after the reverse limit switch for motor 2 has been hit and detected):
Code:
oTransReadOutSw2 := FALSE;
oRead2 := FALSE;
oMoveVel2 := FALSE;
fReadDigital2(Axis := Motor1, Enable := oRead2, Purpose := M2OutLimitSw);
fMoveVel2(Axis := Motor2, Execute := oMoveVel2, Acceleration := Accel, Deceleration := Decel, Velocity := Vel, Direction := DirOut);
IF NOT fMoveVel2.InVelocity AND NOT fMoveVel2.Error THEN
oTransTravelOutStop2 := TRUE;
END_IF;
Code:
IF NOT fMoveVel2.InVelocity AND NOT fMoveVel2.Error THEN
oTransTravelOutStop2 := TRUE;
END_IF;
I have the same code in another parallel branch which doesn't seem to have any compilation issues that is the same, except that everything is f*1, oTrans*1, etc. Note that the limit switch read in fReadDigital2 in the code fragment above is on Motor axis 1, however.
I'm a beginner to this and am trying to get some code together for a unit that is used in university research. The unit originally had code on the PLC, but after the unit was lent to researchers at another institution it came back without code on the PLC and nobody seems to have the original code!
Any help or ideas on resolving this would be much appreciated. I have searched on Google quite a bit, but there is very little in the way of open support for OpenPCS it would seem.
Thanks.
--
Cheers, Ian