CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

CANBUS PDO I/O Mapping problem
https://forum.codesys.com/viewtopic.php?f=21&t=7351
Page 1 of 1

Author:  bmunsil [ Tue Nov 15, 2016 2:17 pm ]
Post subject:  CANBUS PDO I/O Mapping problem

Raspberry Pi 2 B
Codesys V3.5 SP6 Patch 4+
PiCAN V2

I am having a problem with some PDO mappings to a Beckhoff (BK5120) Remote I/O. It is currently configured with a KL3162 (2x analog input), KL1862 (16 digital input), KL2872 (16 digital output) cards. I am having a problem getting the PDO setup correctly to make the IO functional. With my current configuration only 8 of the digital inputs, 8 of the digital outputs work, the analog is not functioning. When I check the CANopen I/O Mapping tab all of the nonworking digital I/O are greyed out but the analog I/O shows as if it should work but its state never changes. I know that everything actually works it just doesn't respond in Codesys. I have the KS2000 Beckhoff software for monitoring the unit directly form the port on the BK5120 bus coupler. I can apply a AA battery to the analog input and see analog levels get measured correctly.

Please let me know if anyone can help me understand what I am doing wrong. I have tried multiple configurations including making sure the PDO is full, but I am open to ANY suggestions as this is for my own personal learning.


Attachment:
PiCAN_PDO_configuration.JPG

Author:  Edwin Schwellinger [ Tue Nov 15, 2016 7:58 pm ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

Hi,
i have two remarks:
1.For these analog terminals do you enable the Interrupt Register (by SDO) otherwise no values come out of these terminals.
2. CODESYS only update the values if they are mapped and used in the POU's.

BR
Edwin

Author:  bmunsil [ Tue Nov 15, 2016 9:51 pm ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

Edwin Schwellinger wrote:
Hi,
i have two remarks:
1.For these analog terminals do you enable the Interrupt Register (by SDO) otherwise no values come out of these terminals.
2. CODESYS only update the values if they are mapped and used in the POU's.

BR
Edwin


yes they are mapped and used. the analog signals show up as if they are ready but they never update. I did have this working at one point but I lost my configuration and have not been able to recreate what worked. as for the interrupt register, I have nothing but default set.

UPDATE: ok I apparently didn't have the higher 8 inputs and outputs being used. they are now working. the analog is still not functioning. thank you for your time.

Author:  Edwin Schwellinger [ Wed Nov 16, 2016 5:37 am ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

Hi,
I would add the global analogue Interrupt Register to the Startup SDO list,
See screenshot.
BR
Edwin

Author:  bmunsil [ Wed Nov 16, 2016 2:45 pm ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

thanks for the quick reply. adding the Analogue Input global interrupt enable worked. I have one question, do you need to set an index for each of the analog inputs? or will this handle all of the analog inputs? I apologize for my lack of knowledge on PDO/SDO, I am using Codesys as my learning platform.

Author:  Edwin Schwellinger [ Wed Nov 16, 2016 6:45 pm ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

Hi,
which index do you mean.
You need to add a mapping and use the varibales in the POU's.

BR
Edwin

Author:  bmunsil [ Wed Nov 16, 2016 8:20 pm ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

Edwin Schwellinger wrote:
Hi,
which index do you mean.
You need to add a mapping and use the varibales in the POU's.

BR
Edwin



no, I answered my own question. I wasn't sure if I needed to set an SDO analog interrupt for each of the analog inputs or not but after some testing I know that I do not. Thanks for your time. Everything is working as expected.

Author:  lemaitre [ Wed Dec 07, 2016 10:44 am ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

Hello bmunsil,

Seeing project is the same as me regarding CAN.
RPI3+PICAN.

Can you help me to start CAN on my project.

thks

Author:  bmunsil [ Fri Jan 06, 2017 4:32 pm ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

I am currently using a Rpi2 + PiCan I would more than welcome helping you get started. to be honest there is a really good post that explains the methods that are used to get socket can compiled into the kernel. I do have an image of a working version that I would be willing to send you if you so choose.

Author:  jmrodriguez [ Tue Jan 10, 2017 9:16 am ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

bmunsil wrote:
I am currently using a Rpi2 + PiCan I would more than welcome helping you get started. to be honest there is a really good post that explains the methods that are used to get socket can compiled into the kernel. I do have an image of a working version that I would be willing to send you if you so choose.


Hello bmunsil.

I'm trying to have communication CAN between Codesys and my Raspberry Pi 3 with the instruction of this forum viewtopic.php?t=5611 but at the end my Can doesn't work. I think it could be because when I use the instruction 'modprobe spi-config...' it says “modprobe:FATAL: Module spi-config not found”.

Could you help me please?

Author:  bmunsil [ Wed Feb 01, 2017 6:45 pm ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

jmrodriguez wrote:
bmunsil wrote:
I am currently using a Rpi2 + PiCan I would more than welcome helping you get started. to be honest there is a really good post that explains the methods that are used to get socket can compiled into the kernel. I do have an image of a working version that I would be willing to send you if you so choose.


Hello bmunsil.

I'm trying to have communication CAN between Codesys and my Raspberry Pi 3 with the instruction of this forum viewtopic.php?t=5611 but at the end my Can doesn't work. I think it could be because when I use the instruction 'modprobe spi-config...' it says “modprobe:FATAL: Module spi-config not found”.

Could you help me please?


could you extract and make an image out of what you are using? I would be able to better help if I can see what and how you have it configured.

Author:  jmrodriguez [ Fri Feb 10, 2017 5:01 pm ]
Post subject:  Re: CANBUS PDO I/O Mapping problem

bmunsil wrote:
jmrodriguez wrote:
bmunsil wrote:
I am currently using a Rpi2 + PiCan I would more than welcome helping you get started. to be honest there is a really good post that explains the methods that are used to get socket can compiled into the kernel. I do have an image of a working version that I would be willing to send you if you so choose.


Hello bmunsil.

I'm trying to have communication CAN between Codesys and my Raspberry Pi 3 with the instruction of this forum viewtopic.php?t=5611 but at the end my Can doesn't work. I think it could be because when I use the instruction 'modprobe spi-config...' it says “modprobe:FATAL: Module spi-config not found”.

Could you help me please?


could you extract and make an image out of what you are using? I would be able to better help if I can see what and how you have it configured.


Hi bmunsil.

The problem is solved now, it was because of the kernel version.

Thank you so much.
Best regards.

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/