04-26-2017 04:51 AM
Hi 🙂
what am I doing wrong converting a string to a double array?
It works to convert the incoming string to a string-array but not to convert it to a doublearray.
Any ideas?
Cheers, Anna
Solved! Go to Solution.
04-26-2017 04:54 AM
04-26-2017 06:06 AM
Hi GerdW,
I guess, changing the regional settings is not the correct way 😉
Your formatstring is working, although I do not understand it 100% right now.
I have to work into these formatstrings.
Thanks 🙂
Anna
04-26-2017 06:33 AM
@labviewis3 wrote:
Your formatstring is working, although I do not understand it 100% right now.I have to work into these format strings.
The problem was that your regional settings use the comma as the decimal point while the data you read uses the period. The "%.;" part of the format string tells the parser to use the period as the decimal point regardless of the regional settings (default to using the local regional setting). The "%f" is telling the parser to parse a floating point number.
04-26-2017 06:35 AM - edited 04-26-2017 06:36 AM
Hi again 🙂
there are 2 things I don't understand aswell.
1)
I do have those voltage values in a numeric array, perfect. Now I plot them in a diagramm.
How do I prevent the voltage going down to zero every loop? I thought to use shift registers? I tried to implement those structures in my vi but didn't succeed. Is this the right way?
2)
I want all 24 voltages out of my array simultaneously being plotted into my diagramm.
Old values are supposed to time out... lets say after 30 sec or so, is that possible in labview?
Thank you very much for your help 🙂
Anna
04-26-2017 07:18 AM
Time to take a step back. Where is this data coming from? What is the exact format of the data? How do you know you got all of your data? Does the message end with a special character (termination character) so that you know you got all the scanned data?
04-26-2017 07:42 AM
hi crossrulz,
the data is the output of a voltage measuring device. In my VI, I ask the device to give me the latest voltages. The output of the device comes via serial port, for example:
0.3353,0.3362,0.3369,0.3353,0.3350,0.3351,0.3366,0.3366,0.3380,0.3359,0.3363,0.3359,0.0006,0.0001,0.0000,0.0002,0.0001,0.0000,0.0000,0.0000,0.0001,0.0002,0.0001,0.0000
To ensure, I got all the data, I implemented a Delay Before Read (mS) procedure.
I don't have a special termination character. I just read all bytes that arrived at the serial port.
thanks and regards
anna
04-26-2017 08:11 AM
ok, I now used a cluster to plot. should do the job! 🙂
04-26-2017 10:28 AM
labviewis3 wrote:
To ensure, I got all the data, I implemented a Delay Before Read (mS) procedure.
I don't have a special termination character. I just read all bytes that arrived at the serial port.
That is typically a BAD way to do it. What if the instrument happens to be a little slow? Hint: you will lose data. What happens if the instrument fast? You wait unnecessarily. Every single instrument I have ran into that transmits data as human readable text ends the transmission with a termination character, typically a Carriage Return or a Line Feed. So it would be much better to use that by enabling the Termination Character on the VISA Configure Serial Port and just telling the VISA Read to read more bytes than you expect in a message.
So what is the make and model of the device sending this data to you? Do you have a link to the manual?