Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiWrite: Error: parameter size not correct #28

Open
w570955342 opened this issue May 30, 2019 · 4 comments
Open

multiWrite: Error: parameter size not correct #28

w570955342 opened this issue May 30, 2019 · 4 comments

Comments

@w570955342
Copy link

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?

@herrJones
Copy link
Contributor

herrJones commented May 30, 2019 via email

@w570955342
Copy link
Author

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?

@michal-kindl
Copy link

michal-kindl commented Apr 8, 2020

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...

@CHoltschlag
Copy link

CHoltschlag commented Jul 10, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants