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

I've implemented modbus client request/responses 1-6,15,16 #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

behrat
Copy link

@behrat behrat commented Jun 9, 2013

The device I'm currently working with only supports functions 1,2,5,15,16, so the others are untested. The code should be the other functions should be very similar, but still... untested. The device also only has a single coil to test with.

Thanks for your previous work. Hopefully you can push this to the npm repository. :)

-Braden

@behrat
Copy link
Author

behrat commented Apr 27, 2015

Hi amechti,

Here's what I'm using in some of my code:

var req = client.request(
        modbus.FUNCTION_CODES.WRITE_MULTIPLE_REGISTERS,
        16, // Start at this register address
        [52429,15820] // Make an array for all the consecutive registers you want to write
);

The starting address is 16 in this example, the values are in the array, and the quantity is determined by the array length.

throw new Error('"Write Multiple Coils" expects 1 to 1968 registers');
}

values.map(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not assigning the result of map() to anything here!

@amechti
Copy link

amechti commented May 20, 2015

I'm really sorry to be late for my response.
Thank you very much behrat it's done .
TooTallNate i'havn't understand your question !!

@lamyra
Copy link

lamyra commented Jun 10, 2015

Hi,
Please i need to have an fonction that englobe all of function for example function 1 2 and 3 in the same ap.js. Not need to change code function every time.
And i need to know if i can enter code function and address from my interface and have the result not from console Thanx

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

Successfully merging this pull request may close these issues.

4 participants