Jump to content

EJSpin

Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Posts posted by EJSpin

  1. QUOTE(Mads @ Sep 28 2007, 01:26 PM)

    If the string is binary and has the MSB first then just wire the read string into a type cast and set the type to an array of integers. The resulting array can be wired directly into a graph terminal. If the string is LSB first then you'll need to swap the bytes prior to conversion, one simple way of doing that would be to just reverse the string, do the type cast and then reverse the resulting array. Make sure you have received an even number of bytes prior to convertion, otherwise the last number may be invalid...

    If the string is in readable form the conversion depends on whether it is in digital, hex or something else. If you take a subset of the string (two and two bytes at a time) you can use the string to number functions to get the number array for the graph.

    Regards,

    Mads

    Thank you both for the quick reply. I am taking the subset two bytes at a time right now. My microcontroller is sending me ASCII characters right now, say from 0 to 9. Each of those characters is a word right? I just want to know if maybe I'm supposed to convert my string to hex and then I won't need to subset my string anymore?

  2. I'm not really sure where this post belongs, so forgive me if it's in the wrong place.

    I'm creating an interface where I need to collect data from my microcontroller through serial port. This data needs to be read by 1 word(2 bytes) at a time.

    I need to know how to convert from a string to a word and view this data on a graph.

    I hope this makes sense to someone.

    Thanks

    ~EJSpin

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.