08-11-2011 06:23 AM
Hello,
I need to be able to know what the present time is in my VI, but relative to when I hit the "start" button - not absolute time. I have a process that takes about 0.3 seconds to complete. I want the counter to run from 0 to the end of the process (.3) and tell me how many seconds have past in real time. I.e. It will count 0.01 , 0.02 , 0.03 ......0.1 ....0.2..0.3.
Thanks
08-11-2011 06:39 AM
You can use the tick count function to achieve that. Read the tick count value when your VI starts, then whenever you want to update the elapsed time subtract the start time from the current tick count value (will return the time in ms).
08-11-2011 07:02 AM
That's what i thought but i can't get it to work. i tried also using elapsed time but its not working either. perhaps my case structures are confusing me.
attached is the VI. can you show me?
08-11-2011 07:18 AM
Could you attach your read vi?
08-11-2011 07:21 AM
here's the attached DAQ read
08-11-2011 07:54 AM
You are not using Tick Count. You are using Get Date/Time in Seconds, so you will not get fractions of a second.
You should also avoid using the Stacked Sequence Structure. This leads to bad programming style (a long discussion that I don't want to get into).
I don't understand what you are trying to do.
You get data from the DAQ, and then offet each measurement by the timestamp? Maybe I misread your code, but it does not seem to make sense.
08-11-2011 07:57 AM
I was thinking the same thing as Ray R. I added a state machine to your code and cleaned it up a bit. I figure that we can get the process data step working better once we understand what you are doing.
08-11-2011 08:03 AM
Here is my setup:
I have a verticl axis wind turbine spinning in a wind tunnel at about 500 RPM (8 Hz). A visual analog sensor is attached to the shaft at the bottom that detects 1 revolution of the shaft. The analog sensor gives out a 5 volt signal. I need to determine the RPM of the turbine. I also need to determine the position of the shaft in real time relative to the starting position.
Later (i haven't built this part yet) the program will trigger on and off another VI when the shaft has turned certain degrees.
I hope this explains it.
Thanks again
08-11-2011 08:26 AM
You want to add the time factor to the measured signal and create a waveform. Ah ok.. that makes more sense. But that is not what you code will do.
Unfortunately, I do not have time to create an example. But the first thing would be to start from scratch on your main code. Use the Tick Count. Build an array of Tick Count values. AT the end, simply subtract the entire array by the value of the first element[0].
Look into the waveform palette or better look under help menu and select find examples and type "waveform" in the search field. There should be an example on how to build a waveform using data & timestamps.
That would be a start... I have not looked at the code changes by aeastet but it could also be a starting point.
08-11-2011 08:54 AM
Hi Ray,
I'm new to labview so i'm trying to understand all of this. Ray, the file you sent me runs one iteration and then stops. i'm not familiar with the "message dispatcher" syntax you are using.
Also, I'm using labview 8.6