MB2HAL reading coils not supported in linuxcnc 2.8.4? [SOLVED]
I'm just trying to experiment a but with modbus to control my VFD. I've install some cli tools to communicate with the drive, and I can read/write the coils and holding registers I want to use. So I installed MB2HAL and tried to use the TX code "fnct_00_read_coils" to read the coil that indicates the VFD has reached the set frequency as a first test. But when starting linuxcnc, I get an error message "mb2hal parse_transaction_section ERR: [TRANSACTION_00] [MB_TX_CODE] [fnct_00_read_coils] out of range".
I've tried some other experiments. and reading holding registers seems to work.
I also read some documentation, but it's not 100% clear to me if reading a coil is supported linuxcnc 2.8.4. Documentation at "linuxcnc.org/docs/html/drivers/mb2hal.html" does not mention it, but the documentation at "linuxcnc.org/docs/devel/html/drivers/mb2hal.html: does. I have linuxcnc-uspace and linuxcnc-uspace-dev both installed.
I did notice I needed to add "VERSION=1.1" to the .ini file (which I did) but it's still as if the tx function code is not recognized.
Some feedback would be really appreciated!
Could anybody tell me if reading coils is at all supported in linuxcnc 2.8.4 and if not what I need to take a look at?
Please Log in or Create an account to join the conversation.
Read coils is supported in version 2.9 according to this: linuxcnc.org/docs/2.9/html/drivers/mb2hal.html
In any case, you wrote MB_TX_CODE=fnct_00_read_coils in your ini file. This should be MB_TX_CODE=fnct_01_read_coils. As written in 2.9 doc. Maybe try this first.
Please Log in or Create an account to join the conversation.
(Delete me after that)
Please Log in or Create an account to join the conversation.
linuxcnc.org/docs/ is pointing to the current release, so the same as linuxcnc.org/docs/2.8
linuxcnc.org/docs/devel/ is pointing to the master branch (2.10), so currently close to 2.9
VERSION=1.1 was introduced in LinuxCNC 2.9, so it is not known by 2.8 and has no effect.
Could anybody tell me if reading coils is at all supported in linuxcnc 2.8.4 and if not what I need to take a look at?
You can add the MB2HAL related files from 2.9 and build your own LinuxCNC version from source.
Please Log in or Create an account to join the conversation.
thanks for the info, really appreciated.So I need to take a look at 2.9 to be able to read coils. Not sure yet how t either update or use the MB2HAL related files in a self-built 2.8 but I'll take a look at this for sure.
I indeed made a typo there, but using "fnct_01_read_coils" yielded the same results.Will report back once I ge this going.In any case, you wrote MB_TX_CODE=fnct_00_read_coils in your ini file. This should be MB_TX_CODE=fnct_01_read_coils. As written in 2.9 doc. Maybe try this first.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19206
- Thank you received: 6437
Done, thank you.MODS: I think this should be moved to HAL discussions.
Please Log in or Create an account to join the conversation.
@Hans/JPL: I can confirm that compiling linuxcnc 2.8 with the MB2HAL flles from 2.9 works indeed as expected. I can read the coils now.
Thanks!! Is there anything more I should add to this post to help people with a similar question?
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19206
- Thank you received: 6437
No worries, make yourself at home.
Please Log in or Create an account to join the conversation.