Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch Executive doesnt wait for debounce

I am using LV with Switch Executive. In a FOR-Loop channels are connected and disconnected, then the DMM takes a reading. When putting a 100ms wait between Wait for Debounce and DMM Read, i get correct readings. When putting the 100ms Wait after the DMM read, readings are bad. It seems that Wait for Debounce does not really wait for debounce (channels are switched real fast). Setting Maximum Time to -1 or 1000 or 1 doesnt change anything. No error is given.
0 Kudos
Message 1 of 9
(9,180 Views)
NISE Wait for debounce calls the wait for debounce in the specific ivi driver of your switch.
You aslo need to use wait for debounce after each connect and diconnect call.
What switch are you using and what signals are you measuring?
0 Kudos
Message 2 of 9
(9,180 Views)
My switch is a SCXI1000/SCXI1127. DMM is 4060. In the FOR-Loop three functions are called: "Connect and Disconnect", "Wait for Debounce", "DMM Read".NISE Open Session, DMM Configure Measurement and such are called before the Loop. I am reading DV Voltages. When i switch on AutoRange in "Configure Measurement", readings are correct, but all is very slow. When i set a range, e.g. 25V, switching is really fast, but readings are wrong.
0 Kudos
Message 3 of 9
(9,180 Views)
I have rebuilt the situation using NI-Switch. The FOR-Loop contains two "connect channels", then "wait for debounce", "DMM read" and "disconnect all". With this vi i get the same bad results. Example: 12V on channel 8 to lo_ref. Measurement with 100ms wait: 12V. Measurement with "wait for debounce": 4V. Measurement without "wait for debounce" and without "100ms wait": 1 V.
0 Kudos
Message 4 of 9
(9,180 Views)
What channels are you closing in the 2 connect calls?

The debounce time seems to be working since you are measuring more voltage with it than without. It just might not be enough. The debounce time (called settling time on the SCXI-1127) unfortunately cannot be increased.

Can you attach your code inthe repply?
0 Kudos
Message 5 of 9
(9,180 Views)
Themad,

What you have to do is replace the DMM read by DMM read multipoint. The default "Number to Read" is one so you will only read one point in each loop iteration.

The wait for debounce is not at fault in you program. Actually if you time the 2 connect calls + the wait for debounce you should get something around 30 ms. If you remove the wait for debounce, you should get about 20 ms. The wait for debounce on the SCXI-1127 should last 10ms which agrees with the measured timing.

What is happening is due to the 4060 operation. The channels on the switch are closed and debounced, so 12V is avalable in the DMM. When you call DMM Read the first time, it initiates the DMM which starts taking measurements. Each point is transfered to a buffer in the
computer using DMA and as soon as the first point is available in that buffer it is fetched and displayed. The first point should always show you the correct measurement since it was taken after the relays on the switch are closed and debounced.
After the fetch (part of the DMM read) the points are still being taken and transfered to the buffer in the computer. When you call "disconnect all" and during the second iteration of the loop the buffer gets filled with measurement of 0V. When you get to the second "DMM read" the DMM is already initiated and the fetch will diplay the first point (not the last) in the buffer which was probably not taken after the wait for debounce call. In you case 4V. To make sure you get a point that was taken after the wait for debounce call, you will need to wait until the buffer gets full and replaces the first point by a 12V measurement. This takes around 60 to 70 ms.

"DMM read" is not the ideal call to use in this type of program with a loop because
of that "free running mode". If you replace "DMM read" by "DMM Read Multipoint" you should not have any problem reading the correct value in each iteration.

Sorry for the inconvenience and I hope this will help.
0 Kudos
Message 6 of 9
(9,180 Views)
This makes sense. Thank you for your comment. The only problem is that Read Multipoint gives an array of measurements while Read gives a single number. How can I transform that array into a single value?
0 Kudos
Message 7 of 9
(9,180 Views)
No problem.
Use "index array" with "0" as the index and you will get one element out of the array.
0 Kudos
Message 8 of 9
(9,180 Views)
Yes, it works. Thanks. But: The whole VI is running in a while loop to give users the choice to do many tests. Before the loop i do a DMM Initialize, Self Test and Revision Query. Only when i remove the Self Test and Rev. Query does the Read Multipoint give good results. When placing the two blocks on the block diagram, the 1127 switches very fast and readings are false. I am currently testing a bit more...
0 Kudos
Message 9 of 9
(9,180 Views)