08-03-2009 03:52 PM
Oh, thanks a lot Ravens fan, you said something about circular buffer. Am I to implement it using arrays? Also, how is that going to guarantee that the trigger event would result in lossing 10 seconds old data?
Its a bit of magic for now.
Thanks for the great assistance.
08-03-2009 03:54 PM
Oh, thanks a lot Ravens fan, you said something about circular buffer. Am I to implement it using arrays? Also, how is that going to guarantee that the trigger event would result in lossing 10 seconds old data?
Its a bit of magic for now.
Thanks for the great assistance.
08-03-2009 09:14 PM
Yes. Use arrays to store the last 10 values in a circular buffer.
See attached. There are two queues, two consumer loops. One for each type of file.
08-04-2009 12:33 AM
08-04-2009 02:15 PM
Thanks Ravens fan,
I am putting the bits of VI together, the logging one to begin with. In the VI attached, I used sequence structures. This was because task '3' (in the sequence) is supposed to finish before task 5 starts to run. The drawback is that the loop at '3' must finish before progress to the next sequence and the data from all the sequence must be logged real time, the same time.
Am I to use producer/consumer architecture just like the data logging VI to ensure that all the data gets logged at the same time because with the current set up, the speed value at 3 would remain constant after the loop at 3 ends.
I need an assistance so I can include the logging VI to the main VI.
Thanks a lot.
08-04-2009 02:52 PM
Yes. Use Producer/Consumer again. Your data logging consumer loops would be separate underneath your current sequence structure. You would enqueue the data into the two queues wherever the data is coming from in the sequence structure.
08-05-2009 12:15 AM
Thanks a lot for the advice. This is where the problem lies. The way the sequence struckture is configured, sequence '3' has a loop which increases the speed. The loop stops when a certain value of speed is reached and control is passed to further sequences. At some future point however, the speed value should be brought down lower.
The producer/consumer would not be able to log the points where the speed increases initially at sequence 3 since the loop must complete before control is passed out of the sequence.
Is there a way I can reduce the speed as well, even after control has been passed to sequence '5'?
Thanks for your time.
08-14-2009 04:26 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.
08-17-2009 06:17 PM
Hi, I still have this challenge with cyclic data logging.
Assistance please.
Thanks a lot.
08-21-2009 05:31 AM
Hi all,
Thanks for your assiatance. I still have these two challenges and I haven't got any response from anyone yet. I would appreciate an idea as to how I can tackle them.
Thanks.