Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

JScript version of OPC-UA Write and specify data type example

More
18 Jul 2025 20:00 #14331 by Kyle.Oshima@caltrol.com
re: Please post your code here..., see JScript code below (see attached .zip file containing .js file as well as rudimentary .asp file to run JScript in web browser) -- btw, am running latest OPC Studio 2025.1 version available for download

try {
  var Client = new ActiveXObject( "OpcLabs.EasyOpc.UA.EasyUAClient" );

  var WriteValueArguments1 = new ActiveXObject( "OpcLabs.EasyOpc.UA.OperationModel.UAWriteValueArguments" );

  WriteValueArguments1.EndpointDescriptor.UrlString = "opc.tcp://ILDDEV-PROPLUS:9409/DvOpcUaServer";
  WriteValueArguments1.NodeDescriptor.NodeId.ExpandedText = "ns=2;s=0:EM1/PARAM1.CV";
  WriteValueArguments1.Value = 123.456;
  WriteValueArguments1.ValueTypeCode = 13;

  var arguments = [];

  arguments.push(WriteValueArguments1);

  var results = Client.WriteMultipleValues(arguments);

  Response.Write( results[0].Succeeded );
}
catch ( error ) {
  Response.Write( error.name + " : " + error.message );
}

 
   

 

File Attachment:

File Name: test-quickopc.zip
File Size:1 KB
  • Please Log in or Create an account to join the conversation.

    More
    18 Jul 2025 12:13 #14330 by support
    Hello.

    Please post your code here.

    Best regards

    Please Log in or Create an account to join the conversation.

    More
    18 Jul 2025 02:00 #14329 by Kyle.Oshima@caltrol.com
    Looking for JScript version of  Examples - OPC Unified Architecture - Write and specify data type  available in online documentation -- tried to convert language syntax from available VBScript version, but JScript returns following error:

    Unable to cast COM object of type 'System.__ComObject' to class type 'System.Object[]'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.

    Please advise.

    Please Log in or Create an account to join the conversation.

    Moderators: supportvaclav.zaloudek
    Time to create page: 0.141 seconds