11-03-2014 11:12 PM
With GPIB I can process SRQ with an eventHandler.
How do I process an unsolicited serial message? I image I'd also need some sort of handler for it too?
I can send the equipment a message and process the reply but it seems I'm missing any messages initiated by the equipment
Thx.
11-04-2014 04:04 AM
11-05-2014 01:07 AM - edited 11-05-2014 01:21 AM
You're right, i am getting messages on the serial buffer. But I am having to poll the buffer ... is there a better way to get the message as an event similar to a GPIB SRQ?
First I'm checking if there is anything on the buffer to process:
status = viGetAttribute(instrHandle, VI_ATTR_ASRL_AVAIL_NUM, &bufferSize);
Then I'm reading the buffer if something is there to process:
if (status == VI_SUCCESS && bufferSize>0) status = viRead(instrHandle,buffer,bufferSize,&retCount);
11-06-2014 02:13 AM
Hi
I'm not really familiar with C, I'm almost exclusevily programming in LabVIEW but I think that is the way to go.
And it is not very timeconsuming because anyhow some software needs to poll, be it at low or high level.
And you can determine when to poll because the low level VISA should buffer the messages.