LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing a file for prescribed amount of time in a while loop after the triggering condition is met

Hello Guys,
 
I am trying to program an application in which if the trigger condition is met it should start to write the file.
I was able to do that, but if I want it to be written for certain amount of time, and once the trigger condition is met, it should continue to write the files for prescribed amount of time. I was not able to do this. The file name should also be updated accordingly.
I tried to with some options by keeping the creation of the file outside of the loop, if I do that then if the trigger condition is not met it will stop writing and I dont want that, as once the trigger condition is met it should be true thereafter.
So I cant keep any thing outside the while loop, bcaz then it checks the condition of the shift register for the trigger and I have it as a false constant.
 
I am attaching my application which is kind of mess and I have written in the application where I am having problems. For every iteration of while loop it makes a new file, and i dont want that, I want to write specific amount of time data to the each file.
 
Please take a look at my code and help me in solving the problem. Any insights and examples on how to do this thing will be a relief to me.
 
Thanks in advance.
 
Regards,
Nitin
0 Kudos
Message 1 of 6
(2,456 Views)
can you pls put your vis in 7.1.1 format tks
0 Kudos
Message 2 of 6
(2,454 Views)

Hi

this is in 7.1 version. Pls take a look

Regards

 

0 Kudos
Message 3 of 6
(2,452 Views)
if you want to only write a file only when certain conditions are met then you should use a case structure with the selector wired to a var. called something like space remaining where space remaining is how much space you hav left in the file to write. just check if the space remaining var. is at zero and if it is then make a new file.

hope this helps you
0 Kudos
Message 4 of 6
(2,450 Views)

Hi,

Can u make a simple example for what u said. I am not able to understand how that will go with writing the data to binary file. How will I know how much space is left in the binary file.

Lets say for eg. I need to write the data for 5 sec, the timer in my application calculates the time for the loop to run for 5 sec, but in this 5 sec the iteration terminal also increases to 5 and it makes 5 different files each of 1 sec and writes the data to it. Are u asking me to check the timer for 5 sec and give this condition to the case structure.

Regards,

Nitin

0 Kudos
Message 5 of 6
(2,447 Views)
what i am saying is to keep track of how much data you have written and whenever you need to make a new file you make 1.
here is a vi that i just made that should show you. let me know if you need any help understanding it.
0 Kudos
Message 6 of 6
(2,439 Views)