sParam | (String) Parameters for opening:
- for Ethernet-client:
Entries are in the KeyVal format, for example "ipaddress:192.168.0.126;port:61682;connect:1;". - ipaddress: The value can be the IPv4 address, IPv6 address or computer name. See the "Network address" configurator
- port: Port. See the "TCP/UDP remote port number" configurator
- connect: The way to open the port.
0 (default) - The method only adds new connection parameters into the object. The following transmission will close existing connection and open new connection.
1 - The method adds new parameters into the object, close existing connection and open new connection.
The method will just give the command to open, i.e. the connection may not yet be open after this method is completed. If the empty string ("") is entered, then the parameters are not changed, it just opens a connection with existing parameters. This method cannot be used for the PmaComm object that contains PmaCommMsg object of the Slave type. - for Ethernet-server:
Entries are in the KeyVal format, for example "port:61682;". - port: Port. See the "TCP/UDP port number" configurator.
The port can be changed only if it was previously set to 0 (i.e. if in the "TCP/UDP port number" configurator it was set to 0). Change the port (i.e. initializing it with a script) can be e.g. in the onStart event. - for serial link:
Only the serial port name is entered here. For example "COM1". For serial link each PmaComm object must have defined another communication port. For example, if one PmaComm object communicates through COM1, then next PmaComm object can communicate for example through COM2 (COM3, …) but it mustn't communicate through COM1. This method cannot be used for the PmaComm object that contains PmaCommMsg object of the Slave type. |
---|
oComm.OpenPort("ipaddress:192.168.0.2;port:88;");
oCommMsg.Run();
if (oComm.OpenPort("COM1"))
{
oCommMsg.Run();
}