.
Hi Dave,
I would recommend that you make efforts in getting the device itself to work properly, if at all possible; for the ASCII Object approach requires quite some work.
Anyway, if you want to use the ASCII Object to send the Modbus commands, you will have to first set it up so that the Requests (you send) and the Responses (you receive) are correctly formatted. This is done by using appropriate "format specifiers" in the RequestFormat and ResponseFormat datamembers. E.g., %s for string, %d for number, etc. Online help lists these and gives some examples.
Setting these RequestFormat and ResponseFormat is the toughest part. Once you've done this, you will use the RQVx datamebers to build your "message" and use the RSVx datamembers to receive t
he incoming response. Each RQVx corresponds to one format specifier in your RequestFormat. Similarly, each RSVx corresponds to one format specifier in your ResponseFormat. Then, you may want to build the final response by putting these RSVxs together.
During the testing, you can loop-back from one of your COM port to another using a null-modem cable. This is a great help in debugging. You will be able to see what message is being sent and can also simulate a response so that you can parse it out correctly.
Finally, when you're done with the message construction, and parsing the responses, you may want to use a DataTable with suitable Timers/Counters to automate the sending of the messages. More sophistication means more work, obviously.
Hope this helps,
Khalid 🙂
.