Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: MBAutomation 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
-
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.
-
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.
-
Did you try reading one of the registers?
-
Yes. Doesn't read anything. It comes up with a time out or it throws the 3 2 6 codes
-
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.
-
Another error it is putting out is the password error on the connection.
-
Another error it is putting out is the password error on the connection.
I don't follow on this. What password?
-
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.
-
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
-
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
-
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
-
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.
-
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.
-
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.
-
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?
-
I just confirmed that it is IEEE 754 format
-
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.
-
Can you post a copy of the pump mfgr's comms manual, or a link?
-
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.
-
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 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.
-
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.
-
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
-
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