The behavior behind niSwitch Wait For Debounce VI

Updated Jun 1, 2023

Reported In

Hardware

  • PXI-2522
  • PXI-2521
  • PXI-2523
  • PXI-2520
  • PXI-2564
  • PXI-2565
  • PXI-2566
  • PXI-2568
  • PXI-2570
  • PXI-2571
  • PXI-2586
  • PXIe-2569

Driver

  • NI-SWITCH

Issue Details

How do the niSwitch Wait For Debounce VI know if the hardware if the debounce is already settled? What is the behavior or steps behind it?

Solution

What the function does is block until the settling time has expired. The settling time defaults based on the specific type of relay on the instrument but is user-configurable via the NISWITCH_ATTR_SETTLING_TIME attribute.
It's implemented roughly as follows: When the driver flips the relay, a countdown counter starts in hardware for the duration in NISWITCH_ATTR_SETTLING_TIME. Users should configure this attribute if the customer's DUT requires longer time for the signal to settle, for example.

The function niSwitch_WaitForDebounce() is implemented in the driver by polling the hardware fairly aggressively to see if the timer expires. How the polling occurs varies across hardware architectures (e.g. CA4, CA3, SwitchBlock). The function returns with fairly little latency and jitter.

Additional Information

The default settling time is supposed to be enough to ensure the relays are settled. But that doesn't mean that the customer's signal had enough time to settle. A detail oriented customer trying to be both safe but optimize the program's execution time would look at the signal with an oscilloscope and choose the settling time carefully.