02-25-2011 08:43 AM
My program requires that I 'Start' my VISA device, poll it every second 10 times without clearing the device buffer. It is a counter and we are trying to accumulate counts over a 10 second period.
I first initialize the device with the 'Sart' command then try to get data.
For some reason the vi consistently runs successfully only 9 times and generates an error on the 10th run.
I guess the simple answer would be 'Why don't you just take 9 samples for your data?' I'm hoping there is a better explanation so that I can do it properly.
02-25-2011 11:30 AM
The time out error on the VISA write to a GPIB device could be that the device did not ACK that it read the message.
On a quick look at your code, it first looked like you are sending \n at the end of your command, but you did not set the display mode of the Combo Box to "\' Code Display. So in fact what you are sending is SHOW_COUNTS follow by the "\" follow by the letter "n" and not a line feed.
How does your device handle the text "\n" at the end of the commands?
Does your device responed to the "System Error" command or the *STB command to see if it is setting an error flag?
Is it a SCPI device?
Most SCPI devices will hold up to 10 errors in it's system error buffer.
Just a guess without knowing much about your GPIB device.
02-25-2011 12:51 PM
This works. The ORTEC 996 does indeed send it's count value back.
I've been messing with it and it seems I may have stumbled on something.
The device (ORTEC 996 counter) sends the value 000000069; a second read must be done in order to get the numeric count value. I guess because I was only doing one read the rest of the data was sitting in a buffer and would mess things up.
I am trying it with 2 reads right now and it seems to be working.