srsicard3

converting rs232 data

5 posts in this topic

Hello, I am trying to receive data from a scale via rs232. my setup; compact logix l18er with a 1734-rs232ascii point IO module to receive the data.

I am receiving data from the scale, but I have very little understanding of ascii, so I do not know how to convert the data I am receiving to something use-able.

any help on how to convert the data to something I can use or where to even start would be much appreciated.

using a scientech ZSA 210 scale

https://scientech-inc.com/media/downloadable/files/links/1/2/12222-d_rev-f_instruction_manual.pdf

Share this post


Link to post
Share on other sites

Pretty sure this has been asked and answered many times, suggest you search the forum.

Share this post


Link to post
Share on other sites

yes it has, but I could not figure out a solution based on what I had found

I guess I am just looking for the proper way to have the ASCII characters buffer in a tag that i can convert to a DINT or SINT so i can process it.

Share this post


Link to post
Share on other sites

srsicard3 - I am guessing because you did noy uplaod a copy of your program that you're looking at the data ina tag and trying to figure out what to do with it.  Been a while since I've had to mess with Serial Data, but String Parsing Instructions will be your worst enemy of your best friend.

Share this post


Link to post
Share on other sites

Once you've got the string from the device into a string tag in the Compactlogix, you'll probably want to isolate the variable data to another string tag that you can perform a conversion on.  See the MIDSTR instruction for that.  Then depending on what data you need, either the STOD instruction for conversion to a DINT, or the STOR instruction for conversion to a real.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now