08-06-2020 10:45 AM - edited 08-06-2020 10:54 AM
I am new to labview. I am writing flow rate data to file using a while loop. My sample rate is 0.25 (I read one sample every 4 seconds) and I don't have any timing vi in the while loop. When I stop my program, my output file contains many data beyond the stop time. The time value reads 0 for all the data logged after the stop time but the channel values contain valid data. What could be wrong please? I have screenshots attached. The extra data read is sometimes more than the main data read during the program execution.
Solved! Go to Solution.
08-06-2020 11:16 AM - edited 08-06-2020 11:23 AM
08-06-2020 11:27 AM
Thanks for the response. I actually used this project to learn labview so I have further questions please. What do I use in replacement for the dynamic data sections. I had to use them because I used one create channel vi to read all my 26 channels.
I think I can remove the time array local variables, however, in the two inner loops I have, I don't know how I can use the loops without using local variables, any suggestion on that will be appreciated.
Thanks.
08-06-2020 11:43 AM
@mikeOLU wrote:
What do I use in replacement for the dynamic data sections. I had to use them because I used one create channel vi to read all my 26 channels.
You have mostly orange, then merge and split via dynamic data. Most likely "built array" and "index array" will to exactly the same thing.
Dynamic data is very dangerous because they can contain a wide variety of data types and there is no way to tell by looking at the wire.
@mikeOLU wrote:
I think I can remove the time array local variables, however, in the two inner loops I have, I don't know how I can use the loops without using local variables, any suggestion on that will be appreciated.
Can you point to the "inner loops"? I can't find them. I only see a single loop. Did you attach the correct VI?
08-06-2020 11:50 AM
@altenbach wrote:
Can you point to the "inner loops"? I can't find them. I only see a single loop. Did you attach the correct VI?
If you are talking about the case structure stack, ask yourself the question how many times do you need to calculate e.g. CTD - TD (Or the related TD - CTD) nanoseconds apart? Once before the loop is sufficient, then wire to the places where the value is needed. Also, the terminal should be outside the case.
08-06-2020 11:51 AM
@altenbach wrote:
@mikeOLU wrote:
What do I use in replacement for the dynamic data sections. I had to use them because I used one create channel vi to read all my 26 channels.
You have mostly orange, then merge and split via dynamic data. Most likely "built array" and "index array" will to exactly the same thing.
Dynamic data is very dangerous because they can contain a wide variety of data types and there is no way to tell by looking at the wire.
@mikeOLU wrote:
I think I can remove the time array local variables, however, in the two inner loops I have, I don't know how I can use the loops without using local variables, any suggestion on that will be appreciated.
Can you point to the "inner loops"? I can't find them. I only see a single loop. Did you attach the correct VI?
I have attached a new image marking the inner loop. It is in the same VI.
I removed the local variable for the time array and the extra zero data don't appear anymore. Thank you so much.
However I want to also get to the root of the many local variables and the dynamic data.
08-06-2020 11:52 AM
Oh, I meant case structure, not loop.
08-06-2020 11:52 AM
@mikeOLU wrote:
I have attached a new image marking the inner loop. It is in the same VI.
My suspicion was right, these case structures are NOT loops! 😄
08-06-2020 12:06 PM
Two versions of you stack of case structures. I have the suspicion it could be dramatically simplified. This is currently a literal translation.
08-06-2020 01:02 PM
@altenbach wrote:
Two versions of you stack of case structures. I have the suspicion it could be dramatically simplified. This is currently a literal translation.
I thought case structure was a loop as well. Thanks for this. Do you mind uploading the VI you just updated? and any suggestion on replacing my dynamic data may be included too. Thanks.