07-31-2009 09:05 AM
Hello,
I am a complete LabView beginner so please bear with me. I am changing from a string to a floating point in the attached vi. I would like to preserve all of the data as it appears in the string. How do I format the data (ie the %f) in the example shown.
Regards,
Nevica
07-31-2009 09:17 AM
In what format do the channel string come? In what format do you want them? Have you tried using either the decimal string to number or the fract/hex string to number?
Give either of them a try and see if your number is truncated in any way.
07-31-2009 09:35 AM
I suspect your indicators are hidding the extra decimal places. Right-click the indicator and check the number of decimal places.
Ben
07-31-2009 10:31 AM - edited 07-31-2009 10:35 AM
Hello,
When I run the I/O routine (see attachment) it creates a variable of type string. For some reason this is creating an error at the next step (see attachment). How can I solve this?
Also, in the first attachment, when I parse the string I am concerned that it is not picking up the whole of the string as the data length changes from one to the next. Does pressing 'To end of data' underneath 'character count' change every time it parses or does it stay constant and that character length?
Nevica
07-31-2009 11:04 AM
Hello,
Additionally, I am creating an array with three columns from 1 second streamed data on three data channels. I want to create a file something like this:
Time Stamp channel 1 channel 2 channel 3
0 x y z
1s x y z
2s x y z
and so on.
I have a vi created thus (see attachment). Is this the best way off doing this?
Nevica
07-31-2009 01:19 PM
You should build an 1D array for each channel's data in a shift register.
Then pass each of these 1D arrays into a 'build array' so you have all the columns.
Also, since you have a time delay of 1000 ms (= 1 second), you can just wire the iteration number as your time column.
To handle column headers, you can write a 1D array of strings to the file before you write the data.
07-31-2009 05:02 PM - edited 07-31-2009 05:03 PM
Cory's example has several errors:
08-03-2009 03:45 AM - edited 08-03-2009 03:47 AM
Hello,
I am a complete VI beginner and I don't understand why the "capture10.jpg" will not work. I get the error "capture9.jpg". What am I doing incorrectly? I am taking the three outputs channel1, 2 and 3, changing them from strings to floating points and then creating a matrix from these three outputs. But I get the error as shown.
Nevica
08-03-2009 04:23 AM - edited 08-03-2009 04:33 AM
Hello,
I am a complete LabView beginner so please bear with me. When I run the I/O routine (capture7.jpg) it creates a variable of type string. For some reason this is creating an error at the next step (capture9.jpg). How can I solve this?
Also, in the first attachment, when I parse the string I am concerned that it is not picking up the whole of the string as the data length changes from one to the next. Does pressing 'To end of data' underneath 'character count' change every time it parses or does it stay constant and that character length? Also the data output may have a "square" at the end of it and I am concerened that this is the problem. What does this square mean and could it mean the problem in my data reading? At the next step where the string is changed into a DBL do I need to format the data at this stage. If so, how do I do that and in what form does the data have to be? Any help would be very much appreciated.
Nevica |