


WriteMultipleRegisters ( 1, 0, 5 ) _ = input ( "Wait for write Press ENTER:" ) if Win1. # Use the function > to create a data window This function do not create a window in Modbus Poll SRegisters ( 4, 10000 ) # Write the registers. SRegisters ( 1, 10 ) # Modbus address but an index to the array SRegisters ( 0, 1 ) # Note that parameter 1 is not a GetRxCount )) # Prepare the internal array in Modbus Poll with data to write ReadResult ) print ( "Tx count = % d, Rx count = % d" % ( Win1. SRegisters ( 0 )) else : print ( "Read failed error: = ", Win1. Rows ( 0 ) # Resize the window to fit to the grid ReadHoldingRegisters ( 1, 0, 10, 1000 ) # Show the Modbus window Dispatch ( "Mbpoll.Document" ) # Read 10 holding registers from slave ID 1, address 0 (40001) every 1000ms exit () #Create a Modbus display window called Win1

OpenConnection if result != 0 : print ( "Connection failed. ConnectTimeout = 500 # Wait 500ms until give upĪpp. DelayBetweenPolls = 20 # Ensure minimum 20 ms gap until next requestĪpp. ResponseTimeout = 1000 # Wait 1000ms until give upĪpp. Import sys import time import win32com.client as win32 App = win32. GetName ( 1 )) _ = input ( "Press ENTER to quit:" ) SetName ( 92, "DOUBLE_LE_BS" ) # Refresh SetFormat ( 92, DOUBLE_LE_BS ) # Set all Names to used format EnableRefresh = False # Set all different formats ReadHoldingRegisters ( 1, 0, 100, 1000 ) # Show the Modbus window

Dispatch ( "Mbpoll.Document" ) # Read 100 holding registers from slave ID 1, address 0 (40001) every 1000ms OpenConnection #Create a Modbus display window called Win1
