Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Parse one String (containing numbers) into two Arrays and display results in meter (eg thermometer)

Firstly, I wanted to thank you for your time and for showing some interested in helping me out.

 

Now, you're right, it should be 10, I was possibly testing something when I took the snapshot

 

I have found a way of seperating the strings using the split string function. It works fine as I have a total of 10 bytes, 5 for temp, 5 for pres.

 

The problem starts when converting the string into an array.

 

 e.g Temp of 247  and Pres of 26987 will result in 12850. In this VI I have two seperate strings, two u8 conversions and one index array, gives out one joint element.

 

Regarding the latest VI I've posted, trying to read 10 bytes from the port gives a Temp of 12320 and Pres of 12856

 

When highlightin the process I can see the numbers changing in the conversion bit(sounds logical) but also the arrangement of the numbers in the string.

 

e.g 251  28309 becomes 1  28309 *

 

I am a bit stuck....really 

 

Would a header help  e.g AA and have 12 bytes?

 

 

Thank you

 

Stav

0 Kudos
Message 11 of 15
(1,634 Views)

Now it seems to output the numbers in the right order but still something not right

 

Here's what happening while itterations occur

0 Kudos
Message 12 of 15
(1,628 Views)

First and second itterations give out these two results, the rest up to ten give ##

 

Numbers are possibly displayed right in the string now as I have added a 1 second delay 

 

Any thoughs would be greatly appreciated 

 

 

Thank You

0 Kudos
Message 13 of 15
(1,624 Views)

I don't understand your logic with the FOR loop.  I thought you were putting out ASCII characters.

 

The coerce to a U16 is not needed.  The output of the Join Numbers is a U16.

 

You only have 2 numbers.  So your FOR loop should only iterate twice.

 

I don't think you want to just keep adding to your string.  Just grab one message and process it.

 

Instead of the Type Cast, you really want the Array to Cluster.  Be sure to change the cluster size to 2.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 15
(1,621 Views)

Thank you for the reply

 

I have changed everything but nothing changes

 

I wanted to output the temp and pres values into virtual meters, such as thermometer, thus the conversion and the for loop

 

That is  the only thing troubling me now, how to convert the string so I display these values in a meter

 

 

Stav

0 Kudos
Message 15 of 15
(1,617 Views)