LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

More
2 months 1 day ago #349154 by Oxbown
Hi Meister, I updated to the dev branch, but I don't see any difference. Is there any way to sniff the Modbus network?

Please Log in or Create an account to join the conversation.

More
2 months 1 day ago #349155 by meister
new dev update:

go to mbus plugin-config and set the new debug flag

hope that help's

Please Log in or Create an account to join the conversation.

More
2 months 23 hours ago #349156 by Oxbown
I ran a couple of tests, and the raw Modbus data makes sense. The board's response is OK, and the data corresponds to the DIs that are ON.
Seems that the mistake is in the LinuxCNC HAL config.

IN1
> MODBUS_TX(mbus0): 1 3 0 192 0 2 196 55
 MODBUS_RXmbus0: 1 3 4 0 1 0 0 171 243

IN2
> MODBUS_TX(mbus0): 1 3 0 192 0 2 196 55
 MODBUS_RXmbus0: 1 3 4 0 2 0 0 91 243

IN1 + IN2
>MODBUS_TX(mbus0): 1 3 0 192 0 2 196 55
 MODBUS_RXmbus0: 1 3 4 0 3 0 0 10 51

Please Log in or Create an account to join the conversation.

More
2 months 22 hours ago - 2 months 22 hours ago #349158 by meister
i think the problem is, your device returns 4 bytes, not the requested 2 ?!?!


Code:
01 03 00 192 00 02 196 55 01: The SlaveID    03: The Function Code 3 (read Analog Output Holding Registers)       00 192: start register              00 02: number of bytes 01 03 04 00 02 00 00 91 243 01: The SlaveID    03: The Function Code 3 (read Analog Output Holding Registers)       04: The number of data bytes to follow          00: The contents of register 192             02: The contents of register 193                00: The contents of register 194                   00: The contents of register 195 please try to change the 16 'values' to 32

you need to pull dev to incrase the values, with my simulation it works, but it's a workaround,
i will write a fix, to read the values in the right order and ignore the last 16bit's
Last edit: 2 months 22 hours ago by meister.

Please Log in or Create an account to join the conversation.

More
2 months 21 hours ago #349159 by meister
oh, no, my fault, i send number of bytes, not number of registers :(

Please Log in or Create an account to join the conversation.

More
2 months 21 hours ago #349160 by meister
I hope I’ve managed it now; it’s a bit tricky without the hardware

please set back to 16 values, update dev and try again

Please Log in or Create an account to join the conversation.

Time to create page: 0.398 seconds
Powered by Kunena Forum