AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones Modbus
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Closes the Modbus session.
This function disconnects the client from the Modbus server or slave and releases the serial port in the case of an RTU session.
New in version 2024
WEBDEV - Server codeWindows This function is now available for WEBDEV websites in Windows.
WEBDEV - Server codeLinux This function is now available for WEBDEV websites in Linux.
Example
// Create a session and connect to the Modbus slave through the COM4 serial port
Session is modbusSession
Session = ModbusConnectRTU("COM4")

// If the connection fails, display the error
IF ErrorOccurred = True THEN
Trace(ErrorInfo())
ELSE
// Write a value to register 0x42 in the slave
ModbusWriteRegister(Session, 0x42, 0xCAFE)
END

// Disconnection
ModbusDisconnect(Session)
Syntax
ModbusDisconnect(<Session>)
<Session>: modbusSession variable
Name of the modbusSession variable that corresponds to the Modbus session to be closed.
Business / UI classification: Business Logic
Component: wd290com.dll
Versión mínima requerida
  • Versión 26
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 17/11/2023

Señalar un error o enviar una sugerencia | Ayuda local