News:

  • June 08, 2026, 02:13:09 AM

Login with username, password and session length

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

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Modbus to Peristaltic Pump
« on: June 18, 2021, 09:48:30 PM »
Hello,

    I am programing a RS485 Shenchen parastaltic pump.  It's Chinese which is making this harder.   Its settings are set up as RS485 with a 9600 Baud, and 6 for the address.   Wire diagram in Wire pic attachment.   It is hooked up to my BRX PLC as follows: TX/D+ to  A+  &  RX/D- to  B-.

I am using the MWX instruction to turn the pump on. using the @intServModbusClient  Device.  Attached is the picture.   One problem is the pump doesn't tell me what kind of parity it takes.  I have run through all of my settings and tested it, so far the only thing that works or seems like it works is even parity. When I leave it on this setting it throws a DST38 3 and 6.   Exception response...

I've attached the Modbus functions from the pump manufacturer.
https://drifton.dk/upload_dir/shop/slangepumper/manuals/V-Series-MODBUS-Protocol.pdf  ------ page 3 for registers.

Could someone take a glance at my MWX attachment and verify that it is correct according to the documentation?   It either throws the DST38 code or tells me it's timed out.



https://www.createflow.cz/user/related_files/manu__l_laboratorn_____epadlo_labv_create_flow.pdf  -----------------Page 22 has the wiring directions


Thank you


ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Modbus to Peristaltic Pump
« Reply #1 on: June 20, 2021, 07:58:54 AM »
I would start with RS232, 485 can be a little finicky sometimes.  Get it to work with that first then use 485 if you need to connect more than 1 pump. 

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: Modbus to Peristaltic Pump
« Reply #2 on: June 20, 2021, 10:15:16 AM »
I would start with RS232, 485 can be a little finicky sometimes.  Get it to work with that first then use 485 if you need to connect more than 1 pump.

If he was getting exception responses, the comm was working. Now it's just about getting the requests right.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Modbus to Peristaltic Pump
« Reply #3 on: June 20, 2021, 02:37:10 PM »
Did you try reading one of the registers?

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Re: Modbus to Peristaltic Pump
« Reply #4 on: June 20, 2021, 04:11:20 PM »
Yes.  Doesn't read anything.   It comes up with a time out or it throws the 3 2 6 codes

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: Modbus to Peristaltic Pump
« Reply #5 on: June 20, 2021, 05:11:07 PM »
Yes.  Doesn't read anything.   It comes up with a time out or it throws the 3 2 6 codes

If the result isn't repeatable, that probably is still wiring, baud rate, or parity issues. As was mentioned before, RS485 is a bit fickle. Even though your wiring looks correct, there is some disagreement about what is + and - is RS485. You might try reversing it, just as a test. You can also try with and without the terminator resistor.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Re: Modbus to Peristaltic Pump
« Reply #6 on: June 20, 2021, 08:46:11 PM »
Another error it is putting out is the password error on the connection.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: Modbus to Peristaltic Pump
« Reply #7 on: June 21, 2021, 08:48:10 AM »
Another error it is putting out is the password error on the connection.

I don't follow on this. What password?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Modbus to Peristaltic Pump
« Reply #8 on: June 21, 2021, 10:40:39 AM »
Did you try it on RS232?

Did you notice this on page 9 of the manual?

NOTE: Peristaltic pump only under communication control when in the main interface.

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Re: Modbus to Peristaltic Pump
« Reply #9 on: June 21, 2021, 03:44:46 PM »
I will get back to the password thing  after I grab a screen shot for you.

I did try 232.  It was behaving the same way as the 485.  Thank you

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Re: Modbus to Peristaltic Pump
« Reply #10 on: June 21, 2021, 09:11:58 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

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: Modbus to Peristaltic Pump
« Reply #11 on: June 22, 2021, 09:00:41 AM »
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
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 #12 on: June 22, 2021, 02:07:35 PM »
When you say common grounds.  My pump is powered by 120, and the plc is on DC.  This should be ok right?  It is also the only wiring.  It goes straight to the pump from the plc.

I don't know on the IEEE.  I will see if I can find that out.    I'm also going to try swapping polarity and moving the wiring into the rs232 ports.

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: Modbus to Peristaltic Pump
« Reply #13 on: June 22, 2021, 03:49:35 PM »
When you say common grounds.  My pump is powered by 120, and the plc is on DC.  This should be ok right?  It is also the only wiring.  It goes straight to the pump from the plc.

Yes, of course, this is OK. I meant:
- GD1 (pump drive) is connected to GND (BRX serial port)
- Shielding (if any at this point) is grounded at one end only.
- 120-ohm termination resistor between A+ and B- (pump drive) and RS-485 is selected in the BRX's System Configuration with the Enable 120 Ohm Termination checked.

Granted, if you are just testing, and the cable is short, then the shielding and the termination are not critical at this point. If you have anything else wired up on the pump drive's terminals, the grounds on those may come into play. You might want to unhook everything else and just work with the communications first.
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 #14 on: June 22, 2021, 06:25:46 PM »
Ok, yes.  Its about a 5 ft run of twisted pair cable.    The plc has the resister enabled. I do not have a resistor on the pump.  The pump has the drain/ground attached.  Only one side.   

This is the only thing using modbus at the moment.