
Īs I said, Object Pascal and Javascript deal with dates differently. The System.Types unit defines a type alias type TDateTime = Float. Smart Mobile Studio Smart Mobile Studio represents a DateTime type as a Float type, similar to TDateTime. It is used to hold a date and time combination. In Delphi, Date and time processing depends on the TDateTime variable. Because they are a surprisingly complex and rich subject matter. Sadly dates coming from JS to SmartMS can be a issue. Since Object Pascal and Javascript deal with dates quite differently. WScript.Echo "ServerTimestamp: " & AttributeData.Why have a tutorial just on dates and times? WScript.Echo "Value: " & AttributeData.Value WScript.Echo "*** Failure: " & Err.Source & ": " & Err.Description On Error Resume Next Dim AttributeData: Set AttributeData = Client.Read( "", _ Option Explicit ' Instantiate the client objectĭim Client: Set Client = CreateObject( ".EasyUAClient") OutputText = OutputText & "StatusCode: " & AttributeData.StatusCode & vbCrLf OutputText = OutputText & "SourceTimestamp: " & AttributeData.SourceTimestamp & vbCrLf OutputText = OutputText & "ServerTimestamp: " & AttributeData.ServerTimestamp & vbCrLf OutputText = OutputText & "Value: " & AttributeData.value & vbCrLf OutputText = OutputText & "*** Failure: " & Err.Source & ": " & Err.Description & vbCrLf On Error Resume Next Dim AttributeData As UAAttributeData By default, the Value attribute of a node will be read. OutputText = "" ' Instantiate the client object
#Free pascal convert timestamp to date how to
Rem This example shows how to read and display data of an attribute (value, timestamps, and status code). Mle_outputtext.Text = mle_outputtext.Text + "StatusCode: " + String(attributeData.StatusCode) + "~r~n" // Example output: Mle_outputtext.Text = mle_outputtext.Text + "SourceTimestamp: " + String(attributeData.SourceTimestamp) + "~r~n" Mle_outputtext.Text = mle_outputtext.Text + "ServerTimestamp: " + String(attributeData.ServerTimestamp) + "~r~n" Mle_outputtext.Text = mle_outputtext.Text + "Value: " + String(attributeData.value) + "~r~n" Mle_outputtext.Text = mle_outputtext.Text + "*** Failure: " + oleRuntimeError.Description + "~r~n" RETURN END TRY // Display results Mle_outputtext.Text = "" // Instantiate the client objectĬlient.ConnectToNewObject( ".EasyUAClient")ĪttributeData = client.Read( "", "nsu= i=10853") // or "opc.tcp://:51210/UA/SampleServer" WriteLn( 'SourceTimestamp: ', DateTimeToStr(AttributeData.SourceTimestamp)) WriteLn( 'ServerTimestamp: ', DateTimeToStr(AttributeData.ServerTimestamp)) WriteLn( 'Value: ', AttributeData.Value) By default, the Value attribute of a node will be This example shows how to read and display data of an attribute (value,Ĭlient: OpcLabs_EasyOpcUA_TLB._EasyUAClient Release all interface pointers BEFORE calling CoUninitialize() _tprintf(_T( "StatusCode: %s\n"), (LPCTSTR)CW2CT(AttributeDataPtr->StatusCode->ToString)) _tprintf(_T( "SourceTimestamp: %s\n"), (LPCTSTR)CW2CT((_bstr_t)vString)) VString.ChangeType(VT_BSTR, &_variant_t(AttributeDataPtr->SourceTimestamp, VT_DATE)) _tprintf(_T( "ServerTimestamp: %s\n"), (LPCTSTR)CW2CT((_bstr_t)vString)) VString.ChangeType(VT_BSTR, &_variant_t(AttributeDataPtr->ServerTimestamp, VT_DATE)) VString.ChangeType(VT_BSTR, &AttributeDataPtr->Value) _UAAttributeDataPtr AttributeDataPtr = ClientPtr->Read( _EasyUAClientPtr ClientPtr(_uuidof(EasyUAClient))


#include "Read.h" namespace _EasyUAClientĬoInitializeEx(NULL, COINIT_MULTITHREADED) #include "stdafx.h" // Includes "QuickOpc.h", and other commonly used files By default, the Value attribute of a node will be read.ĪttributeData = client.Read(endpointDescriptor, "nsu= i=10853") Ĭonsole.WriteLine( $"*** Failure: ", attributeData.StatusCode)


UAEndpointDescriptor endpointDescriptor = This example shows how to read and display data of an attribute (value, timestamps, and status code).
