plcpeople / nodeS7

Node.JS library for communication to Siemens S7 PLCs
MIT License
356 stars 120 forks source link

I want to know how to use the 'values' to vue component's data #139

Open ldj011210 opened 1 year ago

ldj011210 commented 1 year ago

function valuesReady(anythingBad, values) { if (anythingBad) { console.log("SOMETHING WENT WRONG READING VALUES!!!!"); } console.log(values); doneReading = true; if (doneWriting) { process.exit(); } } Where does this values come from, and how can I apply it to vue's components data()

plcpeople commented 1 year ago

values is the object created and returned by nodeS7 with the variable values from the PLC.

To get this into vue, you'd probably want to build a vue + NodeJS project, where NodeJS is the web server for the project. There are lots of examples if you google "vue node.js server example" and at least one of these should show how an object that exists on the server can work the way you're asking.

I will leave the issue open in case anyone else wants to submit a PR with an example or wants to comment more, but we don't use vue.