LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggered acquisition using DAQ assistant PROBLEMS. (LV8)

Ok. I have a shaft that is spinning, and I have a gap sensor (X5T) which is analog, as well as a hall effect switch which is digital. There is a hole in the end of the shaft for the hall effect, and obviously the gap sensor sees this hole.
 
I want to do a triggered data collection, using the hole as the trigger, and then measure the gap for 1/2 a revolution to avoid reading the hole.
 
I wired the hall effect sensor positive to PFI0 on my USB-6218 and the negative to digital ground.
 
I went and made a second DAQ assistant, measuring only the GAP channel, and under the trigger tab I have a start and reference trigger settings.
 
No matter what I do It seems to just acquire continuously, the trigger does not seem to work. What Am I doing wrong?
 
I attached the VI.
 
 
 
 
0 Kudos
Message 1 of 13
(3,993 Views)

Anybody?

I would really like to get this trigger working today, got some people breathing on me about it.

 

0 Kudos
Message 2 of 13
(3,980 Views)
I need help!!!!
0 Kudos
Message 3 of 13
(3,972 Views)
Hi Vr6Fidelity,

There are few concerns that I have with your program.  First, the reference trigger you have set will continue to take samples everytime the reference trigger occurs.  This will result in what appears to be continuous sampling.  The other issue that I see is that you are using the hall effect switch as your external sample clock for the second daq assistant.  This means that you will only be taking one sample at the same time you are triggering.  I think you might need to provide a faster sample clock to get all the samples that you are looking for.  As I see it right now, when you're first reference trigger occurs and you ask for 2 pretrigger samples there would only be 1 (the start trigger sample).  I would suggest, since you are already using the internal analog input sample clock, generating a sample clock with one of the counters to be used as the external sample clock.  You might take a look at the Gen Dig Pulse Train-Continuous.vi example (Help » Find Examples » Hardware Input and Output » DAQmx » Generating Digital Pulses).

I hope this helps,
Paul C.
0 Kudos
Message 4 of 13
(3,950 Views)
Thank you Paul.
 
I actually made some progress on this today, KINDA got it working but I still need to know how to make it work for real.
 
The problem is that the lower DAQ assistant does not respond to any of the controls I have wired to it after the program starts. Whatever you have typed in before you hit start it does, but if you change the values while the program is running, the DAQ assistant does not get the message.
 
Why?
 
To make it work for now, I set the speed to be a constant 120,000 and the duty cycle to be 2, with 5 samples. This essentially makes 5 high frequency measurements at a fast, but fixed time interval. The measurements are all in a small area at low speeds, and at thr right spacing at 120K. The actual point was to take measurements evenly distributed about the actual rotating shaft all the time, encompassing 270 degrees, and triggered from the hall effect. That is why the sampling frequency was wired to the speed local variable. The duty cycle sets the angle over which the measurements of X5G will be taken with 1 being 360 degrees and 2 being 180.
 
So, what do I need to do to get the DAQ assistant to respond to my changing speed input?
 
Smiley Happy
0 Kudos
Message 5 of 13
(3,943 Views)
I cleaned up the VI a bit.
 
I also moved the speed local varibale outside the loop, will this make the DAQ listen to lit? I'm at home and I can't test it out.
 
 
0 Kudos
Message 6 of 13
(3,940 Views)
Morning bump.
 
 
0 Kudos
Message 7 of 13
(3,933 Views)
Hi Vr6Fidelity,

The reason the DAQ Assistant won't update is because once the task inside the DAQ Assistant that information is locked into the task.  I would recommend going with low level DAQmx vi's.  These will allow you to change some properties of the task while the task is running.  It looks like you are wanted to change the sample rate (speed) while the task is running.  This requires that you stop and restart the task.  I've written a very basic example that uses an event structure to determine when to update the rate based on a value change of the control.  Take a look at it and let me know if you have any questions.

Regards,
Paul C.
0 Kudos
Message 8 of 13
(3,921 Views)

I do not have event structures.

 

Could you show me what to do with the low level vi's?

0 Kudos
Message 9 of 13
(3,918 Views)

So I tried to incorporate that example VI into my bigger VI. seems to have some cooperation issues between the two DAQs.

 

Im not quite sure Why you would set the sample clock rate outside the loop, and then change it repeatedly inside the loop?

It seems like the property node changes something outside the loop, but how would It do that if things outside the loop are not executed twice?

 

 

 

0 Kudos
Message 10 of 13
(3,915 Views)