04-04-2011 01:33 PM
Hello fellow LabVIEW users
I have made a VI that pulls data from a spreadsheet and then manipulates the data in the various rows and columns to give a final spreadsheet of desired calculated values.
This VI works very well for me, except when I run it the first time around only, in which case it gives me non-sense values.
Could you please tell me what I am doing wrong with the block diagram. It could be a problem with data flow.
Thanks
mhaque
Solved! Go to Solution.
04-04-2011 01:39 PM
Without seeing your VI, we can only speculate as to what is wrong with your VI.
My guess is that you are using local variables and a race condition is causing data to be read from the local variables before valid data is written to them.
04-04-2011 01:41 PM
Sorry about that
here u go
04-04-2011 01:57 PM - edited 04-04-2011 02:04 PM
My guess was pretty good.
Yes you have a race condition. You are reading some values by way of a local variable at the top of your VI. But you don't actually write any values to those indicators until the first frame of your sequence structure. Either thing could happen first, but it is very likely your local variables are being read first. Thus default meaningless data. You should put those calculations in the first frame of the sequence structure. And use wires from the constants into the calculations rather than a local variable.
Actually, I don't know if you need to use local variables anywhere in your VI. And I also believe you can eliminate both your outer and inner sequence structures. You should always be using wires to define your data flow. Your inner sequence structure pretty much is doing this already. And if you get rid of your local variables and connect to the source of those values, no sequence structure, no local variables, and no race conditions.
Try this VI. I cleaned it up.