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 Tue Feb 18, 2020 7:20 am

All times are UTC+01:00

Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Nov 25, 2019 10:41 am 

Joined: Fri Nov 22, 2019 10:48 am
Posts: 1
Hello there,

I'd really love to hear your opinion on the following problem.
We have a working CANopen System, it has a Master and several (other) Nodes.
There is a port which I can use to physically connect to the CAN-Bus.
Now, I want the Data of specific PDOs to be transferred to variables in the CODESYS programm. The PDOs are sent peridodically, so our PLC is just supposed to listen to commands that are sent on the Bus.

How can I create a programm, that let's our PLC act only as a CAN-Bus listening device?

It's crucial that it does not interfere with the existing system! I've made the mistake to initiate our PLC as a Master and added the existing nodes to it, which resultet in me overwriting existing parameters. That led to the system not working for a good amout of time and my bloodpressure rising above healthy levels, since that system is quite expensive :lol: :roll:

What will probably work is setting up our PLC as a slave containging only the desired rPDOs, but then it'll have to answer to heartbeats and stuff, which I want to avoid, since it loads the Bus unnecessarily.

Thanks for your help, really appreciate it!

PostPosted: Fri Dec 06, 2019 9:34 am 

Joined: Thu Dec 05, 2019 5:38 pm
Posts: 15
When you edit your CAN bus device in codesys, you can set op PDOs but there is also an entry called CANbus I/O mapping for the device.
Here you can map specific PDO variables to your own application-specific variables. But please remember to enable the update of the variables every cycle or so. So as long as you don't write anything and as long the devices are in operational state you will just be reading these variables.
You write that you don't want to interact with the device. That is not fully avoidable. For instance, when you configure the PDO you actually modify the initialization of the device. After all, the device will have to know what to send in the PDOs. In fact, quite a lot goes on during the initialization of the devices.
The CANopen manager can easily be configured to producing a heartbeat and if none of the device-node for some reason also is a heartbeat producer it would work right out of the box.

PostPosted: Fri Dec 06, 2019 5:06 pm 
Frequent User
Frequent User

Joined: Tue Dec 03, 2013 11:52 pm
Posts: 126
Hey @Daltech,
In the past I have used this project to help accomplish this.

This allows you to easily listen for those messages and process them how you would like to. I don't know how you could do it using the CANopen device manager.

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

All times are UTC+01:00

Who is online

Users browsing this forum: Andreas Kehrer and 4 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