Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

error with *OPC? command

 Hello,

 

I have a tektronix TDS2024B and I using GPIB with VB 6.0 and am trying to load the command sequence by using the *OPC? for synchronization (typical example that comes with the programmers Manual)

 

/* Set up single-sequence acquisition */

SELECT:CH1 ON

ACQUIRE:MODE SAMPLE

ACQUIRE:STOPAFTER SEQUENCE

/* Acquire waveform data */

ACQUIRE:STATE ON

/* Set up the measurement parameters */

MEASUREMENT:IMMED:TYPE PK2PK

MEASUREMENT:IMMED:SOURCE CH1

/* Wait until the acquisition is complete before

taking the measurement */

*OPC?

Wait for read from Output Queue.

/* Take peak-to-peak measurement on acquired data */

MEASUREMENT:IMMED:VALUE?

 

....but when the *OPC? query is executed I receive the following error:

 

Unable to read from device

ibsta =  &HC100

iberr = 6<EABO>

 

Does somebody knows what I am doing Wrong?

 

Thanks in advaced

 

0 Kudos
Message 1 of 7
(9,862 Views)

Hi Delt;

 

The error 6 commonly appears when your acquisition function is timing out, this means your function is being aborted before it has a chance to capture your data. You can modify the timeout value and see if this solves the issue. Another possible cause for this issue is that your device is in hold mode.

 

Hope the information is useful.

 

Good luck.

Francisco Arellano

National Instruments Mexico
Field Systems Engineer - Energy Segment
www.ni.com/soporte
0 Kudos
Message 2 of 7
(9,834 Views)

Hi Francisco,

 

"The error 6 commonly appears when your acquisition function is timing out, this means your function is being aborted before it has a chance to capture your data. You can modify the timeout value and see if this solves the issue"

 

     It makes sense ...but where can I modify this time out ?

Do I need to add some considerable Delay after the command  "AQUIRE:STATE ON" ?

or there are some property in MAX that can I modify? 

 

"Another possible cause for this issue is that your device is in hold mode."

 

 Whenever I write this sequence of commands the scope looks like remains frozen.....is This signifies hold mode?

 How can I  take away the scope of hold mode?

 

Please forgive me for this probably obious questions but it is the first time I work by aquiring data form a scope with GPIB

 

Thanks for your help

0 Kudos
Message 3 of 7
(9,822 Views)

Hi;

 

I attach you a link to a document that can be very useful, it contains a list of the commands you can use to control GPIB, in this case you can change the timeout value either when defining a device object using the ibdev function (and changing the tmo value) or by using ibtmo function, which specifically changes the timeout value. The link to this document is:

 

http://zone.ni.com/devzone/cda/tut/p/id/3847

 

Another document I think can be helpful is this, it explains some common reasons that take to specific error messages and their possible solutions, in this case those referring to EABO.

 

http://digital.ni.com/public.nsf/allkb/2FA525A8585A92E9862566EE002A3755?OpenDocument#EABO

 

I hope the information is useful.

 

Good Luck

Francisco Arellano

National Instruments Mexico
Field Systems Engineer - Energy Segment
www.ni.com/soporte
0 Kudos
Message 4 of 7
(9,781 Views)

You just hit one of my favorite hot topics!  Remember that a GPIB bus has parallel handshaking.  The *OPC? will return under 2 conditions: a) the maximum timeout expired and b) The GPIB controller observed that the a Service Request was initiated by the specific address on the bus. 

 

The controller conducts polls sequentially from address 1 to 30 and stops at the first address that is asserting SRQ.  Therefore, if any other lower address is asserting SRQ it will mask your o'scope's service request untill it has been serviced (if no other loop is looking for this SRQ at the lower address you will timeout regardless off the O'scope function).  This can burn you pretty hard during debug because you forget to look at the other bus children.

 

I always try to avoid dependance on SRQ and you can almost always code around it. One method that works well for TEK O'scopes is:

1: Read tmo (VISA property node>Timeout value)

2:set tmo to a low value (500mS) (VISA property node>Timeout value = 500 )

3: Read number of acquisitions from the O'scope

4: Trigger the scope

5: Enter a loop that reads number of acquisitions from the O'scope (exit when it increments or number of iterations is insane)

6: get your reading

7: SET the tmo back to its original reading ( Remember this isn't the only VI that uses tmo if you don't set it back you may get unexpected results in another O'scope vi.

 

Your LabVIEW gurus will tell you this is poor practice for code effecientcy (and it is).  But it is the most effective for avoiding re-writing your drivers when you hang non-complient devices on your GPIB bus (or change addressing)

 

enjoy!

 

 

 


"Should be" isn't "Is" -Jay
Message 5 of 7
(9,758 Views)

Hi Rhialter  

Thanks for the Replay and yes....very useful information

 

Hi Jeff 

Thanks for the information.....since my aplication is in VB6.0,  I will try to find out the instruction that you say within the link provided by Rhiatler in order to modify the value of tmo register and see what happen

 

Sorry I have a new issue :
When I configure DAT:ENC SRIbinary  and Query the Curve? command  I receive special characters (›œœ...) in my String  not able to decode
This is the Binary Information Received with Curve? query...
"#45000STTTSTTTTœœœœœœœœœ›œœ›œœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœœž"

I contact this morning Tektronix Support for this issue and they explain me that the Curve query  is only capable of giving ASCII, not Binary and need to check with NI support for limitations within the NI-488.2 library...

Do you have experimented this issue occasionally in VB6.0?

0 Kudos
Message 6 of 7
(9,747 Views)

Delt,

 

LabVIEW vi's link to the same library, VISA32.DLL, that VB6.0 would call for VISA communications.  Are you using 488.2, VISA, or IVI calls in you scope driver?  I recommend that you use the VISA calls as this abstracts a good portion of the GPIB protocol and makes more readable code yet, provides more flexability than a IVI class specific driver.  


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 7
(9,735 Views)