ComponentConnectionMode Property
General info
Label |
Connection Mode |
Description |
Configure how the connection between the inmation core service and a remote component is established. |
Data type |
UInt32 |
Default value |
1 (syslib.model.codes.ComponentConnectionMode.PASSIVE) |
Type |
CodingGroup |
Code |
1812 |
Symbolic name |
MODEL_PROP_COMPONENTCONNECTIONMODE |
Lua access code |
syslib.model.properties.ComponentConnectionMode |
Available since |
1.10 |
- Parent properties
Attributes
| Name | Tooltip |
|---|---|
| PROP_CONFIGURABLE | The property is configurable and can be changed with DataStudio and the various inmation APIs. |
| PROP_VISIBLE | The property is visible in DataStudio and can be read by the inmation APIs. |
| PROP_HAS_DEFAULT | The property has a default value as standard. |
| PROP_SET_ONCE | This Property can never be changed. |
Codings
Coding group: ComponentConnectionMode
| Name | Code | Label | Tooltip |
|---|---|---|---|
PASSIVE |
1 |
Passive |
The remote component passively listens for connection requests from the Core service. |
ACTIVE |
2 |
Active |
The remote component actively sends connection requests to the Core service. |
Examples
Read from or write to the ComponentConnectionMode property.
-- Read from the ComponentConnectionMode
syslib.getvalue("<OBJECT FULL PATH>.CommunicationSettings.ComponentConnectionMode")
-- Write to the ComponentConnectionMode
syslib.setvalue("<OBJECT FULL PATH>.CommunicationSettings.ComponentConnectionMode",
syslib.model.codes.ComponentConnectionMode.PASSIVE)
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "<username>", Password = "<password>" };
StatelessInterface sli = new StatelessInterface(tcpcfg);
// Read from the ComponentConnectionMode
Result result = sli.ReadValue(sc, new ReadItem("<OBJECT FULL PATH>.CommunicationSettings.ComponentConnectionMode"));
// Write to the ComponentConnectionMode
Result result = sli.WriteValue(sc, new WriteItem(ComponentConnectionMode.PASSIVE, "<OBJECT FULL PATH>.CommunicationSettings.ComponentConnectionMode"));
A switch-like function of the codings.
function get_coding_name(code)
local _ccm = syslib.model.codes.ComponentConnectionMode
if _ccm.PASSIVE==code then return 'PASSIVE'
elseif _ccm.ACTIVE==code then return 'ACTIVE'
end
end
return get_coding_name(syslib.model.codes.ComponentConnectionMode.PASSIVE)