I am interfacing some CAN joysticks from OEM Controls to an IFM0200 PLC.
Could anyone give me an example of how to setup the RPDO's for these on the controller? I am currently using direct writes via CAN to SDO's for data transfer between a PC display device and the PLC with good success, but I am lost when it comes to the PDO setup.
Thanks
Bill Eckard
Durango, CO USA
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hope the cranes are doing well. Does the OEM joystick have an EDS file? Are you using EDS files by having the CR0200 as a CANopen master? Do you have the specification of how OEM is transmitting the PDO data? If you have the PDO data map I can create an eds file for you. All PDO are received via the eds file (Handled by CoDeSys CANopen stack ) unless you specifically use the CAN1_RECEIVE FB. Your message is a little misleading. Which device is expecting to receive these PDO's, the windows box or PLC? It just isn't clear. If you are using an eds file in the CR0200 the PDO data is already mapped to IO address in the PLC configuration. Maybe you can expand on the subject.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Great to hear from you, and I appreciate your help with this.
There are 3 joy sticks two are single function (up/down) and the third has both left - right and up - down.
The IFM 0200 is actually programmed as 2 FM 0020 units and control a crane ( the one you saw in Las Vegas) with one side of the unit controlling the Hoist 1 and Hoist 2 and the other side controlling Swing and Boom.
The system is currently working with analog sticks but we want to use the CAN bus sticks.
A PC unit is configured a the CAN master using a USB to CAN compact hardware from IXXACT. V 3.1 software. The IFM units are slaves.
Currently, I do SDO writes to the IFM units for data exchange.
The OEM joy sticks constantly transmits PDO infao about every 25 ms.
Using the IXXACT drivers I get good info doing a readPDO() function and waiting for the call back then reading the PDO buffers.
I just can't seem to find a similar function block in CoDeSys... I am sure that it is there...... ha.
Thanks for any help
Bill
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes the function you are looking for is the CAN1_RECIEVE FB. Set this to the COB-ID of the data you want to receive from the joystick. The function block will tell you that new data is received and will present the data in an array[0..7] of bytes. So that should be real easy. You just have to initialize it once at start up so that CoDeSys is aware that it needs to receive this data as well and pass it to the application.
Example: Joystick node ID = 4
COBID = 180 + 4 = 184xh for the RX FB.
If the data of the joystick is say a word in length then remeber that the low order byte of the word will be in array[0] and the high order byte will be in array[1].
I am interfacing some CAN joysticks from OEM Controls to an IFM0200 PLC.
Could anyone give me an example of how to setup the RPDO's for these on the controller? I am currently using direct writes via CAN to SDO's for data transfer between a PC display device and the PLC with good success, but I am lost when it comes to the PDO setup.
Thanks
Bill Eckard
Durango, CO USA
Hello Bill,
Hope the cranes are doing well. Does the OEM joystick have an EDS file? Are you using EDS files by having the CR0200 as a CANopen master? Do you have the specification of how OEM is transmitting the PDO data? If you have the PDO data map I can create an eds file for you. All PDO are received via the eds file (Handled by CoDeSys CANopen stack ) unless you specifically use the CAN1_RECEIVE FB. Your message is a little misleading. Which device is expecting to receive these PDO's, the windows box or PLC? It just isn't clear. If you are using an eds file in the CR0200 the PDO data is already mapped to IO address in the PLC configuration. Maybe you can expand on the subject.
Steve,
Great to hear from you, and I appreciate your help with this.
There are 3 joy sticks two are single function (up/down) and the third has both left - right and up - down.
The IFM 0200 is actually programmed as 2 FM 0020 units and control a crane ( the one you saw in Las Vegas) with one side of the unit controlling the Hoist 1 and Hoist 2 and the other side controlling Swing and Boom.
The system is currently working with analog sticks but we want to use the CAN bus sticks.
A PC unit is configured a the CAN master using a USB to CAN compact hardware from IXXACT. V 3.1 software. The IFM units are slaves.
Currently, I do SDO writes to the IFM units for data exchange.
The OEM joy sticks constantly transmits PDO infao about every 25 ms.
Using the IXXACT drivers I get good info doing a readPDO() function and waiting for the call back then reading the PDO buffers.
I just can't seem to find a similar function block in CoDeSys... I am sure that it is there...... ha.
Thanks for any help
Bill
Yes the function you are looking for is the CAN1_RECIEVE FB. Set this to the COB-ID of the data you want to receive from the joystick. The function block will tell you that new data is received and will present the data in an array[0..7] of bytes. So that should be real easy. You just have to initialize it once at start up so that CoDeSys is aware that it needs to receive this data as well and pass it to the application.
Example: Joystick node ID = 4
COBID = 180 + 4 = 184xh for the RX FB.
If the data of the joystick is say a word in length then remeber that the low order byte of the word will be in array[0] and the high order byte will be in array[1].
Related
Talk.ru: 1
Once again you come through with the right answer... Thanks alot.
Bill Eckard