Regarding CAN error on M340 Modicon PLC


Thread Starter


We are testing our code using the Modicon M340 PLC the canopen module is P342030. The CANopen module is continuously going in to error state and the PLC is not coming in to the operational state.

We are using shielded cable, where the shield is properly grounded . We are not working in conditions where there are any big noise generation sources. Even then the PLC canopen module is going in to the CAN Err i.e. the CAN Err led is continuosly 'ON' .

So we made a change in the PLC code to bring the PLC in to operational state. We check the CAN status bit CAN_STS, if it is 16#90 (90 hex) then we bring the CAN in to the operational state by writing 0x20 to %QW0.0.2.0 (as mentioned in the modicon M340 manual). Along with this i have incremented one DINT counter in the if(16#90) loop and observed the variable in the unityPro software animation window, now it is seen that the variable is incrementing to 1000 within 60 seconds, which means the error condition is occurring again and again, this was not the case earlier.

After this change we were able to test our hardware with modicon plc for 5-6 days, but suddenly since yesterday the modicon plc is continuously going in to CAN_ERR ,even if we bring the PLC in to operational mode as mentioned above the PLC enters CAN_ERR immediately after that.

The PLC is going in to CAN_ERR even if there is no CAN bus connected to its DB9 connector.
This was not observed earlier.And thus the PLC is not in to the operational state.(Please note that we are not working in any noise prone area, and the PLC was working earlier. Now the PLC is going in to Error and not transmitting any byte on the CAN bus)

Does any one have any clue what has gone wrong.
Can some one please guide me through this issue.

Thanks in advance