I am using the Second CAN bus on the CR0505 controller to connect to an extended Identifier (CAN B) bus.
I am programming in CoDeSys 2.3.9.6 and would like to know if it is possible to mask the entire ID so that the controller takes in all messages on the bus. I would also like to know if, after being masked, is it possible to then take the ID to use in the program. in effect I am trying to convert my CR0505 into a CAN analyser. is this possible? and how?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is not possible with IFM using CAN layer 2. If you have noticed the function block to receive on CAN Layer 2 has an INIT input which is only TRUE once at first PLC cycle. This INIT input is used to tell the underlying OS/CAN stack that it needs to pass this specific 29bit ID up to the CoDeSys program. You can only receive ID's with the FB you have defined in your application. Granted I have never gotten crazy and used like a 100 Layer 2 FB but I am not sure what the limitation is. Why would you ever want to receive all of them? What are you trying to accomplish (besides being a can analyzer)? If you tried to receive all of them with a PLC you know what will happen? Possible watchdog timeout and buffer over run. The amount of messages being received by your PLC will cause so many communication interrupts that you will never have time to do any processing on the data. Have you ever looked at the amount of data on an engine ECU J1939 buss? It's allot of data. Anyway typically there aren't that many different PGN's my guess is about 15-20 total. So it would be possible to configure your PLC to read each PGN. You will need to know which ones your engine supports. For me it was easier to look at it with a CAN analyzer look at which different PGN's the ECU is transmitting and look at the J1939 Standard to find out what data is of any use to my application. Let me know if I can help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Originally created by: Carmichael_keith
Hi,
I am using the Second CAN bus on the CR0505 controller to connect to an extended Identifier (CAN B) bus.
I am programming in CoDeSys 2.3.9.6 and would like to know if it is possible to mask the entire ID so that the controller takes in all messages on the bus. I would also like to know if, after being masked, is it possible to then take the ID to use in the program. in effect I am trying to convert my CR0505 into a CAN analyser. is this possible? and how?
It is really much better to have a separate tool such as this:
http://www.gridconnect.com/usbcanin.html
It also help to be able to recognize hi/lo byte swaps in your head
It is not possible with IFM using CAN layer 2. If you have noticed the function block to receive on CAN Layer 2 has an INIT input which is only TRUE once at first PLC cycle. This INIT input is used to tell the underlying OS/CAN stack that it needs to pass this specific 29bit ID up to the CoDeSys program. You can only receive ID's with the FB you have defined in your application. Granted I have never gotten crazy and used like a 100 Layer 2 FB but I am not sure what the limitation is. Why would you ever want to receive all of them? What are you trying to accomplish (besides being a can analyzer)? If you tried to receive all of them with a PLC you know what will happen? Possible watchdog timeout and buffer over run. The amount of messages being received by your PLC will cause so many communication interrupts that you will never have time to do any processing on the data. Have you ever looked at the amount of data on an engine ECU J1939 buss? It's allot of data. Anyway typically there aren't that many different PGN's my guess is about 15-20 total. So it would be possible to configure your PLC to read each PGN. You will need to know which ones your engine supports. For me it was easier to look at it with a CAN analyzer look at which different PGN's the ECU is transmitting and look at the J1939 Standard to find out what data is of any use to my application. Let me know if I can help.