Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Event trigger with VISA

Hi Guys,
   I'm a freshman for VISA. And I'm so unconfident for the event response fuction integrated in visa. I'm not sure whether the queue and handler method could cover all requested function, which could realized by C++ directly.  Because the event type was very limited, and Service_Request acted so important fuction.
   By the way, I use GPIB to control Scope, but encounter a strange problem. I send a query command just as "*IDN?", which made the device feedback a string, but the GPIB couldn't do any singal to inform that he got a string, or readbuffer got something. I'm not sure whether GPIB didn't have the function or VISA event function couldn't support this fuction. Thanks a lot.
 
Regards
Joey
0 Kudos
Message 1 of 3
(3,436 Views)
I don't know what you mean by "GPIB couldn't do any singal to inform that he got a string, or readbuffer got something". Do you mean that after you did the VISA write that the VISA read did not return anything? Or do you mean you were expecting something to tell you that the instrument had data available? If you are expecting a notification, then you have to program the instrument to do this. There is nothing in the controller's read buffer until the VISA Read is executed. You would typically program the instrument to assert a service request when an operation is complete and your app would be waiting for a service request to be detected. That is how the GPIB protocol is designed. For something as trivial a *IDN? query, you just follow the write with a read. When a measurement is going to take some time and you don't know how long it will take, then using a service request would make sense.
0 Kudos
Message 2 of 3
(3,434 Views)
Yeah, I mean "do you mean you were expecting something to tell you that the instrument had data available". And at the beginning, I hope GPIB could tigger some event, when he received some bytes, just as RS232. But it seemed that I have to combine "write" and "read" command, or use Query.
And because The IO Complete event include AsyWrite and AsyRead, how could I distiguish them, I want to use multithread in the program. thanks a lot.
0 Kudos
Message 3 of 3
(3,425 Views)