Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Ni-Device: InputQueueEventHandler must parse command?

Hi
Since version 1.0, the InputQueueEventHandler must detect a query in the input queue message buffer for the return value. That means, i must parse the message. But, i can know if the message is a query but i can't know if the message will not generate an EXECUTION ERRORS for example. If a error occurs in the execution control bloc, the output queue will be clear and the query will not return a response. Does it OK or i must wait until the command is entirely executed before return from the InputQueueEventHandler?

Thank you
Alain
0 Kudos
Message 1 of 2
(3,166 Views)
Dear Alain,

You are correct, your firmware must detect whether or not a query was present in the input queue message buffer before returning from the InputQueueEventHandler. From my investigation into the IEEE 488.2 specification, the message exchange protocol does not make any provisions for an execution error. If the user places a valid query header, the parser should set the query message true (i.e., returning false from the InputQueueEventHandler). If the Execution control then realizes that the query is unexecutable due to an execution error, the device will not have a response to the query. The device will still, however, move from QUERY to RESPONSE in the MEP diagram. There are three scenarios:
1) If the host application clears the device (if, for exa
mple, it had generated SRQ and the host determined it was in an error state), the MEP transitions to IDLE.
2) If the host application attempts to read the query, it will timeout and the MEP remains in RESPONSE.
3) Finally, if the host application sends another set of data, the MEP will transition to READ generating a query error.

Therefore, you should just return true from the InputQueueEventHandler when you detect a valid query header. The EXECUTION error should have no direct affect on the MEP.

Thanks,

Eric Singer
National Instruments
eric.singer@ni.com
0 Kudos
Message 2 of 2
(3,166 Views)