st-one-io / node-red-contrib-s7

A Node-RED node to interact with Siemens S7 PLCs
GNU General Public License v3.0
111 stars 58 forks source link

Behavior difference generating a loss of feature in 2.0.1 #49

Closed oceanezeisthewiw closed 5 years ago

oceanezeisthewiw commented 5 years ago

Hello !

We have been using 1.6.3 until now and there was a nice feature : it was possible to write multiple variables at once with this kind of code. msg.variable=["id","desc","start","end"]; msg.payload=[ obj.id, obj.desc , obj.start ,obj.end];

The issue is that in new version, this code : if (!writeObj.name) return; has been replaced with this : if (!node.endpoint.vars[writeObj.name]) { node.error(RED.("s7.error.varunknown", { var: writeObj.name })); node.status(generateStatus('badvalues', statusVal)); return; }

This is fine to check if one variable is correct but how can we send multiple variables at once now? Would it be possible to handle writeObj.name being a string or an array of strings ?

Best regards.

gfcittolin commented 5 years ago

Hi, good catch, I haven't thought about this use case. This change has been made because of #48, but we can handle the case we have an array like you've mentioned. I'll prepare a fix for that.

gfcittolin commented 5 years ago

Fix published in version 2.0.2, sorry for the regression and thanks for the report

oceanezeisthewiw commented 5 years ago

Thanks.