Hi everybody,
I want to write the instrument driver part of the GPIB communication. This should not be just a talk-then-listen communication but there should be the possibility to write more than once to my instrument. In my case the instrument is a robot which gets position and setup commands (in ASCI, like "StepServo7 20") which can take up to some minutes. Within this time there should be the possibility to send a *RST or other generic GPIB commands. So I currently catch the ListenerAddressed and TalkerAddressed flags with the Notify-function and handle the action in an if clause (like: if ((GPIBStatus.HasFlag(GpibStatusFlags.TalkerAddressed)) & !(GPIBStatus.HasFlag(GpibStatusFlags.Attention)))) when the Notify interrupt has fired. I then rearm and wait. My problem is at this point: after rearming the notify, it immediately fires again because the flags are still active but no write action was done by the controller on which my robot could answer on. So the ReadString function locks until a write operation is done. This is bad.
How can I do this better? I thought of using asyncronous write&read in my programm and cancel the operation with AbortAsynchronousIO() before the if-clauses are evaluated but this leaves an Error in the GPIB status which seems not to be a very sophisticated solution...
Anybody an idea?
Greetings,
Chris
C#, VisualStudio 2010, NationalInstruments.NI4882 library