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:" ) Save ( "C: \\ Users \\ UserName \\ Desktop \\ testfile.mbp" ) print ( result ) print ( Win1. 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
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |