User Tools

Site Tools

한국어

logicpython:cubloc_api:setmodbus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
logicpython:cubloc_api:setmodbus [2026/04/14 05:09] – [Parameters] mfranklinlogicpython:cubloc_api:setmodbus [2026/04/14 05:10] (current) – [Example] mfranklin
Line 69: Line 69:
 INPUT_PINS  = (6,  8,  10) INPUT_PINS  = (6,  8,  10)
 ADC_CHANS   = (0,  1,  2) ADC_CHANS   = (0,  1,  2)
- 
-coils           = bytearray(1) 
-discrete_inputs = bytearray(1) 
-input_regs      = bytearray(6) 
-holding_regs    = bytearray(2) 
-mem_lock        = _thread.allocate_lock() 
  
 for pin in OUTPUT_PINS: for pin in OUTPUT_PINS:
Line 82: Line 76:
     Input(pin)     Input(pin)
  
 +# Configure and start the Modbus RTU slave process
 UART_CHANNEL = 0 UART_CHANNEL = 0
 BAUD_RATE = 115200 BAUD_RATE = 115200
Line 87: Line 82:
 BUFFER_SIZE = 64 BUFFER_SIZE = 64
 SLAVE_ADDRESS = 1 SLAVE_ADDRESS = 1
 +
 +coils           = bytearray(1)
 +discrete_inputs = bytearray(1)
 +input_regs      = bytearray(6)
 +holding_regs    = bytearray(2)
 +mem_lock        = _thread.allocate_lock()
 +
 SetModbus(UART_CHANNEL, SetModbus(UART_CHANNEL,
     BAUD_RATE,     BAUD_RATE,
logicpython/cubloc_api/setmodbus.1776143352.txt.gz · Last modified: by mfranklin