RickyQ

Variable length strings in PMRC to REAL

2 posts in this topic

Dear PMCR experts, i have a question.

I need to read a variable length ASCII string that represents a float via 232, i can get the data with PMCR but i am wondering if there is a way to programmatically parse this thing into a real.

Say you receive 2 frames over serial with delimiters of 0D0A:

Frame 1: 0D0A12.120D0A

Frame 2: 0D0A95525.54D0A

Now, if i just move the bytes over to a CJ, whether i choose to move them in ascii or hex i cannot use a standard instruction to FLT the binary. in Frame 1 i would have 5 bytes of data and for frame 2 i would have 8 bytes of data. if i move them in hex i would have half but i am still looking at bytes that represent char values and not a floating point encoded number.

Any ideas? Can i do this with protocol macro?

Share this post


Link to post
Share on other sites

i answered my own question. nevermind :D

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