LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the GPIB Wait fucntion?

I am trying to follow this guide here:  http://www.ni.com/white-paper/4056/en/.   It seems pretty straight forward, however I am confused by the GPIB Wait function call inside the while loop of the Example 1.  

 

Here is the picture of the code from Example 1 that I am referring to (taken from the above website):

 

 

My issues are the following:

 

  1. First, why is GPIB Wait being called with address 0 instead of address 2 which is used by every other GPIB call in this example (which I assume is the address of the NI Instrument Simulator that the author used? 
  2. Second, why is the author using [what I think is] hexidecimal value of "x0" as the Wait State Vector input?  Why am I waiting on a 0 value if that corresponds to Device Clear state?

Here is the input value table from the GPIB Wait page:

 

wait state vector indicates the states for which the function waits. Each Boolean element in the array corresponds to a state that the device can wait on. If more than one element is set to TRUE, the function terminates when any one of the states exists.

The following table defines the states that you can specify in wait state vector. This table also lists the numeric value and description of each element. While these elements are the same as those that other GPIB functions return, only the states listed are valid for this function.

Wait State Vector BitNumeric ValueSymbolic StatusDescription
0 1 DCAS Device Clear state
1 2 DTAS Device Trigger State
2 4 LACS Listener Active
3 8 TACS Talker Active
4 16 ATN Attention Asserted
5 32 CIC Controller-In-Charge
6 64 REM Remote State
7 128 LOK Lockout State
12 4096 SRQI SRQ Detected while CIC
13 8192 END EOI or EOS Detected
14 16384 TIMO Timeout

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 1 of 3
(2,551 Views)

Oh yes, and one more comment (that would apply to your other post as well)...

 

The GPIB VIs you are using are very old. You should only use the VISA drivers for any new work.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 3
(2,546 Views)

Well would you mind explaining how to use the VISA commands to do basically the same thing as this example?  I am trying to find a way to wait on a SRQ and then respond depending on what is discovered from the Status Byte from the Serial Poll.  The only example I could find via google was this one.  (Perhaps I was searching for the wrong topic?)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 3 of 3
(2,543 Views)