Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Is NL removed in END_MSG_RECEIVED event in InputQueueEventHandler method?

Hi!

We have Ni-Devive 1.3. I was running & debugging a simple application created with the example provided with NI-Device documentation. I found that, in END_MSG_RECEIVED event of InputQueueEventHandler method, there is no END message (Newline character) in the buffer 'pMsgBuffer'. But, in the NI-Device help for InputQueueEventHandler method, it asks us to send the END message with the Input Queue buffer to the Parser.

I am getting confused as to what END message is there to parse, if InputQueueEventHandler method removes it? Please help!!!

Sanjay
0 Kudos
Message 1 of 3
(3,492 Views)
Hi Sanjay,

The END_MSG_RECEIVED event does not remove any termination characters. The message buffer contains whatever was received through the bus. The END message refered to is the termination methods of the GPIB bus.

When this event occurs, the handler should sent to the parser the input message as well as some END token.

DiegoF.
0 Kudos
Message 2 of 3
(3,492 Views)
Sanjay,

Here is another clarification. END does not necessarily refer to a newline character. For GPIB, it refers explicitely to the EOI hardware line. A 488.2 device is required to send a newline character along with the EOI line to terminate a response.

You normally pass tokens to a parser to indicate how it should handle data. With a 488.2 device, normal tokens would be 'data', 'end', 'unterminated', 'clear', 'trigger', and possibly some others. When the parser reads a token, it performs some "magic" on it (parses it).

Here are a couple of scenarios.
1)Device receives an input queue event buffer with BUFFER_IS_FULL. The device would pass a data token to the parser with the data received.
2) Device receives an input queue event buffer with END_M
SG_RECEIVED. The device would pass a data token to the parser with the data received. Then, it would pass an end token to the parser. The parser parses the messages in the order received. It acts on the data, then it acts on the end token. The normal behavior after parsing an end token is to invoke the method "AcknowledgeEndOfMessage".

I hope this is a little clearer for you. I can see if I have some sample code that you can look at to see how this normally works.

- Eric
0 Kudos
Message 3 of 3
(3,492 Views)