News:

  • June 08, 2026, 01:12:26 AM

Login with username, password and session length

Author Topic: Modbus to Peristaltic Pump  (Read 25937 times)

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Re: Modbus to Peristaltic Pump
« Reply #15 on: June 22, 2021, 09:05:05 PM »
Here is some weird stuff for you.    My Pump is set on 485 and the plc is set on 232.   I'm getting numbers back,  I'm not faulting anymore either.    But the numbers don't make sense.  I'm assuming since I'm using 2 different protocols.  The register 1000 should be giving me back a 1 for YZ251X.  The Register 1007 should be returning 1.00. If I swap the data to a real, it gives me 8.538E-41.

I know I'm mixing 2 protocols.  But when I change the PLC back to rs485 it immediately faults out.   I get a DST2. In the system info it tells me, operation timed out in MRX @00000BE0
Bizarre. Perhaps the modes are swapped on your device? Either that, or there is a fundamental grounding issue (bias) between the PLC and the device. Are you sure they are on the same grounds with no loops or daisy-chaining of the grounds?

Regarding the values received, assuming they are correctly represented, are you sure the real number that is returned is IEEE 754 (32-bit) format? There are other real number formats (e.g. IEEE half-precision, bfloat16, etc). Or perhaps the bytes or words or both are swapped? For example, if the words were swapped:

0x3f800000 = 1.0
0x00003f80 = 2.27795e-41

0x0000ee01 = 8.538e-41
0xee010000 = -9.98089e+27

I swapped wires and ran through every random wiring and programming configuration for setting the Modbus.   It seems to read well on the 232 settings.   I'm still not sure what it is reading.

Currently, I have address 1001 reading -6144 if I put it in a signed Dword format.   If I put it in a word format it is 59392.   This is supposed to be reading 24.

I have 1004 reading 60160 as an unsigned word,  as a signed dword it is -5376, and as a real (the data type on the pump paperwork says its in) is 8.430E-41  It is supposed to read 29.00.

Does any of that make any sense?




MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Re: Modbus to Peristaltic Pump
« Reply #16 on: June 22, 2021, 10:30:32 PM »
I just confirmed that it is IEEE 754 format

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Modbus to Peristaltic Pump
« Reply #17 on: June 28, 2021, 02:12:23 PM »
If the values are floating point, you need to be reading two registers (32-bits) per value.   You appear to be reading only 16, plus you're trying to read both even and odd numbered registers, which shouldn't be the case if they've got stuff encoded in 32 bit floating point.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Modbus to Peristaltic Pump
« Reply #18 on: June 28, 2021, 02:13:59 PM »
Can you post a copy of the pump mfgr's comms manual, or a link?
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Re: Modbus to Peristaltic Pump
« Reply #19 on: June 28, 2021, 02:38:35 PM »
https://www.createflow.cz/user/related_files/manu__l_laboratorn_____epadlo_labv_create_flow.pdf

https://drifton.dk/upload_dir/shop/slangepumper/manuals/V-Series-MODBUS-Protocol.pdf

Here is the instruction.  Thanks for you help.   I have tried using the publish and the other one associated with that.  Sorry, I don't have access to it. I have been getting in a MHR value of -6144. Same value as the original one I posted on.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Modbus to Peristaltic Pump
« Reply #20 on: June 28, 2021, 03:29:04 PM »
OK, notice a few things.

1)  They're mixing floating point values with INTs, but when a value is floating point, it does take 4 bytes or 2 words like I mentioned in the other post.  You'll have to read what BRX will see as two consecutive registers, then view them as a real, like V0:R, or use SUBSCRIB or PUBLISH or whatever.   

2)  It looks as if all those registers are for you to write settings, although since they're set up as holding registers, you can probably read as well as write, and perhaps if the pump has a setup keypad or something, and those values are input there, you can read them from the PLC.   But, if they're intended for writes, the pump may not honor reads, slight possibility.   I don't see any real time monitoring type data, at least with the labels described.   Note the upper table on page 3 is labeled "Basic Parameters Setting" and FN 2 says "When working mode is dispensing, set up register 1002 1004 invalid.", which makes those registers sound like setpoints.

3) Their word and byte orders appear to be normal.   (0x426b3333 == 58.8; Page 6 Item 3)
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Re: Modbus to Peristaltic Pump
« Reply #21 on: June 28, 2021, 04:20:27 PM »
I appreciate that. I will see what it will read later tonight.
My other problem is I'm not 100% sure it's connected correctly. Or if their modbus is working properly.  It can only get communication when my plc is in 232 mode.  Everything is set up for 485. When I change  to 485 on the plc it fails and says it's not returning correct data.  Or it will time out.  I have tried swapping wires, and tried all 232,  nothing is working except in this mode.  Which is pump is 485 mode, 9600 b, and address 1.    Plc is in 232, 9600b, address 1, parity even.

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: Modbus to Peristaltic Pump
« Reply #22 on: June 28, 2021, 04:56:33 PM »
Which is pump is 485 mode, 9600 b, and address 1.    Plc is in 232, 9600b, address 1, parity even.

Tried different addresses? I mean, if on an RS-485 network, you most certainly do not want them to have the same address. And address technically makes no sense with RS-232.
There are two types of people in the world; those that can extrapolate from incomplete data sets.

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Re: Modbus to Peristaltic Pump
« Reply #23 on: June 28, 2021, 05:07:11 PM »
I apologize,  PLC is in rtu mode.  I'm not sure what it's address is in that mode.   Only the pump has an address of 1

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Re: Modbus to Peristaltic Pump
« Reply #24 on: June 28, 2021, 07:32:49 PM »
Attached is the response I get when I'm in 485 with the plc.  I can't write anything either.   I think it is coming from the pump from the pump