Mach Discussion > Brains Development

Trying to get DRO data to my PLC via TCP MODBUS-Help Please??

(1/1)

Walter White:
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!

duongfx:
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!

duongfx:
i add my picture

TPS:
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.

Navigation

[0] Message Index

Go to full version