So decoding the packet above (each pair of characters is one hex number) Your received packet is the following in ASCII: To extract the values from a response, first convert the hex numbers to ASCII. To decode the Modbus Read Holding Registers response, refer to section 6.3 in the Modbus specification here (note that the specification only shows the Request and Response PDU, the entire ADU in Modbus ASCII also includes the start character ':' and slave address at the beginning of the packet and the LRC and carriage return/line feed characters at the end): I assume changing your serial port settings to 7 data bits and even parity solved the previous issue you were having? I have converted my bytes to hex using the below code then print them in UART The next byte must be a Device ID 01 so the data became a 30 33 but i am getting 30 B1 i can't understand this, then the next two bytes are 30 33 I am getting the same response, but here my doubt is the 1st byte 3A represents : i have attached modscan software traffic data and previously i used format (which is i send from the microcontroller for receive the data from RS485 enabled meter or sensors ) for your reference, kindly check and help me to solve this problem,Ĩbyte req- i have send 8byte request from MC and receive data from RS485 enabled devices(meter&sensors)Ĭhar request = i have worked with RS485 to collect data from flow meters and RS485 enable sensors, usually that is need 8 byte request for send the data that is still now working fine but now i have checked the PLC data through modscan32 and 64 software's those are send 9 bytes data for receive the data, i dont know how to send the request data from microcontroller,Ģ. The Host Server you specify in your Client-Nodes will almost certainly to Port 502, but that is the port the Server is listening on, NOT the port on your client.Īnything else you want to know about Modbus can be found here.Currently i am working for receive data from PLC through RS485(here i have used Microcontroller like Arduino), here i have used Modscan 32 and modscan64 software(traffic data) for find a correct request data for my microcontroller then i have a below doubtġ. You shouldn't have to worry about permissions etc. To do any and all of this in Node-Red, just install the node-red-contrib-modbus and you're ready to go. The Clients (Masters) actively poll the Server, either to retrieve data (Registers) or to write data in the Server. Since Modbus is an open standard there are hundreds of variations to include double Words (32 bit) and Floats (in 32 bit). The Server (Slave) is passive, creating a space comprising multiple Modbus "Registers" which can be Bits or Words (16 bit). If you PLC refers to data mapped as Registers 40000-40100 for example, your PLC is acting as Modbus Slave.Ī Modbus Master sends a request/command to a Slave, and the Slave responds, either returning the requested data or executing a Write command. A PLC can be Master or Slave, and actually can be both at the same time. The older Modbus documentation, especially for PLCs, refers to systems comprising "Modbus Masters" and "Modbus Slaves". I have a lot more experience with PLCs and Modbus than with Node-Red, although I do have a Modbus TCP connection from a Node-Red device (Raspberry Pi) to a PLC/HMI so. "func": "msg.payload = '-H \"Content-Type:application/x-X POST -data \\' \n\nreturn msg", In fact I want to upload data from a router (data consumption) I retrieve them in HTTP POST, I use Modbus because there is no other way to upload this data to the PLC [
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |