Author Topic: CAN communication with Siemens PLC  (Read 12026 times)

Offline Daan

  • PLUS+1 Developer
  • ***
  • Posts: 23
  • Karma: +1/-0
CAN communication with Siemens PLC
« on: May 15, 2023, 08:20:08 AM »
Good morning

I would like your help regarding CAN communication. For a project I use the Danfoss XL-104 as a slave and a Siemens ET200SP as a master with a CAN module connected to it. Via the CAN module, various analog signals are forwarded to the CAN connections of the XL-104. However, I don't know much about Danfoss and I don't really understand the CAN components in the danfoss program. I've watched the Danfoss video (https://www.youtube.com/watch?v=CwE74gq-mgQ) several times but I don't really understand what to connect from the input line to the CAN module. By this I mean reading out the data that must be connected to the CAN module, but also what I still have to place on the other connections to properly convert / transport the analogue signals from the Siemens plc. Is there a video or a document where I can refer to this information?

Thank you in advance!
Junior Mechanical Engineer

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +33/-0
Re: CAN communication with Siemens PLC
« Reply #1 on: May 15, 2023, 05:06:07 PM »
Are you pretty familiar with applying CAN on other platforms, or are you newer to CAN bus in general?  Depending on your answer it might be worth a phone call to your distributor to schedule a 30-45 minute discussion.
Controls Engineer
Hydra-Power Systems

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 220
  • Karma: +7/-0
Re: CAN communication with Siemens PLC
« Reply #2 on: May 15, 2023, 06:04:42 PM »
Hey Daan,

just curious why you need the siemens PLC since you got a "huge" Danfoss controller? will it be just to interface the HMI.

sounds like what you need is CANopen of course the danfoss controller can work that way just keep in mind that in such case you need to create all functions for CANopen -as a slave- using the Danfoss function blocks.

hope this gives a little help

regards


Offline Daan

  • PLUS+1 Developer
  • ***
  • Posts: 23
  • Karma: +1/-0
Re: CAN communication with Siemens PLC
« Reply #3 on: May 16, 2023, 09:43:51 AM »
Hey Tom and Pinias

I know how to communicate between 2 siemens CAN modules, but otherwise I have relatively little knowledge about this.

To answer your question Pinias, I use an XL-104 because I am making a hydraulic test bench on which many different types of valves, cylinders, installations can be tested. I need enough inputs and outputs for this. The more normal consumers are operated via the siemens plc and the more exotic consumers via the Danfoss controller.

Do you also mean that I need a separate CAN module for every consumer that is sent to the Danfoss controller via the siemens CAN module?

Thanks in advance for the quick response and all the help!
Junior Mechanical Engineer

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +33/-0
Re: CAN communication with Siemens PLC
« Reply #4 on: May 16, 2023, 06:04:12 PM »
The nice thing about PLCs, in my limited experience, is that any sort of fieldbus they use, like CAN, is usually integrated into the platform in such a way that you don't have to really learn any low level details of the communication.  That's especially the case if it's between modules of the same brand.  I'd guess that operating within the Siemens platform that almost all of the details about CAN communication like the CAN ID format and endianness is not required knowledge.

Mobile controllers seem to more often require you to learn more about the details of the communication.  I think you are going to have to spend some time reading some fundamental CAN bus application articles if you have not already.  There is a lot available out there fortunately.
Controls Engineer
Hydra-Power Systems

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 220
  • Karma: +7/-0
Re: CAN communication with Siemens PLC
« Reply #5 on: May 16, 2023, 07:33:16 PM »
Daan,

no, you do not need separate CAN module.

but let´s make clear this

The siemens PLC CAN port, what protocol works with exactly? from what I have seen most industrial PLC´s that work with CAN use CANopen so that you got a Master-slave communication.

so it sounds you are familiar with CANopen since you have communicated with 2 siemens PLC using the CAN protocol.

the Danfoss controller does not have a preoloaded mapping for the COB ID´s as per CAN open, you have to do that, you have to create all the CANopen functions by using the Danfoss Function blocks. that is what I am trying to say in case you are not aware of that.

hopefully I made myself clear
Regards  8)

Offline Daan

  • PLUS+1 Developer
  • ***
  • Posts: 23
  • Karma: +1/-0
Re: CAN communication with Siemens PLC
« Reply #6 on: May 17, 2023, 08:39:42 AM »
Good morning Tom and Pinias

If this is not too much work, could you recommend a good site where I can find these applications? I've been looking for a while but can't find the appropriate sites or documentation. Also on youtube I can't find much anymore besides the video of Danfoss itself. Maybe I overlooked this or I'm not typing the right search terms. If you'd rather not do this, I can understand. Everyone has work to do, of course.

