NEED HELP establishing modbus connection to my power supply

I have DRS-240-48 PS and also ZLAN5142D (serial to ethernet device). I want to monitor some data from PS using Modbus Poll. I checked PS manual, configured Slave ID, connected everything to my PC and typed Register Address in app. But I am getting Timeout Error everytime when I try to etablish connection. I can send screenshots of all parameters that I entered in modbus poll and ZLAN5142D app if needed
 
As I'm sure you already know, the DRS-240-48 supports only Modbus RTU (the serial version of Modbus). The most straight-forward way of connecting a Modbus RTU device to a PC using Modbus Poll is to use a USB to RS-485 adapter.

An internet search returned no results for the ZLAN5142D serial to Ethernet converter you mention, so I cannot find any details on its capabilities. However, if it is not specifically made for Modbus, it likely does not support the Modbus/TCP protocol (which is the official Ethernet version of Modbus). If this is the case, the serial to Ethernet converter is just encapsulating Modbus RTU messages in TCP or UDP packets. Modbus Poll does support these special versions of Modbus as well, you simply need to make the proper selection in the Connection dropdown from the connection dialog box in Modbus Poll.

If you can provide documentation, screenshots, details etc. on the ZLAN5142D, I may be able to assist further.
 
Thank you for your reply, and sorry for my error serial to ethernet is not zlan5142d, but zlan5143d. And also I cannot use serial to USB, because I am planning to use this power supply for my ethernet switches and I have a lot of ethernet switches(less than 255, so it will not be a problem). In 30 mins I will come home and send screenshots if needed. But I am also having troubles understanding how to find Slave ID (in DRS 240 48 manual I dont understand what CN12 A1~A0, AND 0x8X means) If you can briefly explain this it would be great too.
 
From how I interpret the Slave ID settings described in the DRS-240 manual, the A0 and A1 pins on CN12 are what set the Slave ID. Since there are only two pins, there are only 4 possible Slave ID's that can be set. The possible Slave ID's are 0x80, 0x81, 0x82, and 0x83 (that's 128, 129, 130, and 131, respectively in decimal), depending on the A0 and A1 settings.
1688663900957.png

It seems you are supposed to jumper the A0 (pin 5) and/or A1 (pin 6) pins to GND (pin 2) on CN12 to set the address. If no jumpers are used, A0 and A1 have a value of 1, so the Slave ID would be 0x83 (131 decimal).
1688664212394.png
 
modbus_1.png


In this menu of Modbus Poll what should I choose if I am connecting through ZLAN5143D converter, Modbus TCp/ip or Modbus PTU/ASCII Over TCP/IP. In the IP address I inserted IP of my converter. and also port is the same as on my converter. Connection type TCP server.


For example I want to monitor temperature of my device
temp.png

Do I correctly filled "Read/Write defenition?

modbus_2.png
And if I will still get connection "Time out" error, what could be the issue. I tried to look deeper and thought maybe its wiring problem but according to manual

manual_1.pngI made connection like this ------->

manual_2.pngThe last thing that could create error is the incorrectly configured ZLAN5143D converter through its interface app, but I can ping IP of converter, so I think its not an issue

I would be really happy if you can find my mistake:)
 
There are a lot of places where things could be incorrect (wiring, configuration, addresses, etc.). If you're getting a timeout error, and not a connection error or similar, chances are the TCP connection between Modbus Poll and the ZLAN 5143D are succeeding, it's just the Modbus RTU request sent to the DRS-240 by the ZLAN 5143D is not receiving a response (which could be due to incorrect Slave ID, baud rate, parity settings, wrong address, etc.).

Here are some things to check:

Wiring
DRS-240ZLAN 5143D
Data + (RJ-45 Pin 6)485A
Data - (RJ-45 Pin 7)485B
GND-AUX (RJ-45 pin 8)Not connected or PGND*
* The ZLAN 5143D seems to be isolated, so it's possible the manufacturer did not expose the RS-485 0V reference (GND) signal.

