01-30-2010 05:04 PM
Hello All,
I am trying to convert a string into numbers to be used for meters and numerical view and such. I have a string of numbers coming into the Labview Basic Serial Read & Write, this string of numbers is coming in from sensors on a microcontroller. I have 5 Analog and 4 Digital coming in, I need to seperate all these numbers so that they can each be sent th their own graph. Any Ideas on how to get this done?
01-30-2010 05:29 PM
01-30-2010 05:36 PM
The data is seperated by returns so if I am recieving from two analog and two digital sensors the data will look as followes:
125
33
0
1
01-30-2010 06:22 PM
The data is coming continuously in that format or after you send a specific command to the micro? If it's continuous, what you have is a random number generator. Since your read of the data stream would start at some unknown point, you have no way to know what number represents what sensor.
Assuming you have control over the micro code, you have some options. Rewrite it to only send data from each sensor after you send a command. Then you could do x number of reads. Rewrite to send a complete scan with each value separated by something (i.e. a comma) and the whole string terminated by a return. Rewrite to prepend a channel identifier to each number (i.e. Ch1=x).