Giter VIP home page Giter VIP logo

Comments (4)

tin-dao avatar tin-dao commented on May 21, 2024

Dear Diti24,

I could successfully write data to OPC Server with writeSingleNode method. The problem is write data is not just simple as value =0 . It must have value and data type properties. For example:

dataToWrite = {
   dataType: "Int16",
   value: 0
}

Best Regards,
Tin Dao

from node-opcua.

Diti24 avatar Diti24 commented on May 21, 2024

Ok,
this was the trick :-).
I didn't found this info before.
Thanks

Dear Diti24,

I could successfully write data to OPC Server with writeSingleNode method. The problem is write data is not just simple as value =0 . It must have value and data type properties. For example:
dataToWrite = {
dataType: Int16,
value: 0
}

Best Regards,
Tin Dao


Reply to this email directly or view it on GitHub:
#28 (comment)

from node-opcua.

anson2004 avatar anson2004 commented on May 21, 2024

Hi,

I want to ask is it possible now to write a variable which ArrayDimensions is bigger than 1 (In my case, 256). I try

var  dataToWrite = {
   dataType: "Double",
   value: [1.2,1.2,1.2]
}
var value = 0;
the_session.writeSingleNode ("ns=3;s=MEM_09/2:CalSampleRate",dataToWrite, function(err,statusCode,diagnosticInfo) {
  if (!err) {
    console.log(" write ok" );
  } else {
    console.log(" write err = " ,err);
  }
  callback(err);

But it does not work.

Thanks,

Yiqing

from node-opcua.

erossignon avatar erossignon commented on May 21, 2024

Hi yping:
dataType shall be a DataType enum,
you probably need to specify the arrayType

var  dataToWrite = {
   dataType: opcua.DataType.Double,
   arrayType: opcua.VariantArrayType.Array
   value: [1.2,1.2,1.2]
}

from node-opcua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.