Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear SRQ line?

Hi I am wondering if it is possible to clear the GPIB SRQ line in VB.NET?  I have a particular device that I am communicating with that loads a specific component and then once the loading has completed a status byte is sent out.  For some reason the status byte I am reading back is the previous status byte.  If anyone has any ideas that would be great.  Here is a brief sample of section of code that I am trying to do this.  Thanks for your help!

 

gpibDevice.Write("L" & vbCrLf)            'send command to load device

gpibBoard.WaitForSrq()                      'send command to wait for SRQ line

reading = gpibDevice.ReadString(20)   'read back status byte

0 Kudos
Message 1 of 14
(6,115 Views)

Hey snwbrdr,

 

I could not find on the way to control srq line, as it is set by the board or the device. You could only monitor them. I found this on ni's website which states all the commands in VB and also this link.

 

Merry Christmas and happy holidays

lab

0 Kudos
Message 2 of 14
(6,093 Views)

You cannot clear an SRQ condition directly, you have to instead serial poll your attached instruments, and when the instrument asserting SRQ is polled, it should stop asserting SRQ. I would recommend that you read the following Developer Zone tutorial, which explains how GPIB service requests and serial polling work. The examples are for Basic, and not the .NET API you are using, but it will give you the background you need in order to decide how you should be using it in your application. From your short example, you don't seem to be serial polling your instrument after you detect SRQ.

 

Serial Polling and SRQ Servicing with NI-488.2 Software and Basic

 

 

-Jason S. 

 

 

 

0 Kudos
Message 3 of 14
(6,083 Views)

Even Controller use ibrsp to serial poll the device, the SRQ line is still asserted.

there is no way to clear SRQ line from controller side!

0 Kudos
Message 4 of 14
(4,685 Views)

SRQ will be cleared when read by the controller, but maybe a new srq is generated again

greetings from the Netherlands
Message 5 of 14
(4,681 Views)

sometimes IBRSP works, that can deassert SRQ line.

but in most time, IBRSP only get status byte, that can NOT deassert SRQline.

please see below log:

 

2017-01-25 18:26:19,330 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:19,831 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:20,277 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:20,333 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:20,834 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:21,278 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:21,336 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:21,837 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:22,279 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:22,339 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:22,840 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:23,280 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:23,342 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:23,386 [1] DEBUG CommandA - ibrsp:85  []
2017-01-25 18:26:23,843 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:24,281 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:24,345 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:24,846 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:25,282 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:25,347 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:25,849 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:26,284 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:26,350 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:26,852 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:27,285 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:27,353 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:27,855 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:28,287 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:28,356 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:28,478 [1] DEBUG CommandA - ibrsp:85  []
2017-01-25 18:26:28,858 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:29,288 [14] DEBUG TestSRQThread - TestSRQ: 0
2017-01-25 18:26:29,359 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:29,861 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:30,289 [14] DEBUG TestSRQThread - TestSRQ: 0
2017-01-25 18:26:30,362 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:30,863 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:31,290 [14] DEBUG TestSRQThread - TestSRQ: 0
2017-01-25 18:26:31,365 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:31,866 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:32,292 [14] DEBUG TestSRQThread - TestSRQ: 0
2017-01-25 18:26:32,368 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:32,869 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC

 

0 Kudos
Message 6 of 14
(4,669 Views)

sometime IBRSP works, it can deassert SRQ line;

but in most time, IBRSP only get status byte, it can NOT deassert SRQ line;

please see below log:

 

2017-01-25 18:26:19,330 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:19,831 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:20,277 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:20,333 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:20,834 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:21,278 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:21,336 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:21,837 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:22,279 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:22,339 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:22,840 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:23,280 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:23,342 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:23,386 [1] DEBUG CommandA - ibrsp:85  []
2017-01-25 18:26:23,843 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:24,281 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:24,345 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:24,846 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:25,282 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:25,347 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:25,849 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:26,284 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:26,350 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:26,852 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:27,285 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:27,353 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:27,855 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:28,287 [14] DEBUG TestSRQThread - TestSRQ: 1
2017-01-25 18:26:28,356 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:SRQ:REN:NDAC
2017-01-25 18:26:28,478 [1] DEBUG CommandA - ibrsp:85  []
2017-01-25 18:26:28,858 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:29,288 [14] DEBUG TestSRQThread - TestSRQ: 0
2017-01-25 18:26:29,359 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:29,861 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:30,289 [14] DEBUG TestSRQThread - TestSRQ: 0
2017-01-25 18:26:30,362 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:30,863 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:31,290 [14] DEBUG TestSRQThread - TestSRQ: 0
2017-01-25 18:26:31,365 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:31,866 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:32,292 [14] DEBUG TestSRQThread - TestSRQ: 0
2017-01-25 18:26:32,368 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC
2017-01-25 18:26:32,869 [13] DEBUG CheckControlLineStatusThread - LINES: ATN:REN:NDAC

 

0 Kudos
Message 7 of 14
(4,669 Views)

Maybe time to tell us what device is hanging on the other side of the gpib cable.

greetings from the Netherlands
0 Kudos
Message 8 of 14
(4,663 Views)

Hi Albert,

thanks for your reply again! below are the testing environment.

 

1. two gpib cards are installed in my computer, and one cable is used to connect both gpib cards.

2. one application was running to simulate controller based on gpib0. it called testsrq by timer, and called ibrsp by clicking button randomly.

3. another application was running to simulate instrument based on gpib1. it called ibrsv 85 at begining.

 

thank you very much!

 

0 Kudos
Message 9 of 14
(4,647 Views)

Ok, I understand what is happening. You are both controller and slave and so you have to implement a correct slave response also. In this case the slave software should clear the SRQ line when asked for status....

greetings from the Netherlands
Message 10 of 14
(4,621 Views)