MB2HAL write

  • vre
  • Away
  • Platinum Member
  • Platinum Member
More
07 Jan 2025 02:57 - 07 Jan 2025 11:44 #318277 by vre
MB2HAL write was created by vre
I have got this modbus 16 I/O module 485io.com/io-isolation-protection-board-...relay-led-p-373.html
This is the manual 485io.com/eletechsup/N4D3E16-1.rar

I have used this config to mb2hal and i can read in hal all 16 inputs with success
[TRANSACTION_00]
LINK_TYPE=serial
SERIAL_PORT=/dev/ttyS0
SERIAL_BAUD=9600
SERIAL_BITS=8
SERIAL_PARITY=none
SERIAL_STOP=1
SERIAL_DELAY_MS=500
MB_SLAVE_ID=1
FIRST_ELEMENT=129
PIN_NAMES=mb1,mb2,mb3,mb4,mb5,mb6,mb7,mb8,mb9,mb10,mb11,mb12,mb13,mb14,mb15,mb16
MB_TX_CODE=fnct_03_read_holding_registers
But i can't write 16 outputs.
How can make it to work ?
How can i send custom command with mb2hal like this?
(slave address)0x01 (function)0x06 (number of output)0x0001 (command)0x05 (delay time)0x00 (2Bytes CRC)
Last edit: 07 Jan 2025 11:44 by vre.

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

More
07 Jan 2025 07:43 #318282 by Aciera
Replied by Aciera on topic MB2HAL write
Have you tried
MB_TX_CODE=fnct_16_write_multiple_registers

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

  • vre
  • Away
  • Platinum Member
  • Platinum Member
More
07 Jan 2025 11:43 - 10 Jan 2025 01:39 #318292 by vre
Replied by vre on topic MB2HAL write
edit
If write 256(dec) to hal pin opens
and if write 512(dec) to hal pin closes
Also works function 16..

How to write values 256 and 512 to hal pins need a python script to convert boolean value to 16bit hex ?
Last edit: 10 Jan 2025 01:39 by vre.

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

Time to create page: 0.047 seconds
Powered by Kunena Forum