I have a .NET Windows application running fine, using C# in Visual Studio with the NI 3.1.2 drivers. This requires 'namespace NationalInstruments.NI4882'. I create a new device using
device = new Device(boardID, (byte)gpibAddressNumericUpDown.Value);
to access the GPIB device specified in gpibAddressNumericUpDown.Value, and I'm able to read and write from it just fine.
Now how do I catch the exception if I put the wrong address in gpibAddressNumericUpDown.Value? I've tried
try {
device = new Device(boardID, (byte)gpibAddressNumericUpDown.Value);
}
catch {
}
and I don't seem to ever enter the 'catch' block. Object Browser for the NI Device object says something about "exceptions", but I don't know how to check for them or if that's what I want.
Thanks for any help!
Gerrit