Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Agilent 4263B external trigger

Hi,

 

Actually I'm measuring with the 4263B. Works fine but I've some troubles with the external trigger. I can't find any solution that the programm waits for the next step until receiving external trigger from instrument. I've tried STB reading and VISA event handler but without success as I can't find any bit which shows me that the external trigger has come. It always ends in the same: external trigger has been given but VISA is getting an error as the programm goes to next steps and doen't wait for the signal.

Maybe some of you have an idea how I can handle this please?

0 Kudos
Message 1 of 5
(3,250 Views)

A full description of what you are trying to do would go a long way, as well as knowing what commands or just seeing your code.  (Maybe I'm missing the backstory, this looks a bit like a reply to another post?)

 

The typical way to handle instrument synchronisation is to either use *OPC? and wait for previous command to complete or use the instruments status registers explicitly to tell you when its ready. 

0 Kudos
Message 2 of 5
(3,222 Views)

Sorry if the information was to less. I've added a screenshot of the program part.

I've changed the waiting time to 5000ms too (to push the external trigger) but the STB remains still the same. The Problem I'm facing is that the routine runs from the beeginning to the end without waiting for the external trigger signal.

0 Kudos
Message 3 of 5
(3,204 Views)

I suggest you look at the driver for this instrument, it will help take care of these issues.  http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=3802

 

A few comments from looking at your code..

- You do a reset and clear, but don't wait before sending more commands.  I'd give the instrument 1s at least after reset just to be sure no commands are lost while it is uncommunicative.

- You send the trigger setup, then send an INIT immediately which triggers a measurement.

- Then you try to setup the status register but you also send a *OPC (*OPC means the instrument set operation complete flag of the status register regardless the actual state of affairs!  You should be using the *OPC? and reading the state and waiting until it returns completed)

- Then there's all the rest with STB?, which won't work as the *OPC has already set the operation complete.

 

Again, what are you trying to measure?  Look at the driver and the examples they provide. If you prefer not to use the driver, then look at some VISA status register use examples - http://www.ni.com/white-paper/2927/en/

 

And if you want someone to help with your code, attach the code not a picture of it. 😉

0 Kudos
Message 4 of 5
(3,198 Views)

Thanks for the links.

Used "OPC?" and "*STB?" commands in my function but there is no bit-change if the external trigger has been pulsed. Tried the given examples and found out that it seems there is no bit which shows that the external trigger has been set.  

 

I need the signal in the following: the instrument must wait for a pulse on the external trigger to measure. External trigger comes from a switch which says that a component is placed in the measuring environment and the measurement over some frequencies should start.

 

I've added the last own build version I've been used. The same function works for me for waiting of the short/open calibration.

 

Workaround: read the input values constantly and if the values are >0 and the value is not the same as before then do the next "real" measurement. Somehow a stupid solution (regarding lost time from continous status looping) but works.

0 Kudos
Message 5 of 5
(3,181 Views)