// This example shows how to write a value, timestamp and quality into a single item.
class procedure WriteItem.Main;
var
Client: OpcLabs_EasyOpcClassic_TLB._EasyDAClient;
begin
// Instantiate the client object
Client := CoEasyDAClient.Create;
try
Client.WriteItem('', 'OPCLabs.KitServer.2', 'Simulation.Register_I4', 12345, EncodeDate(1980, 1, 1), DAQualities_GoodNonSpecific);
except
on E: EOleException do
begin
WriteLn(Format('*** Failure: %s', [E.GetBaseException.Message]));
Exit;
end;
end;
end;
Rem This example shows how to write a value, timestamp and quality into a single item.
Private Sub WriteItem_Main_Command_Click()
OutputText = ""
' Instantiate the client object
Dim client As New EasyDAClient
On Error Resume Next
Call client.WriteItem("", "OPCLabs.KitServer.2", "Simulation.Register_I4", 12345, DateSerial(1980, 1, 1), DAQualities_GoodNonspecific)
If Err.Number <> 0 Then
OutputText = OutputText & "*** Failure: " & Err.Source & ": " & Err.Description & vbCrLf
Exit Sub
End If
On Error GoTo 0
End Sub
Rem This example shows how to write a value, timestamp and quality into a single item.
Option Explicit
Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.DataAccess.EasyDAClient")
On Error Resume Next
Client.WriteItem "", "OPCLabs.KitServer.2", "Simulation.Register_I4", 12345, DateSerial(1980, 1, 1), 192
If Err.Number <> 0 Then
WScript.Echo "*** Failure: " & Err.Source & ": " & Err.Description
WScript.Quit
End If
On Error Goto 0