Configuration
The product page for the ZLAN 5143D (http://www.zlmcu.com/en/products_ZLAN5143D.htm) states:
When used as Modbus gateway, 5143D supports Modbus TCP to Modbus RTU, so as to realize data acquisition of RS485 Modbus RTU device by upper computer using Modbus TCP protocol.
This indicates the device supports Modbus/TCP. Therefore, according to the 5143D's User Manual (http://www.zlmcu.com/en/download/ZLAN5143D_en.pdf), you must configure the 5143D for Modbus RTU to Modbus/TCP conversion (i.e. Port = 502, Work Mode = TCP Server, Transfer Protocol = Modbus TCP<->RTU).

Additionally, the serial settings on both the DRS-240 and ZLAN 5143D must match exactly. The DRS-240 is fixed as follows:
1688669134252.png

Addresses
Your configuration in Modbus Poll seems correct, except for the Quantity field (currently 10). If you have 0x0062 in the Address field, you must enter 1 in the Quantity field, as registers 0x0063 - 0x006C do not exist on the DRS-24. Alternatively, you could enter 0x0060 for the Address and enter 3 for the Quantity, as registers 0x0060 - 0x0063 all exist on the DRS-24.
 
Thank you for you detailed reply, after 10 hours I will be at work and do exactly what you said to me. If I will still get "Time out" error I will post here more detailed info about my settings on ZLAN5143D app and anything that can be related to the problem too, cause there is a lot of info in this apps that I see for the first time.

Btw here is how I configured my ZLAN at work:


zlan_1.png

P.S Dest IP and Dest Port just bunch of random numbers, because the place holder gray out when I change to TCP server.
Cant send actual photo from my PC rn because DRS-240 and ZLAN at work
 
I did everything as you suggested but still getting timeout error. I cant understand what could be incorect as logicaly everything configured according to manual

Here is screenshots from apps

modbus_1.pngmodbus_2.pngmodbus_3.pngmodbus_4.pngmodbus_5.png


Please I need help or they will fire me, I need this job to feed family and pay for tuition:cry::cry::cry:
 
The Function you have selected in Modbus Poll is incorrect. It should 04 Read Input Registers (3x), as you had selected before. Also, I recommend accessing only a single register for now until you get things working, so set Quantity to 1.

Regarding the configuration of the Ethernet adapters on your computer, I don't believe this is causing issues right now, but it is generally not a good idea to configure multiple adapters on the same computer for the same subnet. Both your "Ethernet 2" and "Ethernet" adapters are configured for the 192.16.1.xxx subnet. I recommend changing the one that is not connected to this equipment to a different subnet.

Finally, double and triple check your wiring. You are likely using a Cat5 cable. Keep in mind that there are two different pinout, one where pin 6 is green and another where pin 6 is orange. You should look at the clear connector and confirm which color is actually in the pin 6 position on the cable you're using. Here is additional info:
https://satoms.com/ethernet-cable-pinouts/

As another recommendation, if you still are having issues, you need to get a USB to RS-485 adapter to simplify (divide and conquer) the troubleshooting. You should first try connecting the USB to RS-485 adapter to the DRS-240 and get that working with Modbus Poll. After that, you can move on to confirming the operation of the ZLAN 5143D by connecting your USB to RS-485 adapter to it and using a Modbus Slave simulator such as ModSim:
https://win-tech.com/
 
I read manual for DRS240 again and found out something interesting

modbus_q.png


- 0x83 in manual is Slave ID 3, but I used Slave ID 131 before cause I thought that it is in 16x, but now I understand that "Timeout error" might occured because of this, but this is just theory I will try to do as manual says on Monday.

- Also I triple checked my wirings they are all ok

- And 1 more thing, I am trying to connect to PS that dont yet has batteries for UPS usage and PS not connected to anything except RJ 45 and AC power
 
I already explained the Slave ID. Please reread my post #4 above. 0x83 (hexadecimal) is equal to 131 (decimal).

I can't say for certain whether not having a battery connected to the PS would affect communication. My guess is that it shouldn't, but only the manufacturer could tell you for sure.

I really think the next step is for you to get a USB to RS-485 adapter so that you can make a direct connection to the PS from your computer using Modbus Poll.
 
I use the DRS-240-12. The slave ID is certainly 131 in the default state. I use a moxa NPort W2150A to port the RS485 2 wire. I had to flip the Data+ and Data- at the moxa to get communications up. Remember also to offset +1 the Register Addresses.
0x0000=0 +1 = 1, 0x0020= 2x16=32+1=33 and so on. The power supply will talk MODBUS and for the cost you can beat it.
 
I use the DRS-240-12. The slave ID is certainly 131 in the default state. I use a moxa NPort W2150A to port the RS485 2 wire. I had to flip the Data+ and Data- at the moxa to get communications up. Remember also to offset +1 the Register Addresses.
0x0000=0 +1 = 1, 0x0020= 2x16=32+1=33 and so on. The power supply will talk MODBUS and for the cost you can beat it.
Since you work with this power supply, I have a question about setting the value of a single bit on a register address. i need to change the UPS_CONFIG (0x00D2) and change the value of bit 3 to 0. Is this as simple as taking the binary from the 8 low bits and sending the equivalent hex number as a 0x06 single write command? Please forgive my ignorance, I don't have occasion to use modbus very often.
 
Yes, you have the right idea. You will need to perform a read, modify, write procedure on the UPS_CONFIG (0x00D2) register.

First, read the value using the 0x03 Read Holding Registers command. The value read will be 16 bits. Modify the bit you'd like to change in the value, then write the 16-bit value back to the device using the 0x06 Preset Single Register command.
 
Yes, you have the right idea. You will need to perform a read, modify, write procedure on the UPS_CONFIG (0x00D2) register.

First, read the value using the 0x03 Read Holding Registers command. The value read will be 16 bits. Modify the bit you'd like to change in the value, then write the 16-bit value back to the device using the 0x06 Preset Single Register command.
Thanks for your quick reply and glad to know I was on the right track. Unfortunately I don't have the part in hand; I'll be on a client site to fix this issue and do a bit of other troubleshooting later in the week so I'm trying to give myself a refresher in all of this so I can hopefully have everything in order before I get there. Thanks again for your help!
 
Top