Author Topic: Combine DM values to create one Modbus word  (Read 6446 times)

Petty_boy

  • Jr. Member
  • **
  • Posts: 53
  • I'm a llama!
    • View Profile
Combine DM values to create one Modbus word
« on: May 13, 2009, 04:11:21 PM »
Hi,

I'm using quite a few DM's to store a single value of 1 or 0,  my modbus master reads these DM's according to the standard mapping.

Is it possible to combine these DM's to form one 16 bit word each bit representing one of the DM's.

I'm working on a project where I need to get as much data from each PLC as simply and quickly as possible.  Ideally,  I would like to reduce my modbus word list from 100 words down to 7 (100 / 16) words with the DM values stored as a binary or decimal value.

last post tonight I promise!

Cheers.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Combine DM values to create one Modbus word
« Reply #1 on: May 13, 2009, 09:33:39 PM »
You can use ladder logic to turn on internal relays 1 to 16 whenever there is an alarm event. You can then read the modbus mapping of the RELAY[1] variable which lets you read 16 bit in a single command.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Petty_boy

  • Jr. Member
  • **
  • Posts: 53
  • I'm a llama!
    • View Profile
Re:Combine DM values to create one Modbus word
« Reply #2 on: May 14, 2009, 02:32:40 AM »
OK,

That makes sense.  Are the 32 bit variables A - Z mapped? I cant see them in the modbus section of the manual?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Combine DM values to create one Modbus word
« Reply #3 on: May 14, 2009, 04:03:19 PM »
32-bit variables are not mapped to MODBUS space, but you can copy them to the two 16-bit variable space (using GETHIGH16 for the upper 16-bit) and then they become mapped to the MODBUS space.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS