Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5665

Driver Error when using Notify

$
0
0

 I have a C# application using several devices and I want to use Notify for some of them. It works most of the time but for some devices addressing them cause a driver error. Here are the details.

 

I send a "*SRE 16" command to two or three devices, then I configure them to be polled on SRQ like this:

 

board.Notify(notifymask, notifycallback, null);  //mask selects bit 4

notifylist.Add(device);  //add to list of devices to poll on SRQ

 

(There are other devices on the bus  for which the response time is not critical and which are not configured for setting SRQ and are not in the list)  

The notify callback function only sets a flag to notify other threads which devices should be polled, something like this:

 

public static void notifycallback(Object sender, NotifyData notifyData)
{
foreach (GPIBDevice device in notifylist) { device.pollflag=true } //signal other threads all devices that should be polled

Thread.Sleep(50); //give other threads time to poll their devices before rearming

notifyData.SetReenableMask(notifymask); //rearm to allow next notify

}

 

This works quite well, but for some hardware (eg a Tektronics scope), even if it is not configured to set SRQ (not in the list above), simply sending it a command causes error n°0 (driver error) or n°28 (power failure?).  The same scope works perfectly when other devices are not configured for SRQ.  This is very strange and I don't know where to start to debug this.   


Viewing all articles
Browse latest Browse all 5665

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>