Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

STBO sets on any read?

Using a TNT4882 in an instrument that I am designing, I monitor STBO (ISRO bit 6) to reset rsv in order to de-select the SRQ line. I set rsv via the AUXMR reqt command. I expected STBO to trigger on a serial poll command and/or *STB?, but discovered that it triggers (and thus the SRQ is cleared) on _any_ query or read command. Is this how it is supposed to work per 488.2?

Thanks,

Steve
0 Kudos
Message 1 of 6
(3,911 Views)
Steve,

I'm looking at 488.2-1987 (a little old, I know) at section 11.3.3, Service Request Generation. Subpoint (2) States that a "device shall...Keep SRQ asserted until controller has recongnized the service request and polled the device or has taken specific action to cancel the request (for example, *CLS command)". So, no, I would say that the behavior you describe is not 488.2 compliant.

I would recommend one of the two methods posed on page 4-13 of the TNT4882 reference manual. You don't mention what your STBO IE bit is, but it doesn't sound like you are using either one of the recommended methods for requesting service and responding to the resulting serial poll. The easiest way to request service is to keep STBO IE=0 then update STB and issue req
t when you want service. This is all detailed in the manual on pages 4-13 to 4-14, and here's an online manual link if you don't have one:

http://www.ni.com/pdf/manuals/370872a.pdf

Hope this helps.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,911 Views)
Scott,

Thanks for the response. My interpretation seems to match yours, in that the SRQ should clear as the result of a poll or a *CLS. My code is based on page 4-13 of the manual (at least that is what I think I did). I request an SRQ via reqt and update the STB (SPMR). Once STBO is set, I set the rsv bit in the SPMR low as stated on page 4-13: "When you write to the SPMR, write 0 to bit 6(the rsv bit)." Based on what you said, I just deleted the lines of code that wrote to the SPMR, and still found that any query resets the SRQ. It appears that the TNT4882 is doing this all by itself. According to comments on page 4-13, the reqt method should be used to comply with 488.2, but as we are discussing, it doesn't seem to work. Any suggestions?

Regards,


Steve
0 Kudos
Message 3 of 6
(3,911 Views)
I assume from your text that you are not using the STBO interrupt. The reason I ascertain this is because you indicate that you call reqt followed by a write to the SPMR. If you were using the STBO interrupt, you would call reqt, wait for an interrupt, and then write to the SPMR. However, STBO only sets if you have STBO IE set, so it appears as if you ARE using the STBO interrupt.

The solution is different if you are using STBO and if you are not using STBO. Can you please clarify whether you are using the STBO interrupt. Once we verify the mode you are using, we will be able to solve your problem.

Thanks.
0 Kudos
Message 4 of 6
(3,911 Views)
You are correct in that I am not setting STBO IE, but I am reading STBO from ISR0. I am confused regarding your comment "STBO only sets if you have STBO IE set." According to the TNT4882 Programmer Reference, page 3-84, "Bits in ISR0 are set and cleared regardless of the bits in IMR0." I have found this to be the case, as STBO is being set, but seemingly on any read command. It appears that either I am interpreting the documentation incorrectly, or STBO works differently when STBO IE is set or not set. If so, I haven't found any documentation on this issue, thus increasing my confusion.

In any case, I would prefer not to use a solution that involves a hardware interrupt if there is a good alternative. Your assistance is greatly apprecia
ted.

Steve
0 Kudos
Message 5 of 6
(3,911 Views)
If you read the documentation on 3-85, it states that "STBO is set by STBO IE & SPAS" and "STBO is cleared by pon + (write SPMR) + ~SPAS". Whether STBO sets and clears on it's own is probably undefined behavior. It is only something you should care about if you are STBO IE enabled.

If you are not using STBO IE, you shouldn't ever have to read it. To assert the SRQ line, you must enable reqt and then immediately follow that with a write to the SPMR register with bit 6 cleared. The TNT will automatically set bit 6 if the write to the SPMR was preceeded by reqt and will clear bit 6 if the write to the SPMR was not preceeded by reqt (if, for example, your status changed but the status change did not cause a service request).


The TNT will automatically unassert the SRQ line when it is serial polled. If you need to unassert the SRQ line prematurely, simply write reqf. This will cause the SRQ line to unassert.

Does this make sense? If you need more clarification, please let me know.
0 Kudos
Message 6 of 6
(3,911 Views)