LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple GPIB SRQ polling

Hi all, i have an ongoing problem with my 4 counters(PM6681).  Each counter is individually connected via gpib-usb gateway.  Each counter receives a burst randomly generated to occur every 50s +/- 2.5s so over time, it could be possible all 4 counters receive a burst at exactly the same time.
In my code, i monitor the time between bursts and every now and again i recieve a time between burst of approx 100s which would mean that the srq has not been generated or missed.
I am using a polling technique to "test srq" every 20ms until true.  I have checked that the code is not hanging during processing data and can confirm that the code loops back around, re-initialises the counter then enters the wait state(srq poll).
Could there be a problem with my PC where it can only handle 1 srq at a time even though i have 4 separate gateways.  They must merge together somewhere in pc so that LabVIEW can poll?
Any ideas or previous encounters?
Thanks
Grant
0 Kudos
Message 1 of 9
(3,363 Views)
You said you have a loop to test SRQ every 20 msec or so, but what are you using to find which devices requested service? If there's a possibility that more than one device can request service at or near the same time, then you should be doing an "all serial poll" to get the status byte from all devices and then you'd have to check bit 6 to find out if that particular device is requesting service. Also, when you said you test SRQ and determine that it's true, do you put that into a queue, or something, or do you do processing, and the loop doesn't restart until you've finished your processing, like taking care of the request? If it's the latter, then you may miss service requests since you're busy handling the last one.
0 Kudos
Message 2 of 9
(3,328 Views)
Here is my code.  The 1st picture is on the top level where it shows the initialise of the counter, then sending gpib commands and then going into the wait for srq subvi.
The second picture shows inside the wait for srq subvi.  Each counter has its own bus that the "test srq" vi will poll, so basically there are 4 lots of these vi`s that run independently.
0 Kudos
Message 3 of 9
(3,314 Views)
Pictures not attaching so i will describe a bit more:  I have a sub vi called begin wait for srq where i send gpib commands to send an srq on operation complete.  The next sub vi is called wait for srq where i have a while loop (controlled at 20ms) the has the test srq gpib vi.  This outputs either a true or a false which i have wired to the stop loop.  So it will just keep on looping around until it receives a true from the test srq vi.  The reason i used this is so that the processor will not be stuck waiting on one counter.  After the 20ms, it will check the other 3 counters in the same fashion.  Well that is the idea anyway.
0 Kudos
Message 4 of 9
(3,306 Views)
You need to upload the pictures using the attachment section below the area where you write the response. You can't link to a document on your computer. Also, renaming a bitmap to .jpg doesn't make it a JPEG. I suspect you probably did this because the forum software doesn't allow bitmap uploads. If you're running Windows just open the bitmap in Paint and resave it as a JPEG.

Unfortunately, your descriptions seem to be contradictory. You first said that you had 4 "lots" of VIs running independently, but in the other response you said that after the 20 msec that checks for SRQ "it will check the other 3 counters in the same fashion". Can you post your code? It will be easier to provide a more direct answer.

Based on the one image that did get through you seem to be mixing VISA with regular IEEE488.2 functions. It would be better to use VISA throughout. If you take a look at this document: http://zone.ni.com/devzone/cda/tut/p/id/4629, you'll see an example of how to do this using VISA.

Also, does the device you're talking to support the *OPC/*OPC? commands? That might be easier to use. At least I've usually found it easier than messing with SRQs.
0 Kudos
Message 5 of 9
(3,297 Views)

Here is my code that relates to the wait for srq.  Each of my 4 individual vis that are running at different times will be in cloned versions of this wait for srq state.

Thanks

Grant

0 Kudos
Message 6 of 9
(3,284 Views)
Sorry, I only have LabVIEW 8.2 so I can't open the VI. Can you resave it as 8.2?
0 Kudos
Message 7 of 9
(3,280 Views)
0 Kudos
Message 8 of 9
(3,266 Views)
You're still mixing APIs. Stick with either VISA or straight IEEE488.2 functions. Don't use both. Open the Example Finder (Help->Find Example) and do a search for "VISA". Open the example "SRQ Event Handling". This shows you how to watch for SRQ events using VISA.

Also, the sequence structure is not necessary. You already have dataflow enforcing execution order, so the sequence structure is irrelevant.
0 Kudos
Message 9 of 9
(3,260 Views)