OpcHdaInsertReplaceMode Property
General info
Label |
HDA Insert / Replace Mode |
Description |
Defines how historical insert and replace operations are handled by the OPC server. |
Data type |
UInt32 |
Default value |
3 (syslib.model.codes.OpcHDAInsertReplaceMode.CONVERT) |
Type |
CodingGroup |
Code |
2419 |
Symbolic name |
MODEL_PROP_OPCHDAINSERTREPLACEMODE |
Lua access code |
syslib.model.properties.OpcHdaInsertReplaceMode |
Available since |
1.30 |
- Parent classes
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. |
Codings
Coding group: OpcHDAInsertReplaceMode
| Name | Code | Label | Tooltip |
|---|---|---|---|
ALLOW |
1 |
Allow |
Allows costly insert and replace operations. |
REJECT |
2 |
Reject |
Rejects costly insert and replace operations. |
CONVERT |
3 |
Convert to Upsert |
Converts costly insert and replace operations to fast upsert operations. |
Examples
Read from or write to the OpcHdaInsertReplaceMode property.
-- Read from the OpcHdaInsertReplaceMode
syslib.getvalue("<OBJECT FULL PATH>.OpcHdaInsertReplaceMode")
-- Write to the OpcHdaInsertReplaceMode
syslib.setvalue("<OBJECT FULL PATH>.OpcHdaInsertReplaceMode",
syslib.model.codes.OpcHDAInsertReplaceMode.ALLOW)
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "<username>", Password = "<password>" };
StatelessInterface sli = new StatelessInterface(tcpcfg);
// Read from the OpcHdaInsertReplaceMode
Result result = sli.ReadValue(sc, new ReadItem("<OBJECT FULL PATH>.OpcHdaInsertReplaceMode"));
// Write to the OpcHdaInsertReplaceMode
Result result = sli.WriteValue(sc, new WriteItem(OpcHDAInsertReplaceMode.ALLOW, "<OBJECT FULL PATH>.OpcHdaInsertReplaceMode"));
A switch-like function of the codings.
function get_coding_name(code)
local _ohdairm = syslib.model.codes.OpcHDAInsertReplaceMode
if _ohdairm.ALLOW==code then return 'ALLOW'
elseif _ohdairm.REJECT==code then return 'REJECT'
elseif _ohdairm.CONVERT==code then return 'CONVERT'
end
end
return get_coding_name(syslib.model.codes.OpcHDAInsertReplaceMode.ALLOW)