mb2hal hotplug

More
14 Nov 2021 22:26 #226517 by mic
mb2hal hotplug was created by mic
Hi,
I´ve built my custom modbus TCP device to control some valves and connected it successfully to linuxcnc with mb2hal.
The only Problem i could not fix: linuxcnc has to be started after the device is powered on. If it´s the other way round - no connection is possible.
Also if the connection is interrupted mb2hal is not reconnecting to the device.
Is there any option to enable a kind of "hotplug" or how are others facing these problems?

Thank you very much
Michael

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

More
16 Nov 2021 18:21 #226668 by andypugh
Replied by andypugh on topic mb2hal hotplug
I think that the problem is likely to be that HAL components run in two stages. First there is the setup which parses inputs, and then it goes in to realtime mode, where fixed things happen every servo thread.

To re-initialise you would need to re-load the module. This is possible with unload / loadrt, but all the HAL connections would need to be re-made too.

If all your mb2hal were to be located in a separate HAL file, you can unload mb2hal and then run just that hal file to re-make the connections.

I would never argue that this was an _elegant_ approach.

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

Time to create page: 0.202 seconds
Powered by Kunena Forum