Save data in a file and email the file

10-11  Source: Network gathering  Views:0 

Advertisement
Dear all,
I have 2 vi files:
1. one vi file can store data into a file when it runs and stopped
2. another vi can send a file out through email when it is run.
Is it possible for me to run the first vi and stop after one hour (to store data into A file), then run the second vi file and stop (to send A file through email), and then run the first vi again immediately after running the second vi? This is because I need to send out my data saved hourly through email and get my 1st vi to continue running through out the day.
Due to the file path for my first vi and the second vi are the same, I keep getting error as below when either 1 vi is not stopped.
Error 5 occurred at Open/Create/Replace File in Write Spreadsheet String.vi->Write To Spreadsheet File (DBL).vi
Please advice. Thanks.
Kim
Dear Ravens,
I tried to kill (remove) the event structure from my earlier code, but as I run it, I get the same error again- error 5.
I also tried to put time out value 200 at the timenode at the upper left of the event structure but the email part just never executed.
I searched thru the forum and found a several examples on state machine as attached. I tried the first attachment for my program but obviously I used the wrong one as you adviced. As for the other state machine examples that I downloaded, I couldn't figure out how to apply them for my case correctly. Can you advcice how can I implement state machine to get the results tat I need?... Pls gv me some clearer hints? 
Attachments:
QueuedStateMachineWithEvents.vi ‏49 KB
StandardStateMachine_2MOD.vi ‏19 KB
JKI State machine.vi ‏75 KB
Related articles