LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing data to file on trigger activation?

Solved!
Go to solution

Hello everyone,

I'm quite new to lab view and I'm finding it difficult figuring out a solution to this fairly simple problem. I've installed a level indicator on a tank and when ever it reaches the overflow limit the VI should write all data to a file. I've set up my data arrays, but I'm struggling with finding a means to have the VI write the data when the specific trigger (tank overflow) occurs. I'm sure the solution is pretty simple, but I've been struggling with this for a couple of days now so decided to ask for helps.

Cheers,

Gasim 

0 Kudos
Message 1 of 12
(3,606 Views)

@Gasim wrote:

Hello everyone,

I'm quite new to lab view and I'm finding it difficult figuring out a solution to this fairly simple problem. I've installed a level indicator on a tank and when ever it reaches the overflow limit the VI should write all data to a file. I've set up my data arrays, but I'm struggling with finding a means to have the VI write the data when the specific trigger (tank overflow) occurs. I'm sure the solution is pretty simple, but I've been struggling with this for a couple of days now so decided to ask for helps.

Cheers,

Gasim 


have you looked at the comparison pallette?...connect that to your write 'case statement'
, otherwise dont write to file

 

Message 2 of 12
(3,584 Views)

Hey there,

Thanks for the reply. I'd already setup a comparison to trigger my high alarm, but now I know I need to use a case statement for the data writing part. Thanks a lot.

🙂

 

0 Kudos
Message 3 of 12
(3,561 Views)

Ummm it turns out it's a bit trickier than I expected. I've attached my vi in order to help explain the problem.

I'm monitoring two tank levels as well as the temperature of one of the tanks. When tank B's level exceeds 2.3 the program should automatically save data history, display alarm and carry on until the problem is resolved.

I've tried several solutions, but none of them have worked so far. 

If anyone could help that would be great.

Cheers,

Gasim

0 Kudos
Message 4 of 12
(3,528 Views)

My Project_BD.png

0 Kudos
Message 5 of 12
(3,518 Views)

Well as far as I can tell from that shot, the output from the case function will just be the level of the tank when the incident occurs. Want I want is for the write function to produce all the data history up until the incident occurs. So basically all the information that I've assembled in the array outside my while loop. 

0 Kudos
Message 6 of 12
(3,514 Views)

Use a shift register and build the array inside your loop. When you detect the trigger then wirte out the array.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 7 of 12
(3,512 Views)

@Mark_Yedinak wrote:

Use a shift register and build the array inside your loop. When you detect the trigger then wirte out the array.


That sounds promising. I'll give it a try. 

Thanks!

0 Kudos
Message 8 of 12
(3,509 Views)

Seems to work, but it stops the program when the trigger activates and asks for a file name to write on and then reinitialize the whole process. Is there anyway to get it to write the data automatically without any interruptions? 

0 Kudos
Message 9 of 12
(3,505 Views)
Solution
Accepted by topic author Gasim

@Gasim wrote:

Seems to work, but it stops the program when the trigger activates and asks for a file name to write on and then reinitialize the whole process. Is there anyway to get it to write the data automatically without any interruptions? 


Yes, simply wire the desired file name into the Write File VI. If wired it will not prompt.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 10 of 12
(3,501 Views)