Internet PLC Forum

General => Technical support => Topic started by: Petty_boy on May 13, 2009, 04:11:21 PM

Title: Combine DM values to create one Modbus word
Post by: Petty_boy 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.
Title: Re:Combine DM values to create one Modbus word
Post by: support 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.
Title: Re:Combine DM values to create one Modbus word
Post by: Petty_boy 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?
Title: Re:Combine DM values to create one Modbus word
Post by: support 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.