Author Topic: modbus function code-3  (Read 12987 times)

Raja

  • Guest
modbus function code-3
« on: November 08, 2004, 11:31:01 PM »
Hi
I have been getting problem to read the flowmeter(emerson-micro motion R-series) through modbus.Pls help who across this area.
I am using Tri-plc T100MD+ to read the flow meter upto 16 bit should not be a problem,above 16 bit cannot able to get the flow meter value.
The micro motion modbus mapping address - floating point register pair starting from 2 0249 0250 to 0265 0266.
I tested with Allen bradley and Yokogawa  PLC working well with fuction code-3 above register pairs.I have to change tri-plc one of the above because of this problem.
Pls advise anybody come across.Thanking you.
Best regards,
Raja.


support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:modbus function code-3
« Reply #1 on: November 11, 2004, 09:55:29 PM »
The T100MD+ PLCs do not support floating point variable and there isn't simple means of reading floating point variable.  However, 32-bit data can be read as two 16-bit addresses provided they are mapped into the holding register area (4xxxx).  We could also use TBASIC to write a special function 04 routine in order to read from "input registers" address 3xxxx.

We did review a copy of the MODBUS table for Emerson Micro motion flowmeter that you provided to our distributor but it was not clear what address these floating point variable maps to. The manual mention address 2xxxxx but as far as we understand, MODBUS "holding registers" map to address 4xxxxx and MODBUS so called "input registers" map to address 2xxxx. Modicon did not define what function can be used to read from address 2xxxx.

When you said you managed to read these addresses using Allen Bradley, what MODBUS function number did you use to read the address? Is it function 03 and 04? If so, what offset address did you use to read say register 20002 and 20003?
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Raja

  • Guest
Re:modbus function code-3
« Reply #2 on: November 11, 2004, 11:23:18 PM »
Hi,
I think my explanation not enough for your analysis. According to the emerson flow meter manual holding register(4 xxxx) data's not sutable for our data process.

The input register(3 xxxx)is a integer data's upto 65535, the tri-plc T100MD+  working well upto 65535.The holding and input register's not suitable because our data processing above 16-bit.

Regarding to our data processing the floating-point register pairs only possible(page-7,modbus mapping for micro motion transmitter).The micromotin flow meter based on ieee754 standard.The modbus mapping maual i pass already to your distributer.

For exaple
=======
if you want to read the floating-point register pair  (2 0259 0260) data by plc ,have to use function code-3,modbus address 0258(always-1 in which address you want to read) good enough to read the data.under the same format the Allen bradley,yokogawa plc i tested working well.

you mention 20002 and 20003 address,such address not in emerson address mapping.The above you mentioned is  Input register 3 0002 and 3 0003 read by function code-4,the data upto 65535(16-bit).

regards this issue what ever i had a problem with tri-plc,the same in allen bradley &yokogawa but they have option to choose fuction code what you want,in tri-plc i think donot have such option.please correct me if i donot understand fully about tri-plc regarding this issue.
thank u.
 Raja.



 

Raja

  • Guest
Re:modbus function code-3
« Reply #3 on: November 16, 2004, 07:16:36 PM »
 we are waiting for your reply,please advise me to slove this issue.Do you need more detail for your understanding please feel free to discuss.thank you.
Raja.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:modbus function code-3
« Reply #4 on: November 16, 2004, 09:11:30 PM »
What function code did you use on AB to successfully to read register you want to read?

T100MD+ PLC uses only the function code 03 to implement the READMODBUS and READMB2 commands. According to your description above, function code 03 appears to be the correct code to use for reading those registers.  Since these floating point registers are 32-bit in size they have to be read in two successive words using the READMB2 command. I believe our distributor  had worked with you  to extract data from those locations,  but the data returned from the flowmeter could not be deciphered into meaningful mantissa and exponent terms according to IEEE 32-bit floating point format.  Since the PLC do not handle floating point data there is not very much we can do about it.

If other function code need to be used to read these registers, then You could also write your own function code handler using TBASIC OUTCOMM, INCOMM and CRC16. An example for creating your own function code 04 can be found from the following link:

http://www.tri-plc.com/yabbse/index.php?board=2;action=display;threadid=298

If we know what function code can be used to read these registers correctly we could create a TBASIC custom function to generate the function code to access the register properly.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS