erwinnd Posted January 6, 2022 Report Posted January 6, 2022 Hello everyone, I'm currently communicating with a device using RS232. I'm using the build message function to convert a message from message composer to a buffer. Then I transmit the message using the COM Tx function. I then receive a certain amount data packets and use the COM Rx to convert these into a buffer. I programmed my own function to convert the values of this Rx buffer into a proper response but it is very inefficient because I manually check each index of the buffer for its value and convert it to the corresponding numeric value. I think the Parse Message function is build to do this job for you, however, I can't seem to figure out how to use it to convert a buffer into a message. Can anyone explain the usage of the Parse Message function? Thanks in regards!
AlexUT Posted January 6, 2022 Report Posted January 6, 2022 1. You have to pass to Parce function full message. In case you youse RS232 ot low speed, PLC will read fragments of full message at each scan. To read a full message, you have to check "Last Bytes waiting in Buffer" for your RS232 to be a string termination character, And only then read buffer. After this you can parce buffer content.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now