OpenPort - method of object PmComm

Open the serial/ethernet communication port of this object.
OpenPort(sParam As String) As Boolean
b = oComm.OpenPort(sParam)
sParam(String) Parameters for opening

for serial link: Only the port name is entered here. For example "COM1".

for Ethernet: The IP address and/or port number is entered. For example "ipaddress:;port:61682;". If any of the entries remain empty, then the previously entered value remains valid.

Return Values:
true -
for serial link: Port has been successfully opened.
for Ethernet: The parameters has been set and connection will be opened during the next transfer.
false -
for serial link: Port hasn't been opened. Possible fault: Such port is not present on this computer or it is already used.
for Ethernet: Because this method doesn't create a connection, false is return only if for bad input parameters.
This method cannot be used for PmComm object that contains PmCommMsg messages of the Slave type.
for serial link: The default setting of the serial communication port is defined in Serial port configurator in parameters of the serial link. If it is necessary to change dynamically the serial link port, then it is possible to set Not set in its parameters and than by the OpenPort and ClosePort methods change the port.

For serial link each PmComm object must have defined another communication port. For example, when one PmComm object communicates through COM1, then next PmComm object can communicate for example through COM2 (COM3,..) but it mustn't communicate through COM1.

for Ethernet: The method only adds new connection parameters into the object. The following transfer will close existing connection and open new connection.
for serial link: Algorithm called after the request for sending 1 message (by PmCommMsg object) through COM1 port.
VBScriptSelect and copy to clipboard

If oComm.OpenPort("COM1") Then
End If
for Ethernet: The IP address and port is set. The next calling of Run method will close previous connection and open new connection.
VBScriptSelect and copy to clipboard

oComm.OpenPort "ipaddress:;port:88;"
PROMOTIC 8.3.30 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice