Jump to content

Variable length strings in PMRC to REAL


Recommended Posts

Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...