Test and Measurement Forum

Adc212 and timbase and close_unit

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

Adc212 and timbase and close_unit

Postby Guest » Thu Jul 15, 2004 2:21 pm

I am using labwindows cvi and I have finally gotten my program to talk with the scope. I would like to be able to set the interval for samples to 10 microseconds, so I sample at 100Ksamples/second on each channel. I have tried changing the timebase to get as close as I can. Can the sample frequency only be multiples of 333 hz for the adc212?

Also I have found that when an error causes my program to terminate the connection to the adc212 is not closed. When the program is restarted it can no longer talk to the same port number. I can keep trying until I find an open port, or restart my computer to fix the problem. This is only a temporary fix, I would like more permanent error handling for the program. If the unit is not closed and the program is terminated is there anyway to recover the ports or close them so they can be reused?



Postby markspencer » Mon Jul 19, 2004 8:10 am


Thank you for your post, and question relating to the ADC-212 series timebases. To calculate the timebases, take the the maximum sampling rate and divide it into one ie. 1/3,000,000, this will then give you the maximum time interval. To calculate the next time interval divide the sample rate by 2 and then divide this answer into 1.

timebase 0: 1 / 3,000,000
timebase 1: 1 / (3,000,000 / 2)
timebase 2: 1 / (3,000,000 / 4)

Therefore, the no of samples are divided by a half each time. The ADC-212 series has 15 timebases, thus

timebase 15: 1 / (3,000,000 / 2^15)

To get the sample rate that you require, the closest is 10.666667 microseconds.

timebase 5: 1 / (3,000,000 / 2^5)

This above is for an ADC-212/3. To calculate the sample intervals for the ADC-212/50 or ADC-212/100 then you substatute the 3,000,000 with 50,000,000 and 100,000,000 respectively.

With regards, the closure of the ADC-212/3, when your program crashes the reason that your port is not accessable afterwards is that the port is not closed by the program. Unfortunately, there is no way around this except to handle unexpected events in your code, as the adc200_close unit needs to be called to release the port.

Best regards,

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

Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests