12-10-2010 10:34 AM
What kind of vis should I use to synchronize them. Should I use a timed while loop or wait until? I am looking at the 6 hrs hands on document, it seems ambiguous
12-10-2010 10:42 AM
Are you trying to acquire real data, or just simulate the data you would acquire?
In your VI, you are simulating analog data. The waveform may represent a second's worth of acquired data (for instance), but the function that generates that data is going to return almost instantly. Since nothing else is pacing your loop, your are simulating/analyzing the data as fast as the PC will allow. Whereas if you were acquiring real data, the DAQmx read functions would pace the loop. You wouldn't have a second's worth of data until that second of data has been acquired.
If you are just simulating, put in a wait statement in that loop that is equivalent to the time length of the waveform you are simulating.
12-10-2010 11:51 AM
Please judge on my understanding about the while loop timing problem. I think the analog signal is running at 100Hz precisely, but the while loop is running faster, if no timing is specified. So when the trigger detection is checking the value more often than usual, if the value is greater or equal than 2 then it gives a true value, otherwise it gives a false. That is the reason I am getting more than 100 triggers without a wait(ms) vi.
When I put in the wait vi, and specify 10ms to wait, the trigger detection is running at the same period of the signal. So it will check whether the signal is above zero at 0s, 0.01s, 0.02s, ...1s. So I can get the right number of total triggers in 1 sec. But it seems that because I did not make the counts increase one when the Time has Elapsed is true, my counts of triggers will not be right. Therefore I add one more frame before averaging. And the results turns out to be right.
The forging successful result is based on the assumption that I know the frequency of the signal, so I can check the trigger at the same frequency. But the data in my experiment is of a different type. I have the impulses, but the frequency is not known and it is changing with time. So I need to modify the vi again to account for the frequency variation. I think there are two ways to do it. One is modify the trigger detection function to make it ouput the rising edge only, The other is having the trigger detection run much faster than the square waves, which is event I want to measure, and then using the trigger location to mark the even with lots of points. Then I should be able to mark the point at the end of low signal and the beginning of high signal. So I change the location mode into Time. But this rising edge is still dependent on the choice of the ms to wait function. Do you have any idea on this?
12-10-2010 12:50 PM
I think the problem is you are forgetting to do something I told you to do back in message #4.
Right now you are only looking at a waveform and detecting the first trigger in that. I had said given a waveform, look for the trigger. Then use the remainder of the waveform to look for another trigger. Keep doing that in a loop on a give sample of waveform until you reach the end. If you capture 1 second of waveform data, you might have 0, 1, 2 or more triggers depending on the flow rate and how many pulses there are. So don't try to run software so fast that you have to see each trigger before the next one occurs otherwise your count is wrong. Read the signal at a steady defined pace, then iteratively step through the snapshot of the waveform looking for each trigger so that you get the total count of triggers in that snapshot. Add that value to your running count.
12-10-2010 02:40 PM
I don't think I understand I am looking for the first rising, because I am getting more than one counts. Should I reset the trigger detetion every time the trigger is detected. I also test the case with a falling edge detection, it turns out that the number of triggers is twice of the rising edge. But that is not right. There use to be another guy who did this before, it seems that he made the same mistake. I simply can't find a more correct version to compare. How can I do as you told me, I am new to labview, I am not quite sure how to use the remainder of the wave form to look for the next trigger.
11-23-2011 11:15 PM
hi shuishen im trying to open your attached file.. do you have any software available that will allow to open the vi extension? im interested to the basic trigger detection. thanks.
___________________________
Positive Displacement Flowmeter is an industrial process control and instrumentation which is usually used in marine/ offshore applications with low to medium initial cost set up and can be used in viscous liquid flow.
11-23-2011 11:23 PM - edited 11-23-2011 11:27 PM
@scott_white85 wrote:
hi shuishen im trying to open your attached file.. do you have any software available that will allow to open the vi extension? im interested to the basic trigger detection. thanks.
????
It's a LabVIEW file. You need LabVIEW to open it. But I would think you'd already know that considering you are posting your question in the LabVIEW forum.
Or are you just spamming us? I noticed all of your posts have hyperlinks quietly embedded in them to a commercial website. I would consider this to be a violation of the agreement you agreed to when you signed on to be a member of the discussion forums.