Hello Guest it is November 15, 2019, 04:45:56 AM

Author Topic: Trying to get DRO data to my PLC via TCP MODBUS-Help Please??  (Read 372 times)

0 Members and 1 Guest are viewing this topic.

Trying to get DRO data to my PLC via TCP MODBUS-Help Please??
« on: October 05, 2019, 02:51:58 PM »
Hi,

I am trying to get User Numerical Input DRO data into my PLC (AutoDir P2K).  When using the TCP test Modbus screen I am able to read & Write data to the PLC so I know I've got a good connection.  I have succussfully been able to get data from the PLC to display on a MACH screen.  So far so good right?  Well I am stuck and getting data FROM MACH back to my PLC.  I'm pretty sure that I am messing something up in the Brains function.  But what?  There are only like 65K combinations and after trying about 10K of them, I thought I'd reach out.

Attached are screen shots of my current brain.  ANY Help or suggestions are really very much appreciated!  THANKS IN ADVANCE!
Re: Trying to get DRO data to my PLC via TCP MODBUS-Help Please??
« Reply #1 on: October 22, 2019, 11:22:51 AM »
I had succesfully about this, my gear include a HMI Delta for display DRO connect to a S7-200 PLC, my method is separate the number on DRO and use 2 byte for save this, Modbus of Mach3 just have 16bit and thereforce i must use a formula for this in Brain.

But it still have a problem with my formula is the second register save the value after the comma, ex: ,*********. Problem is the first charater after the comma is zero ex: ,0025   ,0233 ,...
My formula will give a wrong result with this type. In the photos i post have Z-axis is 5.0563 and my Formula will have 2 result is 5 and 563 and send to plc with last result is 5,563. This is a wrong number and i still find the way to solve this problem!
Re: Trying to get DRO data to my PLC via TCP MODBUS-Help Please??
« Reply #2 on: October 22, 2019, 11:24:28 AM »
i add my picture

Offline TPS

*
  •  1,406 1,406
    • View Profile
Re: Trying to get DRO data to my PLC via TCP MODBUS-Help Please??
« Reply #3 on: October 23, 2019, 03:41:16 AM »
it is not a Problem of your Formular, because it only seperates Digits before comma and after.
and because it it done in integer Registers there are no leading zeroes.


depending on the missing leading zeroes you have to put both seperated values togehter into a real
Register on the S7/200.

and then diplay the real value on MMI

i have added a example how i would do it.
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.