Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Start Analogue Edge rarely works with low signal

Hi,

 

I'm sorry if I'm asking an obvious question but I can't seem to find information about this.

 

I have a USB-6259 BNC and a USB-6251 BNC. I am simply trying to begin data acquisition after a rising analogue edge. It works at higher voltages fine, but one signal I have to deal with is always below 0.5 V. It stays at its constant offset of 0.14 V until it receives the proper signal, and then rises quickly and varies between about 0.4 and 0.5 V. I therefore set the edge level to 0.2 or 0.3 or similar. What is confusing me is that it seems quite random - sometimes it works fine and sometimes it doesn't, even though the signal is always the same and it's a clear, very quick rise from 0.14 to 0.4 V. Once it stops working, I can change the edge value to anything and it still won't work, then later it might work all of sudden, on any reasonable edge value. I have experienced this problem every time i've had a signal below about 0.5 V, and with both devices.

 

I am using Labview 2010 SP1 and DAQ-mx.

 

Is there simply a limit for the effectiveness of the analogue edge?

 

Thanks very much for your time,

 

James

0 Kudos
Message 1 of 8
(3,724 Views)

Hi James,

 

I'm not sure what line you're using for your trigger, but I suspect it's one of the APFI lines.  If this is the case, try switching to an analog input channel.  You can configure the range of the analog input channels (in your case, configure it to ±0.5 V), but the APFI lines are fixed at ±10V.  There is just one caveat--to use an analog input channel as the source for an analog start trigger it must be first in the scan list (on all multiplexed devices like the ones you are using).

 

Trigger accuracy is specced at 1% of the range for your devices.  On APFI, the range is ±10V, resulting in 200 mV of accuracy.  If using an ai channel scaled to ±0.5V, the accuracy becomes 10 mV which should be suitable for your input signal.

 

 

Best Regards,

John Passiak
Message 2 of 8
(3,717 Views)

Hi John, thanks very much for your reply. Sorry i've been temporarily ill and off work. Now i'm back -

 

I am already using an anaolgue input channel and not an APFI line. It's also fine that it has to be first in the list. I assume that by scaling the voltage you mean doing so when creating the channel in labview, giving it a minimum and maximum of +-0.5 V. Is that correct?

 

Fortunately my signal increased to 5 V, and everything worked fine because of this. It is now however down to around 0.7 to 1 V, and the triggering has stopped working again. I tried doing as you said, and created a channel with 0 to just over 1, and then -1 to just over 1, but it still doesn't work. This is when the signal is changing from 0.16 V, quickly to to 0.7 V, and then rising to 1 V, with the trigger level  set at several different reasonable values for testing. Do you know why this is still happening?

 

Thanks for the help I really appreciate it,

 

James

0 Kudos
Message 3 of 8
(3,690 Views)

Hi James,

 

The analog inputs on the 6251 have a finite number of ranges.  They are:

 

±10V, ±5V, ±2V, ±1V, ±0.5V, ±0.2V, ±0.1V

 

The driver will pick one of the available ranges that best fits your specified AI.Min and AI.Max.  So, if you set AI.Min to 0 (or -1) and AI.Max to 1.000001, the ±2V range will be used.

 

 

I'm not sure why the trigger is not being picked up.  Are you configuring hysteresis?  Could you post the VI you are using and perhaps a screenshot of what the signal looks like (preferrably from an oscilloscope)?

 


Best Regards,

John Passiak
0 Kudos
Message 4 of 8
(3,678 Views)

Hi John thanks again,

 

I've not configured any hysteresis, I believed the default was not to have one is that correct? I have attached the VI, and a screenshot of the signal. I can't see a new one at the moment, but this is one of the last successful ones I got. This whole signal is applied anywhere between 1 and 1000 times a second, but changing this rate doesn't seem to help with the low signal. It also seems to make no difference if this signal is being applied before or after the analogue edge trigger is started (I think, but I may be wrong here and unfortunately can't test it at the moment) - always works fine at higher voltages such as the one in the screenshot, but not at lower ones.

 

I guess it's very possible I'm doing something wrong in the VI, I'm quite inexperienced with labview.

 

In fact should if the signal is applied before the analogue edge is started, and it has to go down before up again? (I guess I had assumed not as the higher voltages were fine this way).

 

Thanks very much,

James

 

 

0 Kudos
Message 5 of 8
(3,668 Views)

Hi James,

 

Thanks for the extra info.  It's true that hysteresis is not enabled by default, so no problem there.  Looking at the screenshot and code, I'm interested in a couple more things:

 

    1.  When you run your code and the triggers aren't being detected, do you receive a timeout error after the specified 5 seconds?

 

    2.  As a sanity check could you try running this example.  I don't really see anything in your code that would explain what you're seeing, but there are some peculiarities in it (e.g. no call to DAQmx Start) that I'd like to remove from the equation.

 

    3.  The signal you've shown is from a successfuly triggered acquisition, but how are you certain the signal is still present during the times the trigger is not being detected?  If you have another scope that can trigger off of the same signal, it might be helpful to monitor this as well to ensure the signal is still what you think it is.

 

 

This issue does have me stumped so far, if the above points don't lead to any progress I can track down the specific hardware you are using and try it out myself.

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 8
(3,648 Views)

John,

 

I have just been able to test again, and it has suddenly started working fine using a trigger of 0.3 V.I think I'll just be happy with this and hope it stays the same way. So never mind, and I'm sorry to have wasted your time.

 

To answer your questions anyway, -

Yes I receive the timeout error,

I always check the signal with no trigger to give me an idea of what trigger level I need, so I knew it was there.

My entire knowledge of the DAQmx functions comes from creating a DAQ assist express task and telling it to generate code which I copied. I've never even used the Control Task function before. I shall put it in in future. Could you possibly tell me what any other peculiarities were, just for me to improve my code?

 

Thank you for your help, and sorry again,

James

 

0 Kudos
Message 7 of 8
(3,636 Views)

Hi James,

 

Maybe "peculiarities" wasn't really the best choice of words.  Here is the section of code I was referring to:

 

2011-04-18_100735.png

 

The read function is auto-starting the task in your case.  This shouldn't necessarily be a bad thing, but I'm not sure why you are waiting before entering the loop.  The analog trigger isn't armed until the task is actually started, so I was worried that perhaps the trigger signal might occur before the task is actually armed and so you would miss it.  However, after re-reading your post it sounds like the trigger signal is periodic in which case this wouldn't matter at all (as long as it occurs quickly enough to ensure there is no timeout).

 

I also like to explicitly call Start and Stop myself so I can better visualize what the task is doing.  Again, DAQmx should auto-start the task inside the loop so I don't think this should technically be an issue. 

 

Explicitly committing the task before starting will make the re-arming more efficient since the task will not have to re-commit certain parameters to the hardware (see my post on the matter here). 

 

 

None of the above points explain why the code works with highver voltage triggers and not with lower voltage ones, but I thought maybe starting with a shipping example would be a good idea just to be on the safe side.  I'll try to do some testing with hardware using the way you have configued the task (which should work in theory) to see if the driver is doing anything fishy.

 

 

Best Regards,

John Passiak
0 Kudos
Message 8 of 8
(3,625 Views)