Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5565

ibrd() takes too long

$
0
0

Also posted, in much greater detail (no word limit) at StackOverflow - http://stackoverflow.com/questions/16749913/programming-agilent-counter-gpib-ibrd-takes-too-long 

 

I'm programming an Agilent "Universal Counter" (53132A 225Mhz model) over GPIB using the National Instruments driver and C interface.

 

I want to measure the Time Interval between two clock signals (1 PPS - pulse per second). I am definitely getting one edge per second. But, my app makes a measurement every 2 seconds and the reason is that fetching the result takes about 1.9 seconds.

 

My thread loop is to start a measurement (SCPI cmd INIT) and read the result (SCPI cmdFETCH:TINT?). Do this in a tight loop as quickly as possible. Which would easily handle I measurement per second, except reading back the result takes forever (well, 1.9-ish seconds)...

 

Debug output shows:

SendSCPICmd at 1369486341s
SendSCPIQuery at 1369486341s
SendSCPIQuery: ibwrt() at 1369486341s
SendSCPIQuery: ibrd() at 1369486341s
***SendSCPIQuery: ibrd() took 1994ms***
Result at 1369486343sPosted to queue at 1369486343s

So, now I know I'm throwing a lot of code down next, but if you have the time an inclination to look, I'd very much appreciate ideas as to why ibrd() in the function SendSCPIQuery() takes such a long time to complete after the FETCH command has been sent? Any ideas appreciated :)

 

<For code samples please view the stack overflow post (link at top of post, thank you)


Viewing all articles
Browse latest Browse all 5565

Trending Articles