Test and Measurement Forum

VB6 and ETS on an ADC212/100

Post general discussions on using our drivers to write your own software here

Postby markspencer » Tue Sep 14, 2004 3:55 pm

Hi Mike

Thanks for the code, I created a project with VB6 and used it, for me the code worked fine, it exited the ready loop. I was putting in a sinewave 1.66kHz amplitude 9.42 volts pk-pk.

Sorry, unless your signal was static (not rising or falling) and therefore not causing the trigger to fire, the code is correct, using the same signal in Picoscope how does it perform. Let me know your voltage and signal type and I will try again.

Best regards,
Regards,

Mark Spencer
User avatar
markspencer
Site Admin
Site Admin
 
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Postby mike_ims » Tue Sep 14, 2004 10:29 pm

I believe I figured out why I was not seeing the program return from the while loop. In short, I was not waiting long enough. However, there was another factor that I underestimated: the trigger threshold.

Code: Select all
        Dim max_ets As Integer
        max_ets = adc200_get_max_ets()
...
        ok = adc200_set_trigger(1, 0, 0, 0, 100)
...
        Call adc200_set_ets(max_ets, max_ets * 2, 1)
        ok = adc200_run(100000)
        ok = adc200_ready()
        While ok = 0
            ok = adc200_ready()
        Wend


This code stays in the while loop for about 2 seconds.

Code: Select all
        Dim max_ets As Integer
        max_ets = adc200_get_max_ets()
...
        ok = adc200_set_trigger(1, 0, 0, 0, 0)
...
        Call adc200_set_ets(max_ets, max_ets * 2, 1)
        ok = adc200_run(100000)
        ok = adc200_ready()
        While ok = 0
            ok = adc200_ready()
        Wend


This code stays in the while loop for 20 seconds.

I, too, thought that the trigger wasn't being hit because the signal was too low. Logically, I lowered the value of the trigger threshold to 0. I reasoned that by putting the trigger threshold at 0, anything would trigger the acquisition. It is obvious to me now that doing so has an adverse effect on the length of time necessary to sample in ETS mode. Also, my expectation of the length of time the sampling should take was well under 2 seconds. These 2 facts lead to the illusion of that the code was not leaving the While loop.

In conclusion, I am able to sample using ETS in the VB6 environment. I just need to keep the trigger level above 0, and have a little more patience. It might be worth mentioning the effects of a trigger threshold of 0 in your documentation. I realize that a threshold of 0 does not make much sense in reality, but there are a few crazy people (like me :wink: ) out there who do such things.

Thanks for your help.

-Mike
mike_ims
 

Previous

Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 3 guests