LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter 53132A Driver

Hi,
I am using AG5313xA driver that is written by Karel Pisala (National Insturments). The driver was last updated on 5/28/2003. I have the following problems:
1) If I run for the first time and try to measure a signal that does not exist, a popup dialog box appears indication time-out error and if I need to break or continue. I would expect  either error or a value of 0 Hz. I see on the counter display "HP-IB  -410" . This error would not be cleared unless I initialize the counter.
 
2) If I run for the first time and measure a frequency source (value say X Hz), then I would try to measure another source that is OPEN ( no singnal) the driver would report to me the previous value. This can cause my program to pass a bad device. How can I avoid this problem?
 
3) If the program stopped because of the time-out error, At times, I can not initialize the counter unless I shut it off. Is there any command that I can used to clear/reset all the devices that I have on the GPIB bus?
 
4) I would like you to direct my to the right driver or if you have any suggestions to solve the problem that I am having.
 
Thanks,
0 Kudos
Message 1 of 9
(4,363 Views)
Izzy -

You'll have to do some work to understand how the counter deals with its measurement cycle and measured data.  If it's a IEEE 488.2 device (and since it's HP it probably is) you can get the instrument state vis a status call and determine if the counter has data ready (measurement complete).  Counters are a bit different in that they aren't guaranteed to complete a measurement cycle (no signal present so doesn't trigger).  You either have to code to expect the timeout or else use the staus mechanism to check if the counter has data ready.  Counters are surprisingly hard to get programmed in a complete way so that you handle everything that can happen with a triggered measurement.  It would be nice if you could avoid some of the nitty-gritty low level issues but I usually find that I wind up having to understand the instrument completely.

Different devices have differing semantics as far as their output buffers (i.e. will they repeat a previously read measurement if addressed to talk again). 

You can either selectively clear the device (selected device clear IEEE 488.1 command) or all of the devices on a given controller  (DCL - universal device clear).  There are various 488.2 commands that result in the same thing.

A device clear should cause the counter to abort any in-progress measurement and clear its output buffer - this is probably described somewhere in the counter manual.

Hope this helps,

Menchar


0 Kudos
Message 2 of 9
(4,358 Views)
Hi Menchar,
Thanks for your advice. I agree with you. It is not that easy to program the counter. I will look into all the functions and the low level functions of the driver.
Thanks again.
 
0 Kudos
Message 3 of 9
(4,356 Views)

Hi ,

I have tried to use 'WaitForMeasureComplete' function and I got error (0XBFFF0015). I sent 'Initiate' function first then I sent  'WaitForMeasureComplete' before I make the measurement. Please let me know what I am missing.

Thanks,

0 Kudos
Message 4 of 9
(4,336 Views)
Izzy -

This instrument may have the "setup" "initiate" "fetch" semantics - but I'm not familiar with this particular counter.

If it does, you would initiate a measurement, check for completion, then fetch the measurement results.

You might see if there's a "read" command that does the initiate-fetch together.  It would take care of the wait for measurement complete for you then.

The instrument has a status register you can read to determine if data is ready or not - I always think in terms of the underlying 488.1 commands and I'm not as familiar with the 488.2 commands or whatever other native commands the instrument might have available - sorry.

Menchar
0 Kudos
Message 5 of 9
(4,330 Views)
Menchar,
Thanks again for your reply. I have tried initiate, WaitForCompletion and Fetch. It did not work. I also tried WaitForCompletion and Measure and did not work eaither.
 
 I am not sure where the NI appication engineers for LabWindows. When I put the same question in LabView forum I got an answer from an NI application enigneer in no time but sadly he was not famailiar with LabWindows dreiver. Is there any NI application enigneer who is looking at theses posts?!!!!!!!.
Thanks Menchar for your efforts.
 
0 Kudos
Message 6 of 9
(4,324 Views)
Hello Izzy and Menchar,
      I tried the CVI IVI driver with my 53132A and ran ag5313xa_example.c and got a timeout error in ag5313xa_InitWithOptions, but I did not have anything connected to the channels.  When I ran ag5313xa_InitWithOptions by itself, it worked fine.  I also gave the LabVIEW Plug and Play (project style) driver a try in LabVIEW 8.2 and the Initialize.vi worked great.  Have you tried running ag5313xa_example.c with data on the channel?  It is located at C:\Program Files\IVI\Drivers\ag5313xa.
        Let me know how the example works.

Cheers,

NathanT
0 Kudos
Message 7 of 9
(4,274 Views)

Hi Nathan,

I have tried the driver. I may have made some changes to configure the  trigger. However, if there is no signal present, the counter will time-out. Now, I am using an older driver and made some changes to accomondate for the time-out. I check if the signal precesnt first before I measure it based on Menchar advice. I also used  DisableBreakOnLibraryErrors (); and EnableBreakOnLibraryErrors (); to prevent the driver from displaying the popup dialog box that displays the time-out error.

Thanks,

0 Kudos
Message 8 of 9
(4,266 Views)
Izzy,
     I am glad that you found a work around for the no-signal timeout.  This was reported to R&D (# 497F9UZQ) for further investigation.

Cheers,

NathanT
0 Kudos
Message 9 of 9
(4,243 Views)