08-04-2006 12:56 PM
08-07-2006 08:20 AM
08-07-2006 08:44 AM
Hi Jon, thanks for the reply.
I'm measuring dynamic wear on a rotating drive nut. The nut is driven up and down a fixed threaded rod. Start trigger (edge one) is from a fixed position the nut passes. Pulses are counted from regular spaced lines around the nut. An index mark against one of these lines provides the stop trigger (edge 2). As the nut wears, the pulse count between edges will change and so wear in the thread can be measured. For this application a time isn't what I need - it's the fraction of a turn the nut makes between the start and stop trigger that I need to measure.
The USB 6251 was chosen for this task in conjunction with my local NI field engineer. We selected it after reading the M series manual section on Two-Edge Seperation, which describes measuring the seperation of 2 signals either in time, or as a count of source events (as per my original, not very detailed post). I have posted after spending a day trawling help files, product manual, vi libraries, user forum and knowledge base.
Two edge measurement should work from rising or falling edge of aux to rising or falling edge of gate (and it does). You get to choose rising or falling edge for each with the DAQmx Create Channel.vi in it's (CI Two Edge Seperation) variation.
The only problem I have is getting a timing input from the source connection.
I will check the DAQmx Count Edges task as you suggest, though at the moment I don't know how I use both start and stop triggers.
Watch this space for an update, or post any further info you come up with.
Regards,
Bandit.
08-07-2006 10:42 AM
08-07-2006 11:37 AM
Hi Jon,
Thanks for this - from the schematic it's exactly what I was trying to do - I just couldn't find the property to change.
Sadly it doesn't work though - I get this error message as the triggers don't seem to have any effect and the read function times out...
Error -200474 occurred at DAQmx Read (Counter DBL 1Chan 1Samp).vi:1
Possible reason(s):
Specified operation did not complete, because the specified timeout expired.
Task Name: _unnamedTask<28>
Oddly though if your new timebase source is changed to internal clock, the code works as before. Triggers work fine and the count is read in timebase ticks.
There is something else funny here that I haven't spotted yet.
Bandit.
08-08-2006 04:04 AM
08-08-2006 05:26 AM
Hi Jon,
It's working now.
During fault finding I had disconnected my clocking signal from the source input on PFI8. I had been using it originally, but it was disconnected before you showed me the timebase source property. I thought without a signal I would get a reading of zero, or perhaps a spurious reading from a floating input. Instead I was getting a timeout error. I'm not sure why an error is generated when there isn't a timebase signal connected, I thought the start and stop edges would be enough to get a reading, even if it was zero.
Connecting a proper timebase signal means the system now works.
So in sumary, the solution is to ensure source is connected to PFI 8 using DAQmx Channel property CI.CtrTimebaseSrc, and make sure there is a timebase signal connected to the input.
Thanks for your help with this, I would never have found the right property to change the source without your help.
Best Regards,
Bandit
08-08-2006 05:40 AM