Jump to content

How to split a string to decimal?


Recommended Posts

Hi,

I'm a newbie with labview.

I use PIC microcontroller read data from TPA81 8 pixels temperature sensor and then it send all string format via rs232 to LV.

My protocol look like this "@32 33 32 11 44 22 33 44 55". (@ is start bit ,, and number are temperature value)

I want to use this string to display 8 temperature datas in waveform chart, how should I do with this string???

Best Regards,

Edited by lovemachinez
  • Like 1
Link to comment

Are you passing the temperature values over the RS232 in an ASCII format or binary? If you are passing them in a binary format, I recommend the String to Byte Array. If you are passing them in an ASCII format, look at the String/Number Conversion palette (it's under the String palette). These can get your string into numbers to then put into the graph.

Link to comment

Are you passing the temperature values over the RS232 in an ASCII format or binary? If you are passing them in a binary format, I recommend the String to Byte Array. If you are passing them in an ASCII format, look at the String/Number Conversion palette (it's under the String palette). These can get your string into numbers to then put into the graph.

Thank you very much. But I still have some problem you know, my data is a string format , so how can I split it.

for example, string = "32 22 34 54 31 55 12"

How can I split it to => 32 and 22 and 34 and 54 and ........ to put it into array[0],array[1],array[2],............

Best Regards,

Link to comment

Thank you very much. But I still have some problem you know, my data is a string format , so how can I split it.

for example, string = "32 22 34 54 31 55 12"

How can I split it to => 32 and 22 and 34 and 54 and ........ to put it into array[0],array[1],array[2],............

Best Regards,

If the separator (space, tab, comma, etc.) is fixed, you can use the primitive "Spreadsheet String to Array" from the string palette.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...

Important Information

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