05-25-2007 06:24 AM
05-25-2007 07:03 AM
05-25-2007 07:58 AM
Thank you for your reply.
I've done what you've suggested and attached is the modified VI. The only problem now is that the count is not continuous, meaning that when I run the program, the timer starts counting like 2, 4, 6, 7 etc... it isnt continuous. I am basically trying to time the data aqcuisition from from moment the VI is run till the moment it is stopped.
05-25-2007 08:45 AM
You are counting the time. What you are seeing is the time it takes for your loop to iterate and that time is something greater than a second. You are doing an awful lot of unnecessary things in each loop. Each of your tasks (analog out, analog in, and digital output) are started and stopped each time the loop repeats. The analog out has an extra start and stop because you have a DAQ assistant there to set the voltage to 0 with each loop. Move the setups for the tasks (channel creation, timing, start task, etc) outside the loop so they run once, when the VI starts. Put the cleanup functions outside the loop so they only run once when the loop finishes.
It's also hard for me to tell how many samples you are taking and the sample rate you are using. It seems that you might be specifying number of samples that is greater than the sample rate.
Also, clean up your wiring a bit. You've got some hidden wires, wires underneath objects, wires that don't go straight to exit tunnels, etc.
05-26-2007 07:34 AM
05-26-2007 08:58 AM
05-26-2007 09:50 AM
Thanks alot for the suggestions but I can't seem to open the file. I am actually using Labview 7.1. Maybe its saved in a different version.
05-26-2007 10:53 AM
05-28-2007 06:29 AM
Thanks for that. I can now open the VI. I've just tested it using my electrical circuit and it seems to work fine. However, the only issue now is that the timer is not counting the seconds continuously as in like 1, 2, 3 etc. Its counting the seconds in a discontinuous way like 2, 3, 5, 7, 10, 13 etc. Is there a way to make it count continuously?
Thanks
05-28-2007 06:35 AM
Actually, I just realised what the problem is. The timer counts depending on how much time it takes for the data to be acquired. For example, depending on how I set my parameters, if it takes 3 seconds for the data to be acquired, then the stopwatch counts every 3 seconds like 3, 6, 9 and so on. If it takes 1 second for the data to be acquired, then the stop watch counts continuously. Is there a way I can implement the stop watch without it depending on the time that data is acquired? I think that the reason its depending on the data acquisition time is because the stop watch is implemented in the same while loop as the data acquisition.
Thanks