LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to creat different data files in interconnected loops.

HI all
I am new to labview and have a problem. I have two interconnected FOR loops, i mean one FOR loop within another FOR loop and in the inner for loop i am writting data to a measurement file. I want that every time the outer loop is executed a new data file is created automatically with any default name ( without asking me) and without replacing the existing file. For example in the VI attached i have two for loops, the outerone with  2  iteration and inner one with 5 iterations. What i want  to create is 2 data files with any two different names automatically i.e without pausing the execution and asking me to give the names. If you can suggest me any solution it will be kind help. Thankyou.
0 Kudos
Message 1 of 5
(2,791 Views)
Why exactly do you want to create two different files? One for each loop?
0 Kudos
Message 2 of 5
(2,786 Views)
Actually i am doing scanning of a sample by moving X-Y stage in a zig-zag way. That is first , X axis moves in a say +ve direction and after that Y axis moves a certain distance and then X axis moves back in Negative direction and then again Y axis moves. These four motions are in a for loop which is executed for a perticular no of times depending upon how much area i want to scan. When axis are moving a signal is generated in the sample by a laser source and i am obtaing that signal using DAQ board. Now since X axis is moving back and forth, it becomes difficult to find out which values corrosponds to which one. That is i want to have a different data file when X axix is going in +ve direction and a different data file when it is going in -ve direction. If i give two names for +ve and -ve direction what happens is that when loop is executed next time it simply appends the files. Where as what i want is that when loop is executed next time it should store those values in a new file and that too by creating any default name and without stoping to ask me the file name. I hope it will make the situation clear. Thanks
0 Kudos
Message 3 of 5
(2,784 Views)

This may not be exactly what you are looking for since each dimension would be a file so array restructure may be necessary for you needs. But it does as you ask, 2 files.

Chris Co

Download All
0 Kudos
Message 4 of 5
(2,770 Views)
Based on what I understood here is the vi. If you need two files because of not knowing which direction x axis values are then this vi will create only ONE file to track both x and y axis values.
Download All
0 Kudos
Message 5 of 5
(2,765 Views)