Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make an application wait for the instrument to finish a command??

Hi all,

I want to make my application (written in Delphi 5) wait until the
instrument has finished processing the just sent command.

This worked without any problem when I wrote the application in VB5 and used
the vbib32.Send command.

Now I am using dpib.WriteToGPIB and it doesn't work at all. The application
continues immediately after sending the command to the instrument.

Does anyone have a clue what I am doing wrong??

Thanks.
/Anders
0 Kudos
Message 1 of 4
(3,444 Views)
Hi all

I made a mistake.
I an using dpib.ibwrt and GPIBCleanup. WriteToGPIB is just a wrapper I made.

/Anders
0 Kudos
Message 2 of 4
(3,444 Views)
There really is no way to have the controller able to wait explicitly for the instrument to finish executing the command unless the instrument has a special poll response flagging completion. The controller will wait untill all of the data has been successfully handshaked from the controller to the instrument but there is no way to tell if the instrument is finished unless you can determine if there is a response to be read or if there is a status byte you can serial poll for and compare. You may be able to use service requests (SRQ) to more easily synchronize your code.
0 Kudos
Message 3 of 4
(3,444 Views)
Hi Ryan,

I finally got the dpib.send command to work in delphi and NOW IT WORKS.
I don't know why, but thefocus does not return to my application until the
instrument (spectrum analyzer HP8591E) has finished the command.
Could it be because I use eotmode=1?
Or is there a significant difference between the Send32 command and the
ibwrt command?

/Anders

"Ryan M" skrev i meddelandet
news:506500000005000000E92A0000-986697009000@quiq.com...
> There really is no way to have the controller able to wait explicitly
> for the instrument to finish executing the command unless the
> instrument has a special poll response flagging completion. The
> controller will wait untill all of the data has been successfully
> handshaked from the controller to the
instrument but there is no way
> to tell if the instrument is finished unless you can determine if
> there is a response to be read or if there is a status byte you can
> serial poll for and compare. You may be able to use service requests
> (SRQ) to more easily synchronize your code.
0 Kudos
Message 4 of 4
(3,444 Views)