MB2HAL not fully compatible with LinuxCNC 2.9 ?

More
19 Jan 2022 19:28 #232474 by rebelx
Dear All,
I have been running my Gerber Sabre 408 on LinuxCNC 2.7 and 2.8 without problems for several years, using MB2HAL for communication with my Omron P5+ VFD. Since I wanted to switch to qtdragon_hd as a UI for my touchscreen display, I decided to upgrade to LinuxCNC 2.9. However, somehow MB2HAL seems to give a problem. After the hal pins are successfully created and the module seems running, it suddenly shuts down with the following error:
.....
./omron-mb2hal.hal:21: Pin 'spindle-vfd.runmode.00' does not exist
.....

It seems weird to me, as the pins were created successfully. When I comment out that particular line in my omron-mb2hal,hal file, a similar error occurs on line 25. When I comment that out too, the UI starts up without problems and the machine runs, except no spindle control obviously.
I have attached the debug file (linuxcnc.report) as well as the omron-mb2hal.ini and omron-mb2hal.hal files.

Any help will be much appreciated!

Thanks, Eric

 
Attachments:

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

More
20 Jan 2022 14:36 #232525 by HansU
Try changing
spindle-vfd.runmode.00
to
spindle-vfd.runmode.float.00
and
spindle-vfd.target-freq.00
to
spindle-vfd.target-freq.float.00
in your HAL-file.

Yes. The structure of the pins changed a bit to be more consistent and provide float and int pins and inverted bool pins.
Just have a look at the differences:
linuxcnc.org/docs/html/drivers/mb2hal.html
linuxcnc.org/docs/devel/html/drivers/mb2hal.html

 

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

More
20 Jan 2022 17:03 - 20 Jan 2022 17:19 #232538 by rebelx
Hi Hansu, first of all thank you for your quick reply. I made the suggested changes, but the error still happens:
.....
./omron-mb2hal.hal:21: Pin 'spindle-vfd.runmode.float.00' does not exist
.....

I have attached the debug report. As you can see it seems that pin spindle-vfd.runmode.00 is being created and after all the pins have been created the module runs and then somehow quit signal 15 is being received, resulting in the module to exit.
....
185  spindle-vfd create_each_mb_tx_hal_pins DEBUG: mb_tx_num [0] pin_name [spindle-vfd.info.num_errors]
186  spindle-vfd create_each_mb_tx_hal_pins DEBUG: mb_tx_num [0] pin_name [spindle-vfd.info.00]
187  spindle-vfd create_each_mb_tx_hal_pins DEBUG: mb_tx_num [1] pin_name [spindle-vfd.real-freq.num_errors]
188  spindle-vfd create_each_mb_tx_hal_pins DEBUG: mb_tx_num [1] pin_name [spindle-vfd.real-freq.00]
189  spindle-vfd create_each_mb_tx_hal_pins DEBUG: mb_tx_num [2] pin_name [spindle-vfd.runmode.num_errors]
190  spindle-vfd create_each_mb_tx_hal_pins DEBUG: mb_tx_num [2] pin_name [spindle-vfd.runmode.00]
191  spindle-vfd create_each_mb_tx_hal_pins DEBUG: mb_tx_num [3] pin_name [spindle-vfd.target-freq.num_errors]
192  spindle-vfd create_each_mb_tx_hal_pins DEBUG: mb_tx_num [3] pin_name [spindle-vfd.target-freq.00]
193  spindle-vfd main OK: HAL components created OK
194  spindle-vfd main OK: Link thread loop and logic 0 created OK
195  spindle-vfd main OK: spindle-vfd is running
196  spindle-vfd quit_signal DEBUG: signal [15] received
197  spindle-vfd quit_cleanup DEBUG: started
198  spindle-vfd quit_cleanup DEBUG: unloading HAL module [45] ret[0]
199  spindle-vfd quit_cleanup DEBUG: done OK
200  spindle-vfd main OK: going to exit!
....

Perhaps my understanding may be incorrect, but I would expect a pin 'spindle-vfd.runmode.float.00' to be created instead of 'spindle-vfd.runmode.00'.
 
Attachments:
Last edit: 20 Jan 2022 17:19 by rebelx.

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

More
20 Jan 2022 18:09 #232542 by HansU
Sorry my mistake, try again with:
spindle-vfd.runmode.00.float spindle-vfd.target-freq.00.float
A hint for debugging is to load the mb2hal component with it's ini file but don't connect any expected signals so far.
Then have a look in Halshow which signals are really created and if that is what you intended.

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

More
20 Jan 2022 19:04 #232546 by rebelx
Hi Hansu, thank you once more for your quick reply and yes, that did the trick! I should have know that float should come at the end but it's been a while since I wrote some decent hal code. I apologize for my stupidity :)
Thank you for your debugging hint. I will certainly look into that next time.

Case closed :)

Take care,
Eric

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

More
10 May 2024 15:13 #300330 by Swag
Hi All,

I am running in to maybe a similar issue with a previously working mb2hal, no longer working in 2.9.  Based on the log when I start linuxcnc in terminal, it is creating everything successfully, but then not able to communicate with the powtran.  This is a fresh install of debian 12 with linuxcnc 2.9, swapping back to the old SDD with debain 10 and linuxcnc 2.8, it works fine.  Does anyone know if there is something else that needs to be done with debian 12 and an rs485 dongle? (or possibly I making an even more basic mistake and am forgetting something I needed to do a few years ago when I set this up with 2.8).  Attached the mb2hal, custom.hal, and main machine hal as well as a grab of the terminal output when it starts.  At the end when it indicates the "get_tx_connection ERR" that just scrolls infinitely until I shut linuxcnc down.

Kind regards,

Sam
Attachments:

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

More
11 May 2024 07:20 #300371 by Swag
So if anyone else runs across this problem with an RS485 dongle and mb2hal, likely your files are all fine, the problem turned out to be with Debian 12 not adding the user to the group dialout (or requiring dialout to use /dev/ttyUSB0). Found coincidentally in this mail thread:

www.mail-archive.com/emc-users@lists.sou...ge.net/msg91974.html

if stat /dev/ttyUSB0 shows Gid: ( 20/ dialout), run the following:

sudo usermod -a -G dialout $USER

I needed to restart the computer afterwards, likely there is a command to restart some subset and it would have worked, but a fresh restart worked as well.
The following user(s) said Thank You: tommylight

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

More
11 May 2024 10:06 #300381 by tommylight
Just in case even the above line does not work, type this in a terminal
sudo apt purge brltty*
Enter
-
Most Linux distros will install brltty if they detect a non standard keyboard, like having multimedia buttons and pots, smart card readers, fingerprint readers, etc.
Brltty is used for Braile keyboards.
The following user(s) said Thank You: Swag

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

Time to create page: 0.100 seconds
Powered by Kunena Forum