Global TMW:
Login  |  Register          Free Newsletter Subscription
Subscribe
Email
Print
Reprint
Learn RSS

Minimize Switching Time in Scanning Systems

You have several options for programming your switch cards. Select the right one, and you'll reduce test time.

Tom Sarfi, VXI Technology, Irvine, CA -- Test & Measurement World, 8/1/1999

One place to look for savings in production-test time is in the switching matrices that connect DUTs to test instruments. While you can’t cut out the switches, you may have opportunities to reduce the time needed to operate them. Several programming techniques illustrate how you can control switch timing.

When you set up a switch card to operate as a scanner, you have more than one way to program it. You can use a software “for-next” loop or a scan list loaded into the switch card triggered by software. And VXIbus switch cards also offer a hardware option that moves your switches through a scan sequence.

To compare switching speed using various programming techniques, I programmed a switch card used in a burn-in rack and connected 16 device loads (UUTs) to a DMM (see Fig. 1). Although I used a VXIbus register-based switch card, you can use the same techniques on a PC-plug-in card or GPIB switch box.

TMW9908T2FIG1.gif (7977 bytes)
Figure 1. Each UUT requires two DPST relays for a four-wire measurement.

The easiest way to program a switch card to scan through all the devices is with a “for” loop (see Fig. 2 and Listing 1). This technique relies on software to sequence through switch settings; the speed at which the code runs depends on the computer architecture and on the application development environment (ADE). I tested this technique using LabView 5 and Visual Basic 4 on the same PC. Table 1 shows the results for each program—the difference in speed was negligible.

TMW9908T2FIG2.gif (5190 bytes)

Figure 2. A for-next loop sets each switch under program control.


Listing 1

For i = 0 To 15

'Close relays per list
DriverStatus = vtvmSmip_CloseRelayList(SMIPHandle, 0,
RelayList(0), 4)
If DriverStatus < VI_SUCCESS Then Call SMIPCheckError
(SMIPHandle, DriverStatus)

Take reading and place in array
DriverStatus = vtvm2710_read_Q(VM2710AHandle, Reading(i))
If DriverStatus < VI_SUCCESS Then Call VM2710ACheckError
(VM2710AHandle, DriverStatus)

'Open the current relays
DriverStatus = vtvmSmip_OpenRelayList(SMIPHandle, 0,
RelayList(0), 2)
If DriverStatus < VI_SUCCESS Then Call SMIPCheckError
(SMIPHandle, DriverStatus)

'Select next set of relays for next measurement
RelayList(0) = RelayList(0) + 1
RelayList(1) = RelayList(1) + 1

Next i

A for-next loop may be the easiest method to program, but it’s also the slowest to execute. You can gain speed by loading a preprogrammed scan list into the switch card’s memory. On VXIbus systems, you also can load the scan list into the slot-0 controller. Then, a software trigger initiates the scan list to operate the switches.


You’ll find that there’s more than one way to program a switch card’s scan sequence. I compared the scan speed of a switch card by programming the registers through the card’s VXIplug&play driver, then through the VXIbus’ hardware triggers.

A VXIplug&play driver embeds the direct register calls in functions that you call from your applications program. I configured the card as a 1x16 four-wire scanner, the same configuration I used in the software-only approach in Figure 1. Listing 2 shows how to program a switch card using its VXIplug&play driver.

Listing 2

**Scan elements stored in 'relaySetup', there are 16 total
setups.
DriverStatus=vtvmSmip_LoadScanSetup(SMIPHandle, 0, 0,
relaySetup(0), 16)
If DriverStatus < VI_SUCCESS Then Call SMIPCheckError
(SMIPHandle, DriverStatus)

**Index 0 is beginning of scan list, Index 79 is end (five
16-bit words per setup).
DriverStatus = vtvmSmip_SetScanAddresses(SMIPHandle, 0, 79, 0)
If DriverStatus < VI_SUCCESS Then Call SMIPCheckError
(SMIPHandle, DriverStatus)

DriverStatus = vtvmSmip_ArmScan(SMIPHandle)
If DriverStatus < VI_SUCCESS Then Call SMIPCheckError
(SMIPHandle, DriverStatus)

For i = 0 To 15
DriverStatus = vtvmSmip_AdvanceScan(SMIPHandle)
If DriverStatus < VI_SUCCESS Then Call SMIPCheckError
(SMIPHandle, DriverStatus)
DriverStatus = vtvm2710_read_Q(VM2710AHandle, Reading(i))
If DriverStatus < VI_SUCCESS Then Call VM2710ACheckError
(VM2710AHandle, DriverStatus)
Next i

