Welcome, Guest
Username: Password: Remember me

TOPIC: Setting up Profibus communication

Re:Setting up Profibus communication 16 years 2 months ago #142

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3176
  • Thank you received: 502
  • Karma: 133
You have to figure out from the Danfoss manual exacly how the input and output area looks. Then you describe the areas, first the input area with ChanAi, ChanIi and ChanDi objects, and then the output area with ChanAo, ChanIo and ChanDo objects. The position and the Representaition attribute of the channel defines the offset and size in the area. Lets say that the first item in the input area is a 16 bit word that you want to convert to a float. Then you place as first child to the module object, an ChanAi object and set Representation to Int16. If the next element is a 16 bit status word you choose a ChanIi with representation UInt16 etc.

If you have a bitmask in the area, you can choose to convert it with ChanDi/Do or ChanIi/Io. If you use ChanDi/Do you use the Bit representation, and you also has to set the bit number for each channel in the Number attribute. You only need to configure the bits you intend to use. If you use ChanIi/Io the mask will be converted to/from a Ii/Io signal which is an Int32. This can be converted to/from digital values with DtoMask and MaskToD.

Note also that you have to set ByteOrdering to big or little endian in the slave object, and float representation of there are any floats in the areas.

/Claes
The administrator has disabled public write access.

Re:Setting up Profibus communication 16 years 2 months ago #143

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3176
  • Thank you received: 502
  • Karma: 133
If you want an example you can look at ABB/ABB_ACS_PPO5. Here the channels are placed as internal attributes in the object, but the function is the same as if they were placed as children.

/Claes
The administrator has disabled public write access.

Re:Setting up Profibus communication 16 years 2 months ago #144

  • Ohl
  • Ohl's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 102
  • Karma: 3
Thanks!

That was easier than I thought, but I haven't been able to test it on the hardware yet.

Isn't the byte order set by the GSD-file? Anyway, that is easy to change.

Is it just to copy the Pb_DP_Slave tree if I would like to add more frequency converters of this kind?

Next step should be to add signals to the $PlantHier and connect them to the ChanAi objects etc, I guess.

/Ohl
The administrator has disabled public write access.

Re:Setting up Profibus communication 16 years 2 months ago #145

  • robert
  • robert's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 178
  • Karma: 7
Hello !

The byte ordering is not set by the gsd-file (it's not available in it!). You have to set it by yourself. It's OK to copy a slave tree if you have more of the same kind. Then just go on and connect the I/O's.

Good luck !

/Robert
The administrator has disabled public write access.

Re:Setting up Profibus communication 16 years 2 months ago #146

  • Ohl
  • Ohl's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 102
  • Karma: 3
Thank you!

I/O's are now connected and I have also connected the ThreadObject of the Pb_Profiboard to my PLC thread.

Another question that araises regards simulation. How can I simulate and test my code on the developing machine (a laptop) whitout the Profibus card installed?

/Ohl
The administrator has disabled public write access.

Re:Setting up Profibus communication 16 years 2 months ago #147

  • robert
  • robert's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 178
  • Karma: 7
There is no problem to simulate without the Profiboard. You don't even have to set the simulate-flag in the IOHandler-object. Just use the StoDi, StoAi, GetDo.....-objects in the simulation hierarchy in the PLC-editor to simulate the I/O.

/Robert
The administrator has disabled public write access.
Time to create page: 8.537 seconds