.\" Copyright (c) 2016 Victor Rocco .\" .\" Victor Rocco, adapted from Les Newell's modbuscomms.c which is .\" Copyright (C) 2009-2012 Les Newell .\" source code in http://wiki.linuxcnc.org/cgi-bin/wiki.pl?ContributedComponents .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, .\" USA. .\" .\" .\" .TH mb2hal "1" "November 20, 2021" "Modbus to HAL" "LinuxCNC Documentation" .SH NAME \fBmb2hal\fR - HAL non-realtime component for Modbus .SH SYNOPSIS .TP Default component name: loadusr -W mb2hal config=config_file.ini .TP Custom component name: loadusr -Wn mymodule mb2hal config=config_file.ini .br .SH DESCRIPTION MB2HAL is a generic non-realtime HAL component to communicate with one or more Modbus devices. It supports Modbus RTU and Modbus TCP. .PP See .UR http://linuxcnc.org/docs/html/drivers/mb2hal.html .UE for more information. .SH PINS .SS fnct_01_read_coils: .TP .B mb2hal.m.n.bit\fR bit out .TQ .B mb2hal.m.n.bit-inv\fR bit out .SS fnct_02_read_discrete_inputs: .TP .B mb2hal.m.n.bit\fR bit out .TQ .B mb2hal.m.n.bit-inv\fR bit out .SS fnct_03_read_holding_registers: .TP .B mb2hal.m.n.float\fR float out .TQ .B mb2hal.m.n.int\fR s32 out .SS fnct_04_read_input_registers: .TP .B mb2hal.m.n.float\fR float out .TQ .B mb2hal.m.n.int\fR s32 out .SS fnct_05_write_single_coil: .TP .B mb2hal.m.n.bit\fR bit in NELEMENTS needs to be 1 or PIN_NAMES must contain just one name. .SS fnct_06_write_single_register: .TP .B mb2hal.m.n.float\fR float in .TQ .B mb2hal.m.n.int\fR s32 in NELEMENTS needs to be 1 or PIN_NAMES must contain just one name. Both pin values are added and limited to 65535 (UINT16_MAX). Use one and let the other open (read as 0). .SS fnct_15_write_multiple_coils: .TP .B mb2hal.m.n.bit\fR bit in .SS fnct_16_write_multiple_registers: .TP .B mb2hal.m.n.float\fR float in .TQ .B mb2hal.m.n.int\fR s32 in Both pin values are added and limited to 65535 (UINT16_MAX). Use one and let the other open (read as 0). .RE .SS Each transaction .TQ .B mb2hal.m.num_errors\fR u32 in Error counter .RE .br m = HAL_TX_NAME or transaction number if not set, n = element number (NELEMENTS) .br Example: .br mb2hal.00.01.int (TRANSACTION_00, second register) .br mb2hal.readStatus.01.bit (HAL_TX_NAME=readStatus, first bit) .SH AUTHOR Victor Rocco .SH LICENSE GPL