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

using a modbus master simulator software with this library #81

Open
mushfiq-heraclius-xen opened this issue Jul 12, 2021 · 10 comments
Open

Comments

@mushfiq-heraclius-xen
Copy link

can any body tell me which modbus simulator software is better to use with this library , i have used "Simply Modbus Master " simulator and tried writing/reading data to register number 40001 , didn't get any response or anything

@ysmilda
Copy link
Contributor

ysmilda commented Jul 12, 2021

What kind of program where you running for this test?

@mushfiq-heraclius-xen
Copy link
Author

@ysmilda
Copy link
Contributor

ysmilda commented Jul 12, 2021

I meant the program on the microcontroller, sorry for the confusion.

@mushfiq-heraclius-xen
Copy link
Author

@ysmilda
Copy link
Contributor

ysmilda commented Jul 12, 2021

The way that example is set up it isn't possible to read anything at register 40001. You'd have better luck when reading registers 0,1,2 with fc 4. This reads out the set analog input values.

This library can adhere to the standard offsets, but doesn't do so in the examples. This ability to use any registry makes it quite flexible.

@mushfiq-heraclius-xen
Copy link
Author

ok thank you! but can you tell me what values i have to write for fc=05 or 15 to make output pins HIGH ??

@mushfiq-heraclius-xen
Copy link
Author

Force Single Coil (FC=05) and Force Multiple Coils (FC=15) and set the corresponding digital output pins (coils).

@mushfiq-heraclius-xen
Copy link
Author

what values i have to write from the modbus rtu master simulator software for fc=05 or 15 to make output pins HIGH ??

@ysmilda
Copy link
Contributor

ysmilda commented Jul 12, 2021

I was mistaken, for reading the analog sensors FC04 should be used.

When writing a 1 to register 0 to 3 when using FC05 the digital outputs should be set to high.

@paxsipornax
Copy link

readRegister = slave.readCoilFromBuffer(40001) How can I write a code like
I want to read the data in plc 40001 register but failed

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

3 participants