multiWrite: Error: parameter size not correct
Hi @PLCHome ,
I was trying to use multiWrite to pass the array to the beckhoff machine. But when I pass the array I got an exception of 'parameter size not correct' Here is the handle that I pass through:
var myHandle = [{ symname: 'Main.b', bytelength: ads.INT, value: 200 }, { symname: 'Main.c', bytelength: ads.BOOL, value: true }]
Did I do something wrong?
Did you try using 0 and 1 instead of false and true?JanOp 30 mei 2019 08:58 schreef w570955342 [email protected]:Hi @PLCHome , I was trying to use multiWrite to pass the array to the beckhoff machine. But when I pass the array I got an exception of 'parameter size not correct' Here is the handle that I pass through: var myHandle = [{ symname: 'Main.b', bytelength: ads.INT, value: 200 }, { symname: 'Main.c', bytelength: ads.BOOL, value: true }] Did I do something wrong?
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.
Thanks for your answer. I did not use 0 and 1 instead of false and true. var myHandle = [ { symname: 'Main.c', bytelength: ads.BOOL, value: true }] or var myHandle = [{ symname: 'Main.b', bytelength: ads.INT, value: 200 }] is OK with multiWrite , but var myHandle = [{ symname: 'Main.b', bytelength: ads.INT, value: 200 }, { symname: 'Main.c', bytelength: ads.BOOL, value: true }] is not ok. Throw the error : parameter size not correct.
Did you try using 0 and 1 instead of false and true?JanOp 30 mei 2019 08:58 schreef w570955342 [email protected]:Hi @PLCHome , I was trying to use multiWrite to pass the array to the beckhoff machine. But when I pass the array I got an exception of 'parameter size not correct' Here is the handle that I pass through: var myHandle = [{ symname: 'Main.b', bytelength: ads.INT, value: 200 }, { symname: 'Main.c', bytelength: ads.BOOL, value: true }] Did I do something wrong?
I also run into the same issue. And exactly as you write, with only single handle in the array it works, with more it always fails...
Hello @all
there is a bug in the function multiWrite on line 384 to 386.
Change to the following code:
buf.writeUInt32LE(handle.indexGroup || ADSIGRP.RW_SYMVAL_BYHANDLE, index + 0)
buf.writeUInt32LE(handle.indexOffset || handle.symhandle,index + 4)
buf.writeUInt32LE(handle.totalByteLength,index + 8)
I hope this helps!
regards