LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert to number

I'm using XBee to communicate with Sparkfun Sensor Stick. I want to display the data on labview. However, it currently looks like this.

 

inputtext.PNG

 

How do I convert it into an array of numbers so that I can display them on indicators?

I used String to Byte Array, but it does not work.

 

converttonumber.png

 

0 Kudos
Message 1 of 36
(3,554 Views)

Hi make...,

 

please switch the string display to "HEX display".

Then read the manual for your SensorStick. It should contain a paragraph on the formatting of those data. You NEED TO KNOW the data format before you can convert those data!

 

Converting string to byte array may be a starting point, but probably you also need to use some typecast here…

 

Btw. downscaling the snippet graphics seems to remove the embedded LabVIEW code. Either switch off scaling of the snippet or attach the real VI (with some typical data set to default for your "Read Data" string)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 36
(3,540 Views)

Also, a single byte seems a little low resolution for a measurement value like "gauge".......

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 36
(3,534 Views)

Oh! I've attached the VI.

 

I'll find out the data format. What do I do with that information then?

0 Kudos
Message 4 of 36
(3,523 Views)

Hi make...,

 

the manual will tell you how to decode your data stream...

 

Do you expect numbers like these:check.png?

Atleast the first two appear reasonable...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 36
(3,516 Views)

I couldn't find the manual. My sensor stick is connected to an Arduino Pro Mini. Here is the program. Can I use information from this program to figure out how to convert data stream?

 

I expect the numbers to be pitch, roll, yaw and altitude data.

0 Kudos
Message 6 of 36
(3,448 Views)

Hi make…,

 

I'm not that good in reading C code, but you might find the place, where bufTX[] is filled with data. Then you know how to interprete that message content…

 

Or ask "Remy DO" who wrote that program!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 36
(3,415 Views)

GerdW wrote:

Then read the manual for your SensorStick. It should contain a paragraph on the formatting of those data. You NEED TO KNOW the data format before you can convert those data!


Hi, what do you mean by "data format"?

0 Kudos
Message 8 of 36
(3,366 Views)

When you are working with some device, you need to understand the communication and data format or protocol) i.e. in which format it is sending is appearing. Information like position of data etc

 

when any device sends any data, for all the inforation it sends the position of data and protocol is fixed, you need to understand it. Find the manual

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 9 of 36
(3,358 Views)

The 3 manuals for the accelerometer, magnetometer and gyros are here.

 

I think this Sensor Stick uses a I2C protocol. 

0 Kudos
Message 10 of 36
(3,353 Views)