05-17-2006 12:26 AM
05-17-2006 03:01 PM
05-18-2006 08:52 AM
05-22-2006 08:10 PM
05-23-2006 07:10 AM
05-23-2006 01:18 PM
03-01-2010 07:04 AM
hello
I have excactly the same problem! Same code, just in c#.
Unfortunately a device restart isn't a solution for me (and my customers).
Can anybody help me with this problem?
Here's my sourcecode:
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
if (device != null) {
device.Dispose();
device = null;
}
device = new Device(0, 1);
device.Reset();
Thread.Sleep(1000);
device.Clear();
device.write("*CLS");
device.write("*idn?");
string idn = this.read();
// -> device.write( Commands );
Callback = new NotifyCallback(SRQ_Notify);
device.Notify(GpibStatusFlags.DeviceServiceRequest, Callback, "test");
// -> device.write( Start );
}
private Device _device = null;
private Device device {
get {
return _device;
}
set {
_device = value;
}
}
NotifyCallback Callback = null;
private void SRQ_Notify(object sender, NotifyData e) {
SerialPollFlags SRQ_Return = device.SerialPoll();
if (0 != (SRQ_Return & SerialPollFlags.RequestingService)) {
byte[] res = this.read_bytes();
int sec = BitConverter.ToInt32(res, 7);
if (sec == 0) {
// -> device.write( Stop )
}
}
e.SetReenableMask(GpibStatusFlags.DeviceServiceRequest);
}
}