Hello,
I am using the AVR chipset with ATMEGA2560. I am really close to wrapping up my program. in my project I am sending a command to a device, get the data from the device and clean it, and lastly put the data into modbus registers.
My issue is with the modbus slave. I set the poll definition to slave ID 2, Function 03 reading holding registers. I have put my data into registers 100-104. I connect it to docklight to check if I have any errors. I do not have any error messages. I then modbus poll to read the registers but I keep getting error messages "Timeout Error" or "No Connection". Any advice? Thank you for your time. Attached is my code.
modbus slave
-
- Posts: 37
- http://meble-kuchenne.info.pl
- Joined: Thu Feb 02, 2023 9:32 pm
- Has thanked: 19 times
- Been thanked: 3 times
modbus slave
- Attachments
-
- HexStrToInt.fcm
- (3.04 KiB) Downloaded 27 times
-
- Inspectra_macro.fcfx
- (33.93 KiB) Downloaded 29 times
Re: modbus slave
Hi,
Have you tried the master and slave simulators from here https://www.simplymodbus.ca/ to check that you are sending the right data format. It probably has enought capability in demo mode.
Bob
Have you tried the master and slave simulators from here https://www.simplymodbus.ca/ to check that you are sending the right data format. It probably has enought capability in demo mode.
Bob
-
- Posts: 37
- Joined: Thu Feb 02, 2023 9:32 pm
- Has thanked: 19 times
- Been thanked: 3 times
Re: modbus slave
Hi,
I got it going somewhat. I have some questions on the ModbusSlave::CheckforIncoming(). Does the return bit act like a bool? Does it work like a UART initialize? Do I need an interupt? I saw an example program on the wiki but I think it was a bit simple.
I got it going somewhat. I have some questions on the ModbusSlave::CheckforIncoming(). Does the return bit act like a bool? Does it work like a UART initialize? Do I need an interupt? I saw an example program on the wiki but I think it was a bit simple.
-
- Posts: 37
- Joined: Thu Feb 02, 2023 9:32 pm
- Has thanked: 19 times
- Been thanked: 3 times
Re: modbus slave
Can I use this with flowcode simulation? How would I set it up in the simulation properties?RGV250 wrote: ↑Thu Mar 02, 2023 9:56 amHi,
Have you tried the master and slave simulators from here https://www.simplymodbus.ca/ to check that you are sending the right data format. It probably has enought capability in demo mode.
Bob