connect 2 Lcnc machine using mb2hal

More
3 years 10 months ago #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 ...
Code:
/* 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 ..
Code:
/* 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 to join the conversation.

More
3 years 10 months ago #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 to join the conversation.

More
3 years 10 months ago #260342 by db1981
sascha has done an modbus slave driver for lcnc:

github.com/sittner/linuxcnc-mbslave

Please Log in to join the conversation.

More
3 years 10 months ago #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 to join the conversation.

More
3 years 10 months ago #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 to join the conversation.

Time to create page: 0.079 seconds
Powered by Kunena Forum