To reply to you Pinias, I didn't write my previous post so clearly on reflection. It is for the siemens PLC (ET200SP) that I use a CAN module (6ES7 137-6EA00-0BA0). On the Danfoss controller I use the CAN ports that can be found on the controller itself. I think I already know the Danfoss function blocks you are talking about from the Danfoss video about CAN communication. However I'm still trying to figure out exactly how to hook these up though.

I'm going to use the siemens PLC as master and the Danfoss controller as slave.

If you need some more info that will make it easier for you to help me, I'd be happy to do so!

Thank you for all the responses, you are a great help!
Junior Mechanical Engineer

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 220
  • Karma: +7/-0
Re: CAN communication with Siemens PLC
« Reply #7 on: May 17, 2023, 05:27:25 PM »
Daan,

ok checking the datasheet for the siemens CAN module it works on CANopen

So on the danfoss side all what you need is to use the CANopen function blocks and create your CAN COB ID mapping.

the CANopen function blocks can be downloaded from the Danfoss Update center

and no, Danfoss does not have specific docummentation to work with CANopen, all what you can get is the manuals embedded on the CANopen Function blocks.

the atatched picture may give an idea of how to use the CANopen function blocks, other than that it is all what I can help out

Regards

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 220
  • Karma: +7/-0
Re: CAN communication with Siemens PLC
« Reply #8 on: May 17, 2023, 05:28:34 PM »
I forgot to mention, the picture atatched is using a display not a controller but still same idea to use to CANopen function blocks

Offline pinias

  • PLUS+1 Guru
  • *****
  • Posts: 220
  • Karma: +7/-0
Re: CAN communication with Siemens PLC
« Reply #9 on: May 17, 2023, 05:34:21 PM »
ok, I just saw it

as per Siemens CAN module tech specs it says it supports CAN 2.0A and CAN 2.0B.

if that is true I would rather work with CAN2.0A instead of CANopen, in such case, both are masters the controller and the Siemes PLC

 :o

Offline G30RG3

  • PLUS+1 Expert
  • ****
  • Posts: 75
  • Karma: +3/-0
Re: CAN communication with Siemens PLC
« Reply #10 on: May 17, 2023, 06:45:32 PM »
Hi Daan,

I expect you to be Dutch or Flemish, with a nickname like that...
So this:  https://www.canopen.nl/can might help a lot :)

Offline acmall

  • PLUS+1 Guru
  • *****
  • Posts: 201
  • Karma: +37/-1
Re: CAN communication with Siemens PLC
« Reply #11 on: May 18, 2023, 09:18:08 AM »
ok, I just saw it

as per Siemens CAN module tech specs it says it supports CAN 2.0A and CAN 2.0B.

if that is true I would rather work with CAN2.0A instead of CANopen, in such case, both are masters the controller and the Siemes PLC

 :o

There is a lot to learn about CAN and I have only scratched the surface but, be careful not to confuse CAN 2.0A or 2.0B which are CAN specifications with CAN Open (or J1939, etc.) which are higher level protocols.

Here is another site with some guides and info: -
https://www.csselectronics.com/pages/can-bus-intros-tutorials

Offline Daan

  • PLUS+1 Developer
  • ***
  • Posts: 23
  • Karma: +1/-0
Re: CAN communication with Siemens PLC
« Reply #12 on: May 22, 2023, 12:47:31 PM »
thank you all very much!

I'm going to dig a little deeper into everything you've given me. If I have any more questions I'll ask them here but for now I can move on.

Thanks!  ;D
Junior Mechanical Engineer

Offline Daan

  • PLUS+1 Developer
  • ***
  • Posts: 23
  • Karma: +1/-0
Re: CAN communication with Siemens PLC
« Reply #13 on: June 01, 2023, 01:26:54 PM »
Good afternoon everyone

After going through everything again, I already understand a bit more about CAN communication, for which I thank you.
But do any of you know the best way to set up the CAN communication?
By this I mean where I have to set something (for example the IDs) to read the data and identify/name it correctly so that both master and slave know what they are communicating about.
This is not really talked about in the Danfoss documents and videos as far as I have found.

I also have a question for you Pinias.
What exactly do you mean by CAN COB ID mapping and how do I do this?
I also wonder why you don't use a block like this one in the attachment.
Does this have a specific reason or is it more of a personal choice?

Thank you in advance!
« Last Edit: June 01, 2023, 02:03:17 PM by Daan »
Junior Mechanical Engineer