CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Fri Dec 06, 2019 8:52 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Tue Nov 15, 2016 2:17 pm 
Offline

Joined: Fri Jul 10, 2015 9:56 am
Posts: 8
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


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Tue Nov 15, 2016 7:58 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3559
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


Top
   
PostPosted: Tue Nov 15, 2016 9:51 pm 
Offline

Joined: Fri Jul 10, 2015 9:56 am
Posts: 8
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.


Top
   
PostPosted: Wed Nov 16, 2016 5:37 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3559
Hi,
I would add the global analogue Interrupt Register to the Startup SDO list,
See screenshot.
BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Wed Nov 16, 2016 2:45 pm 
Offline

Joined: Fri Jul 10, 2015 9:56 am
Posts: 8
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.


Top
   
PostPosted: Wed Nov 16, 2016 6:45 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3559
Hi,
which index do you mean.
You need to add a mapping and use the varibales in the POU's.

BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Wed Nov 16, 2016 8:20 pm 
Offline

Joined: Fri Jul 10, 2015 9:56 am
Posts: 8
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.


Top
   
PostPosted: Wed Dec 07, 2016 10:44 am 
Offline

Joined: Tue Mar 01, 2016 8:07 am
Posts: 14
Hello bmunsil,

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

Can you help me to start CAN on my project.

thks


Top
   
PostPosted: Fri Jan 06, 2017 4:32 pm 
Offline

Joined: Fri Jul 10, 2015 9:56 am
Posts: 8
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.


Top
   
PostPosted: Tue Jan 10, 2017 9:16 am 
Offline

Joined: Mon Oct 24, 2016 11:16 am
Posts: 2
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?


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Wed Feb 01, 2017 6:45 pm 
Offline

Joined: Fri Jul 10, 2015 9:56 am
Posts: 8
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.


Top
   
PostPosted: Fri Feb 10, 2017 5:01 pm 
Offline

Joined: Mon Oct 24, 2016 11:16 am
Posts: 2
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 12 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited