LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Processing raw data from sensors

Dear all,

 

Please let me to explain you the problem I'm dealing with. I'm trying to get some data from sensor and store them into a .txt file via serial RS485 communication. Communication itself is not a problem - I have a VI for reading holding registers of a sensor, but processing of this raw data is where I have stuck.

 

Here is an example of what I have to do:

What do I have:

0000 0199 0001 00EC ... (string displayed in HEX format)

What do I want:

[409, 65772, ...] (converted string into integer/decimal format, data type: array of integers/decimals)

00000199 -> 409

000100EC -> 65772

 

Best regards,

Marko

 

Edit: As it usually is, after posting this found an answer: http://forums.ni.com/t5/LabVIEW/Convert-string-to-integer-array/td-p/986540

 

0 Kudos
Message 1 of 4
(2,323 Views)

Use type cast function.


0 Kudos
Message 2 of 4
(2,305 Views)

Can this Type cast function be defined with different input types?

 

Example of array structure:

1-10 unsigned long

11-15 signed long

16-30 unsigned long

 

I know that I can split this array in 3 arrays, and then cast each of these arrays independently. But can this be done with a single type cast function?

0 Kudos
Message 3 of 4
(2,297 Views)

No.  An array can only consist of one type of data.

 

Also, a typecast function can only cast a number to a single type.

0 Kudos
Message 4 of 4
(2,280 Views)