triee Posted August 23, 2019 Report Posted August 23, 2019 i hope some one can explain what the problem
Wasan Posted August 23, 2019 Report Posted August 23, 2019 @triee You should uncheck at RTS control and Reverse CRC. Then check communication format to use Modbus. Which RS-485 communication module that you use. Do you use chinese PLC board? 1
Tech Fred Posted August 23, 2019 Report Posted August 23, 2019 The response is a single byte. You should be getting back a response with 10 data bytes 3 header bytes and 2 trailing check sum bytes. Similar to the following: [01h] [03h] [0Ah] [00h] [01h] [00h] [02h] [00h] [03h] [00h] [04h] [00h] [05h] [24h] [CFh] 1
triee Posted August 24, 2019 Author Report Posted August 24, 2019 16 hours ago, Wasan said: @triee You should uncheck at RTS control and Reverse CRC. Then check communication format to use Modbus. Which RS-485 communication module that you use. Do you use chinese PLC board? Yes , what do you think any problem with my ladder?
triee Posted August 24, 2019 Author Report Posted August 24, 2019 9 hours ago, Tech Fred said: The response is a single byte. You should be getting back a response with 10 data bytes 3 header bytes and 2 trailing check sum bytes. Similar to the following: [01h] [03h] [0Ah] [00h] [01h] [00h] [02h] [00h] [03h] [00h] [04h] [00h] [05h] [24h] [CFh] Can you give me example ?
triee Posted August 24, 2019 Author Report Posted August 24, 2019 16 hours ago, Wasan said: @triee You should uncheck at RTS control and Reverse CRC. Then check communication format to use Modbus. Which RS-485 communication module that you use. Do you use chinese PLC board? Can you give me the right example ladder
triee Posted August 24, 2019 Author Report Posted August 24, 2019 can give me example ladder i want connect with weinview hmi
triee Posted August 24, 2019 Author Report Posted August 24, 2019 18 hours ago, Wasan said: @triee You should uncheck at RTS control and Reverse CRC. Then check communication format to use Modbus. Which RS-485 communication module that you use. Do you use chinese PLC board? The modbus rtu must be even parity ?
DanW Posted August 24, 2019 Report Posted August 24, 2019 I'm not a mitsubishi guy, I'm a Modbus guy, so I can't comment on your ladder. Several observations. CRC error 99% of Modbus is half-duplex "2 wire RS-485" which means that handshaking is not used. That's why the "handshake control" feature should not be checked (first graphic, upper right), because 2 wire RS-485 has no provision for the RTS signal (a separate pin on RS-232). Checking "reverse CRC" is probably why your 3rd graphic shows an invalid checksum. If the checksum bytes are reversed, the the checksum is wrong. Uncheck the "reverse CRC" feature. Not a valid Modbus reply In the first graphic, the single byte response, A7, makes no sense whatsoever. A valid Modbus reply message, even an error-exception code reply is a formatted message with at least 8 bytes. "Read Holding Registers" or "Read Input Registers"? In the first graphic, the "Read Holding Registers" is selected, with a Function 4. In Step 3, the 2nd byte in the message [04h] "Data Out" message confirms that the Modbus message is requesting a read of the "Input Registers", which is what Function Code 04 does. Input Registers are a different set of registers than Holding Registers in a slave. Some few slave devices map the same information in the Input Registers to the Holding Registers, but many do not. A source of confusion is that Input Registers are identified by the leading numeral (3)xxxxx, whereas Holding Registers are identified by the leading numeral (4)xxxxx. So Function Code 03 (read Input Registers) reads the (4)xxxxx memory area, but Function Code 04 (read Holding Registers) reads the (3)xxxxx memory area. The graphic shows what I consider a misrepresentation because it allows Function 04 to be incorrectly associated or identified with Holding Registers. The bottom line is that the query is polling the slave's Input Registers, (3)xxxxx, with Function Code 04, and if that's what you want, fine; or maybe you need to poll with Function Code 03 instead if you need to poll Holding registers Unreadable graphics I'm sure there's critical information in the graphics of manual pages that you posted, but it's your problem and if you can't take the time to format the graphics so they're readable, you can't expect readers to jump through hoops to do so. Who's Master, Who's Slave? By definition, Modbus RTU Masters can not communicate with another Modbus RTU master. The text about connecting to weinview hmi - most HMI's operate as Modbus master so that actions like pressing a soft switch on the HMI immediately sends the status change to the PLC without waiting for a PLC master to poll the HMI for changed states. I had assumed that the first set of 3 graphics were Modbus Master setup pages for the Fx2n PLC. If the Fx2n is a Modbus Master, can the Weintek HMI be a Modbus slave? Parity The rule for serial RS-485 communications (which is one of the hardware comm links used by Modbus RTU, the other is RS-232) is that the parity settings for all devices on the link MUST be the same. The Modbus Spec says that devices MUST have Even Parity, but there are no Modbus Police to enforce the specification, so occasionally there are vendors who use only No Parity. But most allow a choice of even, odd, or none Parity. But you have to match the parity settings for the Master and all slaves or you have garbage network that won't work. 2
panic mode Posted August 25, 2019 Report Posted August 25, 2019 before ANY serial communication can take place, same settings must be used on ALL participants. that means that data size, baud rate, parity, stop bits etc must be same. is this the case? what are the settings of other nodes? all nodes must have unique ID. is this the case? what are IDs of all nodes? program need to initialize module settings. you do this part and assign ID node number 1. so far so good (assuming those are correct values). but that is only one line... you still need to write code to read data, write data, calculate checksum etc. and all of this code is missing. so... unless someone posts sample, you have more work to do.
Wasan Posted August 26, 2019 Report Posted August 26, 2019 @triee For use FX PLC to Modbus Slave you should check that how data from PLC (X, Y, M ,D) mapping to Modbus Address (40001, 40002, 40003, etc). Please shown us your model and link to manual to check how to setting it.
triee Posted August 28, 2019 Author Report Posted August 28, 2019 On 8/26/2019 at 9:10 AM, Wasan said: @triee For use FX PLC to Modbus Slave you should check that how data from PLC (X, Y, M ,D) mapping to Modbus Address (40001, 40002, 40003, etc). Please shown us your model and link to manual to check how to setting it.
triee Posted August 28, 2019 Author Report Posted August 28, 2019 On 8/24/2019 at 9:05 PM, DanW said: I'm not a mitsubishi guy, I'm a Modbus guy, so I can't comment on your ladder. Several observations. CRC error 99% of Modbus is half-duplex "2 wire RS-485" which means that handshaking is not used. That's why the "handshake control" feature should not be checked (first graphic, upper right), because 2 wire RS-485 has no provision for the RTS signal (a separate pin on RS-232). Checking "reverse CRC" is probably why your 3rd graphic shows an invalid checksum. If the checksum bytes are reversed, the the checksum is wrong. Uncheck the "reverse CRC" feature. Not a valid Modbus reply In the first graphic, the single byte response, A7, makes no sense whatsoever. A valid Modbus reply message, even an error-exception code reply is a formatted message with at least 8 bytes. "Read Holding Registers" or "Read Input Registers"? In the first graphic, the "Read Holding Registers" is selected, with a Function 4. In Step 3, the 2nd byte in the message [04h] "Data Out" message confirms that the Modbus message is requesting a read of the "Input Registers", which is what Function Code 04 does. Input Registers are a different set of registers than Holding Registers in a slave. Some few slave devices map the same information in the Input Registers to the Holding Registers, but many do not. A source of confusion is that Input Registers are identified by the leading numeral (3)xxxxx, whereas Holding Registers are identified by the leading numeral (4)xxxxx. So Function Code 03 (read Input Registers) reads the (4)xxxxx memory area, but Function Code 04 (read Holding Registers) reads the (3)xxxxx memory area. The graphic shows what I consider a misrepresentation because it allows Function 04 to be incorrectly associated or identified with Holding Registers. The bottom line is that the query is polling the slave's Input Registers, (3)xxxxx, with Function Code 04, and if that's what you want, fine; or maybe you need to poll with Function Code 03 instead if you need to poll Holding registers Unreadable graphics I'm sure there's critical information in the graphics of manual pages that you posted, but it's your problem and if you can't take the time to format the graphics so they're readable, you can't expect readers to jump through hoops to do so. Who's Master, Who's Slave? By definition, Modbus RTU Masters can not communicate with another Modbus RTU master. The text about connecting to weinview hmi - most HMI's operate as Modbus master so that actions like pressing a soft switch on the HMI immediately sends the status change to the PLC without waiting for a PLC master to poll the HMI for changed states. I had assumed that the first set of 3 graphics were Modbus Master setup pages for the Fx2n PLC. If the Fx2n is a Modbus Master, can the Weintek HMI be a Modbus slave? Parity The rule for serial RS-485 communications (which is one of the hardware comm links used by Modbus RTU, the other is RS-232) is that the parity settings for all devices on the link MUST be the same. The Modbus Spec says that devices MUST have Even Parity, but there are no Modbus Police to enforce the specification, so occasionally there are vendors who use only No Parity. But most allow a choice of even, odd, or none Parity. But you have to match the parity settings for the Master and all slaves or you have garbage network that won't work. Hmi weinview as master and plc as slave , the graphic show i used converter 232 to 485 in my pc side and the plc side direct 485 from plc board 20 hours ago, triee said: Can you give me the right ladder?
Wasan Posted August 29, 2019 Report Posted August 29, 2019 @triee You need to scan Modbus address first. For your attach manual it shows that for D0 - D511 you need to use Modbus Address 0 - 1FF (40000 - 40511) Then you should config Comtest BB Pro as shown as image attached. Then Change value on D0 or D1 then check what data do you receive. .
triee Posted August 30, 2019 Author Report Posted August 30, 2019 17 hours ago, Wasan said: @triee You need to scan Modbus address first. For your attach manual it shows that for D0 - D511 you need to use Modbus Address 0 - 1FF (40000 - 40511) Then you should config Comtest BB Pro as shown as image attached. Then Change value on D0 or D1 then check what data do you receive. . What about the x and y can you give me clue setting in comtest pro ?
triee Posted August 30, 2019 Author Report Posted August 30, 2019 The ladder in plc M8000---------------------------[mov d10 d0 ] Its mean i read d10 value in comtest pro ?
Wasan Posted August 30, 2019 Report Posted August 30, 2019 2 minutes ago, triee said: The ladder in plc M8000---------------------------[mov d10 d0 ] Its mean i read d10 value in comtest pro ? Your Ladder means move(copy) data from D10 to D0 I recommend you to setup comtest bb Pro like this to start read data from 40000 address because I don't know that which your PLC start address that maybe 0 or 1 depends on manufacturer.
triee Posted August 31, 2019 Author Report Posted August 31, 2019 21 hours ago, Wasan said: Your Ladder means move(copy) data from D10 to D0 I recommend you to setup comtest bb Pro like this to start read data from 40000 address because I don't know that which your PLC start address that maybe 0 or 1 depends on manufacturer. I was trying thats but still same err checksum
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now