malasa37
Hello, I am using an ESP32. I am using the DI, DO, AI, and AO hardware points on the board, and I use these variables as IX, QX, IW, and QW. I would like to mention that I only downloaded the editor for Windows and did not install the runtime. I don’t know how to use the other addresses or how to use Modbus variables within my program.
thiagoralves
Reply 0 0
malasa37
[203128%2F9535893%2Fmceclip0]
Reply 0 0
malasa37
What is the mistake I made here? I am getting an error while uploading
Reply 0 0
malasa37
My goal is to use a virtual memory so that I can turn an LED on and off by writing 0 or 1 from Modbus Poll.
Reply 0 0
thiagoralves
You didn’t mention what is the error you’re getting during compilation, so I can’t help you there. But for toggling an output through Modbus, all you need is to declare a BOOL variable at a %QX location. Don’t control the variable from ladder otherwise it will supersede what you sent over Modbus
Reply 0 0
malasa37
[203128%2F9539766%2Fmceclip0]
 
I understand how to read and write Modbus points starting from MW0 on the ESP32. However, my current question is about using a TTL converter connected to the TX/RX pins. Unfortunately, GPIO 1 and 3 are already used as DO (digital outputs). Could you please help me with this?
Reply 0 0
thiagoralves
Remove the GPIO 1 and 3 pins from the IO Config at the upload dialog
Reply 0 0
ivan_terzo
[203128%2F9539766%2Fmceclip0]
 
I understand how to read and write Modbus points starting from MW0 on the ESP32. However, my current question is about using a TTL converter connected to the TX/RX pins. Unfortunately, GPIO 1 and 3 are already used as DO (digital outputs). Could you please help me with this?
Hi, I'm not sure how your code is supposed to work. How exactly do you want to transmit ModBus commands? How do you specify the device ID and the byte to activate in the program?
I do it using C code (Arduino for ESP32) along with the ST program.
Reply 0 0
malasa37
Hello,
I uploaded a program to my ESP32 hardware and wanted to read data from it using Modbus Poll. I bought a TTL converter and connected it to the TX and RX pins to read and write data from Modbus Poll through an RS485 converter. However, I encountered an issue: I powered the ESP32 from another source and made sure the grounds and voltage levels were common, but I couldn’t read any data — I got a timeout error. Interestingly, when the ESP32 is connected to the computer through the programming cable and converter, I can read data without any problem. What exactly is the reason for this? I want to read data through the TTL converter.
Reply 0 0
malasa37
RS485_21-400x400.jpg
 
I used an auto-direction TTL converter, but even though I powered the ESP32 externally, I couldn’t read or write data through RX/TX. My settings are 9600, none, 1, RS485 TX -1.
Reply 0 0
malasa37
Reply 0 0
Reply