steveohara / j2mod

Enhanced Modbus library implemented in the Java programming language
Apache License 2.0
263 stars 112 forks source link

How to get response when I write a command using SerialConnection writeBytes() method #119

Closed aviral1999099 closed 2 years ago

aviral1999099 commented 2 years ago

Expected Behavior

I need a method to read response of the command I sent or in simple words, I want rx for a particular tx. Is their any particular method or we have to add listener, something like that.

Actual Behavior

Steps to Reproduce the Problem

1. 1. 1.

Specifications

aviral1999099 commented 2 years ago

I could not find a method to read a particular register, can you help me here. This is my ultimate task. I have already write the command but then how to get response for that particular command.

steveohara commented 2 years ago

I'm not sure what you're asking, seems kind of basic i.e. "how do I read a register using j2mod?" If that is the case, then please refer to the myriad of examples in the tests or look at the documentation https://github.com/steveohara/j2mod/wiki/Using-j2mod-to-read-from-a-Slave#read-input-registers

aviral1999099 commented 2 years ago

Thanks for your help. I actually did not phrased the question right. I just wanted to read register i.e. the value they are holding. I did find it by the way.

On Fri, 20 Aug, 2021, 11:07 pm steveohara, @.***> wrote:

I'm not sure what you're asking, seems kind of basic i.e. "how do I read a register using j2mod?" If that is the case, then please refer to the myriad of examples in the tests or look at the documentation https://github.com/steveohara/j2mod/wiki/Using-j2mod-to-read-from-a-Slave#read-input-registers

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/steveohara/j2mod/issues/119#issuecomment-902850578, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKSROVSFU74SZCI2GVNM3SLT52HFNANCNFSM5CMASODQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .