mb2hal in LinuxCNC 2.9 No function Code 01

More
29 Sep 2023 13:35 #281857 by deroj
Hi.
where is the code fnct_01_read_coils gone?
And why was it dropped?
What should I use instead?

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

More
29 Sep 2023 21:02 #281884 by JPL
It's in fact the opposite:

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

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

More
30 Sep 2023 10:45 - 30 Sep 2023 10:45 #281917 by deroj
Replied by deroj on topic mb2hal in LinuxCNC 2.9 No function Code 01
Did a fresh Debian 12 install, and then LinuxCNC.
updated it to the last version.
copied my machine setup from LinuxCNC 2.8.1 to it.
mb2hal throws error "fnct_01_read_coils" out of range..
 
Last edit: 30 Sep 2023 10:45 by deroj.

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

  • Aciera
  • Aciera's Avatar
  • Away
  • Administrator
  • Administrator
More
30 Sep 2023 11:12 #281920 by Aciera
Replied by Aciera on topic mb2hal in LinuxCNC 2.9 No function Code 01
Maybe you could share your config.

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

More
30 Sep 2023 11:20 #281921 by deroj
Replied by deroj on topic mb2hal in LinuxCNC 2.9 No function Code 01
 

File Attachment:

File Name: mb2hal_vfd.ini
File Size:3 KB
This is my INI.

When I activate the last transaction_05 it throws the error.

All the other transactions work, after I changed some pin names, because they have changed also a little in 2.9
Attachments:

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

More
30 Sep 2023 11:32 - 30 Sep 2023 12:43 #281923 by deroj
Replied by deroj on topic mb2hal in LinuxCNC 2.9 No function Code 01
I pulled the repo from github.
In this src, all the function codes are there.
How can I recompile and install this module?

github.com/LinuxCNC/linuxcnc/tree/master...al/user_comps/mb2hal


EDIT: I tried with halcompile...but no luck

oj@debian12:~$ halcompile --compile --userspace --extra-compile-args="-I/usr/include/modbus" /home/oj/linuxcnc-dev/src/hal/user_comps/mb2hal/mb2hal.c
gcc -I/home/oj/linuxcnc-dev/src/hal/user_comps/mb2hal -I/usr/include -I/usr/include/linuxcnc -URTAPI -U__MODULE__ -DULAPI -Os -I/usr/include/modbus -o mb2hal /tmp/tmpixtekcwo/mb2hal.c -Wl,-rpath,/lib -L/lib -llinuxcnchal
/usr/bin/ld: /tmp/ccaTGM4F.o: in function `get_tx_connection':
mb2hal.c:(.text+0x132): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x146): undefined reference to `modbus_connect'
/usr/bin/ld: mb2hal.c:(.text+0x15c): undefined reference to `modbus_set_socket'
/usr/bin/ld: mb2hal.c:(.text+0x185): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x1b8): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x1d1): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x203): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x247): undefined reference to `modbus_set_slave'
/usr/bin/ld: mb2hal.c:(.text+0x2a7): undefined reference to `modbus_set_debug'
/usr/bin/ld: mb2hal.c:(.text+0x2c5): undefined reference to `modbus_set_response_timeout'
/usr/bin/ld: mb2hal.c:(.text+0x2e3): undefined reference to `modbus_set_byte_timeout'
/usr/bin/ld: /tmp/ccaTGM4F.o: in function `link_loop_and_logic':
mb2hal.c:(.text+0x5b5): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x615): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x65a): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x6a9): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x707): undefined reference to `modbus_get_socket'
/usr/bin/ld: /tmp/ccaTGM4F.o:mb2hal.c:(.text+0x760): more undefined references to `modbus_get_socket' follow
/usr/bin/ld: /tmp/ccaTGM4F.o: in function `link_loop_and_logic':
mb2hal.c:(.text+0x801): undefined reference to `fnct_01_read_coils'
/usr/bin/ld: mb2hal.c:(.text+0x80b): undefined reference to `fnct_02_read_discrete_inputs'
/usr/bin/ld: mb2hal.c:(.text+0x815): undefined reference to `fnct_03_read_holding_registers'
/usr/bin/ld: mb2hal.c:(.text+0x81f): undefined reference to `fnct_04_read_input_registers'
/usr/bin/ld: mb2hal.c:(.text+0x829): undefined reference to `fnct_05_write_single_coil'
/usr/bin/ld: mb2hal.c:(.text+0x833): undefined reference to `fnct_06_write_single_register'
/usr/bin/ld: mb2hal.c:(.text+0x83a): undefined reference to `fnct_15_write_multiple_coils'
/usr/bin/ld: mb2hal.c:(.text+0x841): undefined reference to `fnct_16_write_multiple_registers'
/usr/bin/ld: mb2hal.c:(.text+0x865): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x8d8): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x918): undefined reference to `modbus_close'
/usr/bin/ld: mb2hal.c:(.text+0x95a): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x9af): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0x9f3): undefined reference to `modbus_flush'
/usr/bin/ld: mb2hal.c:(.text+0xa4a): undefined reference to `modbus_get_socket'
/usr/bin/ld: mb2hal.c:(.text+0xabc): undefined reference to `modbus_get_socket'
/usr/bin/ld: /tmp/ccaTGM4F.o: in function `quit_cleanup':
mb2hal.c:(.text+0xb88): undefined reference to `modbus_close'
/usr/bin/ld: mb2hal.c:(.text+0xb9c): undefined reference to `modbus_free'
/usr/bin/ld: /tmp/ccaTGM4F.o: in function `main':
mb2hal.c:(.text.startup+0x12): undefined reference to `parse_main_args'
/usr/bin/ld: mb2hal.c:(.text.startup+0xab): undefined reference to `parse_ini_file'
/usr/bin/ld: mb2hal.c:(.text.startup+0x110): undefined reference to `init_mb_links'
/usr/bin/ld: mb2hal.c:(.text.startup+0x16e): undefined reference to `init_mb_tx'
/usr/bin/ld: mb2hal.c:(.text.startup+0x21a): undefined reference to `create_HAL_pins'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2: mb2hal] Fehler 1

Last edit: 30 Sep 2023 12:43 by deroj.

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

More
30 Sep 2023 18:36 #281951 by JPL
I think you need to add  VERSION=1.1, according to 2.9 doc:

#OPTIONAL: Set to 1.1 to enable the new functions:
# - fnct_01_read_coils
# - fnct_05_write_single_coil
# - changed pin names (see linuxcnc.org/docs/2.9/html/drivers/mb2hal.html#_pins).
VERSION=1.1



 

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

More
30 Sep 2023 18:43 #281952 by JPL
Yeah, this: linuxcnc.org/docs/2.9/html/drivers/mb2hal.html#_pins
Confirms that you must set VERSION = 1.1 to have the new fnct_01 and fnct_05

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

More
01 Oct 2023 08:02 #281968 by deroj
Replied by deroj on topic mb2hal in LinuxCNC 2.9 No function Code 01
YES!!!
Thank you very much.
That was the hint I didn't see

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

Time to create page: 0.065 seconds
Powered by Kunena Forum