connect 2 Lcnc machine using mb2hal

More
26 Dec 2022 13:03 #260322 by bkt
Because nee only few bit exchange, I find convenient using mb2hal .... tcp is better ....but not undertand if possible connect ... not remember if server/client situation was supported or not .... any how if supported was the right ini file to write?...example ...
/* server side I supposed */[MB2HAL_INIT]
INIT_DEBUG=3
SLOWDOWN=0.0
TOTAL_TRANSACTIONS=5

[TRANSACTION_00]
#Manually change values in Mod_RsSim and see result here
LINK_TYPE=tcp
TCP_IP=192.168.2.10
TCP_PORT=5002
MB_SLAVE_ID=0
MB_TX_CODE=fnct_02_read_discrete_inputs
FIRST_ELEMENT=1
NELEMENTS=8
HAL_TX_NAME=rd_di
MAX_UPDATE_RATE=0.0
DEBUG=1

then client side ..
/* server side I supposed */[MB2HAL_INIT]
INIT_DEBUG=3
SLOWDOWN=0.0
TOTAL_TRANSACTIONS=5

[TRANSACTION_00]
#Manually change values in Mod_RsSim and see result here
LINK_TYPE=tcp
TCP_IP=192.168.2.09
TCP_PORT=5002
MB_SLAVE_ID=0 ####<---- is right?? or was MB_SERVER_ID??? or nothing??
MB_TX_CODE=fnct_02_read_discrete_inputs
FIRST_ELEMENT=1
NELEMENTS=8
HAL_TX_NAME=rd_di
MAX_UPDATE_RATE=0.0
DEBUG=1


thnaks for any suggest
 

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

More
26 Dec 2022 18:28 #260336 by JPL
I'm sorry but that is not going to work for the simple reason that mb2hal is only able to have linuxcnc as the master. You cannot use it to configure it as a slave.

But YES, that would be very nice if this could work.
 

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

More
26 Dec 2022 20:05 #260342 by db1981
sascha has done an modbus slave driver for lcnc:

github.com/sittner/linuxcnc-mbslave
The following user(s) said Thank You: tommylight, bkt

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

More
27 Dec 2022 22:37 #260438 by bkt
I see on git previously .... seems install with sudo make install .... but not understand usages so no try .... seems simple add loadusr -mbslave /mypath/myconfig.xml to my hal file? .... READ:ME file is a little "short" ... someone have try?

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

More
27 Dec 2022 22:45 #260439 by JPL
There is an examples file 'mbslave-conf.xml' (in the examples directory). I did not try but would expect the pins listed in the xml to show up in HAL.

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

Time to create page: 0.073 seconds
Powered by Kunena Forum