08-21-2009 08:00 AM
Hi, thanks for all assistance.
The reset button(switch when pressed), when pressed, sets the scale to 0. The scale reads 100 (full) normally. Data is logged to the main log file (data1.txt) continuously.The trip button (latch when released) creates a trip file (data2.txt) with data 10 seconds before and after the trip button is pressed.
Two challenges:
1. I have challenge making the reset button and the trip button performing the same function of creating the trip file when either of them is pressed. When I use 'latch when released' action for the reset button, it sets the scale to 0, it goes back to 100. I linked the trip button and the reset button with an 'Or' gate but the trip file functionality changed.
The task is: When the reset button is pressed (instead of the trip button), the scale should be set to zero (and stay 0) and at the same the trip file should be created and populated. The trip button should create the same trip file as usual when pressed (instead of the reset button).
2. I would like the main log file (data1.txt) to run for 12 hours (43200 secs) (creating 43200 records) and after that, the file should get cleared and the data logging started all over gain in the same file (cyclic logging).I had trouble achieving this without ending the VI.
Thanks again.
08-21-2009 10:24 AM
1. An OR function should work just fine for you. I don't understand what you mean that the functionality changed. If the reset button is true OR the Trip button is true, then a True gets put in the notifier and the Trip file functions are executed.
I don't understand your "Scale". Right now you have a zero if the button is true and 100 if it is false. You don't have anything else going on with it. I don't understand the stay at zero part. How would it ever get to the point where it isn't zero.
2. For the main log file, you could detect when 43200 iterations of the loop have passed and at that time, just reset the writing to the beginning of the file.
See attached.
08-21-2009 11:44 AM
What I meant by the functionality changed is this: normally when the trip button is pressed, a new file with logged data (before the button is pressed and after the button is pressed) is created. The data2.txt file created when the reset button is pressed is only 10 lines (instead of 19, like when the trip is pressed)
The reason for the scale being that way is because the scale is 100 normally (reset off) and it is only when there is need to reset (scale 0) that the reset is switched on.
Thanks a lot Ravensfan