LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop Data lost?

I am losing data that is calculated, or better read, in a loop and I would like to not have to run my whole VI in this loop. I haven't seen this happen before and wonder if someone can let me know how I botched this up, I simplified the VI and am including a file to read an array from.

Anthony

Win XP
labview 7.1.1
0 Kudos
Message 1 of 11
(3,845 Views)
The array file. Thanks again for any help. I would like the two displays in the front to have the same value regardless of where they were in the block diagram ie in the loop or out. Thanks.

A
0 Kudos
Message 2 of 11
(3,838 Views)
you have a file read, but no attached file ... Why don't you just put an array control on the FP and load some example values into it. How big is the array normally? Have you over simplified the formula node? The elements Y2, X2 and element will ultimately show the last results of the last calculation,which appears to be just the last element in the original array, although the ones in the loop will show the intermediate values, once a second. What are you hoping for as an output?


P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 11
(3,831 Views)
my post and your second one must have passed in transit.

P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 4 of 11
(3,829 Views)
I am hoping to have a value like -10,-9.8... as an output at a given time interval. I chose one second so I could see it more clearly, eventually it will be tens of milliseconds. I will then output this to my board and try and form an image by raster scanning a laser across my sample. This is just a VI to raster scan I guess. My main problem is I do not want the writing VI to be in the loop because according to the people I bought it from that can cause issues. Any ideas?

Anthony
0 Kudos
Message 5 of 11
(3,810 Views)
Well you either have to have the "writing" code in the loop, or in an adjacent loop and pass your values to it, or lead the values to the edge of the loop and turn on auto indexing. This will create an array of those numbers (which I assume you expect to be different from the file values), which you can then pass to the code that will "write". So basically you are just trying to create a means to increment the numbers along one axis until you get to the last element, and then index to the next "row" and repeat? Why the file reads, etc.? Why not two nested for loops with the increment amount getting added to itself in each loop? I guess I'm missing something here.


P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 6 of 11
(3,807 Views)
When you say that putting it into the loop can cause problems, how do they purpose providing it with anything other than a static number? It would seem to have, at some level, to be in a loop.


P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 7 of 11
(3,805 Views)
I would like the number to be static for a given amount of time and then switch. Is it possible for the number in the loop to be brought out (or have a wire come out that has the information), and then as the loop runs itself once again after the pretdetermined amount of time, the number shows up out of the loop? This way I can take data at each point. I don't want to just have an increment added because I would like the number to go from let's say -10 to 10 and then back to -10. I can try putting the write file in an adjacent loop, that isn't a problem. I will give that a shot.

One thing that I am not sure about with what you said, why will my data be different? I would like it to be -10 if I am reading -10 out of the file. Will it do that ot do something else?

Thanks for all of your help!
0 Kudos
Message 8 of 11
(3,802 Views)
I guess I'm still not understanding. If your loop is running (including your pauses) the data can't be brought out directly with a wire, as that value won't, under LabVIEW's data flow, be present until the loop finishes running. You could make a local variable from each of your controls and then read them in another loop, where your "write" portion would be. There are other methods to communicate values from within a running loop to other locations in a program (including to completely different vi's) but we would need to understand what you are doing a little more, and I'm apparently having the mid afternoon intellectual slump.

P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 9 of 11
(3,799 Views)
So I drilled the tech guys where I bought the board and I am finding out that the write VI can be in the loop, there were some other issues, I actually got one leg of the VI to run. Could you please explain how to make the local variable? Would it just be with an equation loop?
0 Kudos
Message 10 of 11
(3,793 Views)