The VXIbus provides for tight timing coordination between instruments across the backplane through TTL trigger lines. Using the code in Listing 3 and the scan list from the first two examples, I programmed the card to advance through its scan list upon receipt of a TTL trigger (TTLT0) initiated by the slot-0 controller (see Fig. 3).

TMW9908T2FIG3.gif (13763 bytes)

Figure 3. The VXIbus has triggers that you can use in a hardware loop to execute a scan list.

 

Listing 3

**This function sets up the switch to advance scan on TTLT0,
and output on TTLT1 when settled.

DriverStatus = vtvmSmip_SetScanControl(SMIPHandle, brdLst(0),
brdLstLnth, trgInLst(0), trgInLstLnth, trgInSlp,
trgOutLst(0), trgOutLstLnth, trgOutSlp, loopFlag, 3000)

If DriverStatus < VI_SUCCESS Then Call SMIPCheckError    
(SMIPHandle, DriverStatus)

'These two calls set up the DMM to take a
'measurement on TTLT1 and output on TTLT0 when done.
Call WSWrite(VM2710AHandle, "outp:ttlt 0 on", "DMM")
Call WSWrite(VM2710AHandle, "trig:sour ttlt1", "DMM")

**This call begins the sequence of events, after which the
hardware takes over
DriverStatus = vtvmSmip_AdvanceScan(SMIPHandle)
If DriverStatus < VI_SUCCESS Then Call SMIPCheckError
(SMIPHandle, DriverStatus)

I also set the switch card to produce a trigger on TTLT1 once the relays settled, and I programmed the VXIbus DMM card to take a measurement upon receiving the TTLT1 trigger from the switch card. After that, the DMM card resets trigger TTLT0, which causes the switch card to advance to the next set of switch settings.

This technique almost completely “removes” the switch card from regular interaction with the host PC and your applications program software. The switch card advances through the scan list, initiating the DMM measurements under hardware control. As Figure 3 shows, the application program polls a register on the switch card that contains the current location in the switch scan sequence. When the application program detects the end of the scan sequence, indicating the DMM has taken the final measurement, the program reads the test results from the DMM’s internal memory. This readback process takes negligible time because you can gain access to the DMM’s memory through its hardware registers.

I tested switching times with a for-next loop, a software scan sequence, and a scan sequence using hardware handshaking. I heard an audible difference between hardware- and software-controlled scans as the individual clicks of the relays advancing through the sequence were much more noticeable using the software advance.

I measured switch times from the beginning of the first relay closure to the final DMM measurement. I didn’t include device setup times in the overall test time. Table 1 lists the insignificant difference between the for-next software loop and the scan list using a software trigger. When triggered by hardware, the switch card and DMM test times decreased from more than 300 ms to 80 ms.

The DMM can affect the overall throughput of the test system. I used my company’s VM2710A 6.5-digit DMM to record the load measurements. To get 6.5-digit accuracy with a DMM typically requires line-cycle integration, which occurs over 1 to 10 power-line cycles. Therefore, at least one cycle of power (16.7 ms) must occur before the DMM provides 6.5 digits of resolution. I set my DMM to 4.5-digit mode with a software command, which reduces the DMM’s impact on throughput. In most high-throughput applications, this resolution setting is more than adequate. T&MW

Tom Sarfi is technical support manager for the East Coast at VXI Technology. He has a B.S.E.E. from Case Western Reserve University, Cleveland, OH. tsarfi@vxitech.com.

Email
Print
Reprint
Learn RSS

Talkback

We would love your feedback!

Post a comment

» VIEW ALL TALKBACK THREADS

Related Content

Related Content

By This Author

There are no other articles written by this author.

Sponsored Links



 
Advertisement
SPONSORED LINKS

More Content

  • Blogs
  • Podcasts

Blogs

  • Martin Rowe
    Rowe's and Columns

    May, 9 2008
    Upgrades include blood pressure
    Every time I install new or upgraded software on my home computers, I can feel my blood pressure ris...
    More
  • Rick Nelson
    Taking the Measure

    May, 6 2008
    Measurement drives green engineering
    Have we reached peak oil? I guess we know where Paul Rako stands on that question, but other observe...
    More
  • » VIEW ALL BLOGS RSS

Podcasts

Advertisements





NEWSLETTERS
Click on a title below to learn more.

Test Industry News (3 Times Per Month)
Machine-Vision & Inspection (Monthly)
Communications Test (Monthly)
Design, Test & Yield (Monthly)
Automotive, Aerospace & Defense (Monthly)
Instrumentation (Monthly)
Resource Center E-Alert (Monthly)
©2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy
Please visit these other Reed Business sites