03-19-2012 07:36 AM
@Hossein128 wrote:
Hi,
Could you send your attachment again? I cannot open it.
Thanks,
Hossein
Call the web-master and read them the riot act ASAP.
Many if not all of the attachements have been broken since last week!
Ben
03-19-2012 03:53 PM
I did some more tests. I translated all commands from quick basic to the I/O assistant. The Keithley 2015 accepts all parameters, makes the measurements and stores all values in it's internal buffer. With quick basic I can easily read the values correct from the buffer, but with the I/O assistant the values I read from the buffer are different from the values that are in the buffer.
Does anyone know why the values read from the buffer with quickbasic are correct, but when read with the i/o assistant they are not correct? I have tried several formats and tried typecast convertors. The values are in ASCII format.
03-19-2012 04:43 PM - edited 03-19-2012 04:43 PM
In your 'measure AC Volt' assistant, you are not doing a read and parse. And in the next assistant, your read should be ASCII only.
If you continue to see differences, turn on NI-Spy/NI-I/O Trace from MAX and capture both your quickbasic and LabVIEW sessions.
03-20-2012 12:19 PM
@ Dennis:
In the measure AC voltage the command is given to start the measurement. The Keithley does this correct because I can scroll through the measurement result buffer with the keys on the instrument.
The read and parse is in the next I/O assistant block. This is where I try to retrieve the values in the instruments buffer. I tried to change it to ASCII only, but the I/O assistant does not allow this; it changes back to ASCII and BIN. So this is where the read value is different from the values that are in the buffer.
Hope someone can help.
03-20-2012 12:54 PM
No, you are not doing it correctly. You have a 'READ?' command for which you do not do a read and parse. Your next assistant has a CALC2:IMM;DATA? for which you do have a read and parse. For each time you send a query (a command terminated with a ?), you must immediately do a read and parse.
I have no idea why you can't change it to ASCII. I can.
Frankly, I would never use the I/O Assistant anyways. It's just as simple to use individual VISA Writes and Reads and your code is not hidden.
03-20-2012 03:25 PM
I have tried that as well, but looking at the manual and the way the quick basic program runs I conclude that the READ? command only tells the instrument to start taking measurements and to fill the instruments buffer. It does not send data back yet, so it is not a labview READ? command, it as a Keithley command. The DATA? command tells the Keithley to send data back, so therefore it is followed by a labview read and parse.
Also, the Keithley 2015 itself does the jobs that it must do correct and the readings are stored correctly in the instruments buffer. By using a quick basic program the values are send correctly to the PC. By using the same commands in labview the string send to the PC is not correct, or there is something wrong with the format. But what ....
03-20-2012 04:00 PM
Of course it's an instrument command and of course it tells the instrument to take a reading and put it in the buffer. That is why you need to read the buffer after sending the command. ALL commands with a ? suffix will place data in the buffer and you MUST read that buffer before doing anything else. The only way to get data back from the instrument is with a VISA/GPIB Read. The DATA? command all by itself does not send anything back. It does exactly the same thing as the read? - puts information in the instrument's transmit buffer.
This is all basic instrument GPIB and SCPI operations. You should find a tutorial before doing much more.
And have you followed my basic suggestion of running NI-Spy.
03-20-2012 05:15 PM
Did that right-away, NI-SPY is running, but I cannot use it on the quick-basic program. I can see in NI-SPY that the string send back is not correct. Believe me, many tutorials are on my desk here, but nothing gives me a solution, otherwise I would not post. OK, next thing is to try to retrieve the buffer using VISA read.
03-20-2012 05:38 PM
03-20-2012 06:05 PM
No, I have already added a parse and read immediately after the READ? command and also after a DATA? command to try, but that also does not give good values back. I start to wonder if it is probably a limitation of the I/O assistant, since it will only accept a maximum of 16 character, and the send string is longer. So I was thinking to work with individual visa reads as you suggested earlier.