You are on page 1of 2

Hardware: usb-1608HS

Software: VB.net 2005


Operating System: XP

Problem Description:
How to setup the ExtTrigger in VB.net?

The USB-1608HS has some interesting features for the external trigger.
You can do analog triggering or digital triggering. Here is an excerpt
from the document ULHELP.CHM regarding triggering for this device:

USB-1608HS and USB-1608HS-AO: Analog triggering: TRIGABOVE, TRIGBELOW


Digital triggering: TRIGPOSEDGE, TRIGNEGEDGE, TRIGHIGH, TRIGLOW
External digital (TTL) hardware triggering supported. Set the hardware
trigger source with the Trig_In input.

With regard to the threshold for analog triggering it goes on to state:


USB-1608HS and USB-1608HS-AO: 0 to 65535 (BIP10VOLTS)

To turn on the external trigger feature, you need to add the option to
the function call:
daqboard.AinScan() in the Options parameter, and you can only use
external triggering when in the background mode, or atleast not in the
foreground mode since that would lock up your computer until the
trigger event occurred. So if you were in background you could also do
background + countinuous + exttrigger for example if that was your
desire (using the proper syntax of course).

if you were to stop there and just use this much of the code, you could
execute your program, the type of external trigger you would have would
be the default which would be digital, rising edge. To have access to
the other types of triggers, you would need to add more code prior to
calling the ulstat = daqboard.AInScan() function, this would be the
Ulstat = Daqboard.SetTrigger() function where you would set some
additional parameters such as TriggerType, LowThreshold and
HighThreshold for the analog trigger.

Again this is documented in depth in the ULHelp.CHM which is installed


on your computer. You can access it by clicking on Start, All
Programs, Measurement Computing, Universal Library, UL Online
Reference.

If you do wish to use the analog trigger, you want to set an additional
paramter of the low or high threshold. You set this by using one more
function call, Daqboard.FromEngUnits() which will help you convert from
the voltage level you want to use to "counts" which is what the
paramter of SetTrigger() wants to use. This function call is used
before SetTrigger.

So in summary, to use the external trigger, the order of the function


call is like this (in pseudo code)

FromEngUnits() 'to find out the value in BIP10Volts range of the


threshold you want to set.
SetTrigger() 'so you can set the trigger type of the external trigger
you want to use.

AInScan() 'to call the scan with the option set of EXTTrigger with all
the other parameters you need to set.

There is a sample program that demonstrates some of this for you


already, but since there are so many combinations of the external
trigger, we could not cover them all. But it's a good place to start.
Please see vb.net example:
ULAI14

I hope this gets you going.

You might also like