MB2HAL reading coils not supported in linuxcnc 2.8.4? [SOLVED]

More
26 Nov 2022 11:33 - 26 Nov 2022 11:33 #257676 by petervg
Hi guys,

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?
Attachments:
Last edit: 26 Nov 2022 11:33 by petervg.

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

More
26 Nov 2022 18:44 #257693 by JPL
Read coils is not supported in version 2.8 according to this: linuxcnc.org/docs/2.8/html/drivers/mb2hal.html

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.

More
26 Nov 2022 18:49 #257694 by JPL
MODS: I think this should be moved to HAL discussions.
(Delete me after that)

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

More
26 Nov 2022 21:09 - 26 Nov 2022 21:14 #257700 by HansU
Thanks JPL for clarifying.

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.
Last edit: 26 Nov 2022 21:14 by HansU.

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

More
26 Nov 2022 22:19 - 26 Nov 2022 22:21 #257706 by petervg
Hi guys,

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.

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.

I indeed made a typo there, but using "fnct_01_read_coils" yielded the same results.Will report back once I ge this going.
Last edit: 26 Nov 2022 22:21 by petervg. Reason: block quote was incorrectly used

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

More
26 Nov 2022 22:33 #257707 by tommylight

MODS: I think this should be moved to HAL discussions.

Done, thank you.

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

More
27 Nov 2022 12:30 - 08 Dec 2022 22:12 #257728 by petervg
@Tommy - my apologies for not posting in the correct category.

@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?

 
Last edit: 08 Dec 2022 22:12 by petervg. Reason: Added solved tag
The following user(s) said Thank You: Todd Zuercher

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

More
27 Nov 2022 16:47 #257745 by tommylight
@peter
No worries, make yourself at home.
The following user(s) said Thank You: petervg

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

Time to create page: 0.109 seconds
Powered by Kunena Forum