Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

6221/2182A pair/ Problem with buffer handling?

6220, 6221 Current Sources
Post Reply
Jose_Colino
Posts: 9
Joined: February 9th, 2015, 10:42 am
Country: Spain

6221/2182A pair/ Problem with buffer handling?

Post by Jose_Colino » March 4th, 2015, 5:36 am

Dear sirs,

I am trying to read either channel 1 or channel 2 voltage from 2181A connected by triggerlink to current source 6221, and the source to the computer on Ethernet. The attached VI file
CHAN2 K2182 Read.vi
(18.88 KiB) Downloaded 1540 times
shows the commands and sequence. When I run it first time the result is okay (number of readings is two as expected), but the next times I run it no results are output in the read buffer; in fact, repeating the run gives succesful results exactly one time out of three runs.
You can see that data retrieval is accomplished with SENS:DATA?, but using SYST:COMM:SER:ENT? then TRAC:DATA? does the same problem.

Is this a buffer handling problem?

I would greatly appreciate any help

Jose C.

Dale C
Keithley Applications
Keithley Applications
Posts: 2849
Joined: June 10th, 2010, 6:22 am
Country: United States
Contact:

Re: 6221/2182A pair/ Problem with buffer handling?

Post by Dale C » March 6th, 2015, 10:57 am

Do you want to store data in the buffer?
Using the TRACE commands would do this.
To get the data out of the buffer use the TRACE:DATA? command.
Do not use READ? to get data that is stored in the buffer.
If you want to use READ? then do not set up the buffer with the TRACE commands.
Just set the sample count to 2 and use READ?
Then it will take two readings, every time, as long as TRIG COUNT is set to INF.

Jose_Colino
Posts: 9
Joined: February 9th, 2015, 10:42 am
Country: Spain

Re: 6221/2182A pair/ Problem with buffer handling?

Post by Jose_Colino » March 20th, 2015, 11:03 am

Hi Dale,
Following you reply I have succesfully used either READ? or TRACE:DATA? for data retrieval. Thanks a lot.

However I have now encountered a different problem when trying to retrieve data from the I/O buffer with TWO VISA READs inside a FOR LOOP, in a sequence such as VISA WRITE- VISA READ- VISA WRITE- VISA READ: after running a few iterations, the buffer readings from the two VISA READS are correct (in terms of number of bytes read < 256 or voltages), but the following iteration would return two buffer readings with a single byte (void), then, the next iteration returns again the correct numbers, and so on; precisely one correct result every other iteration.

How can avoid the "extra" byte in the buffer? Is this a matter of I/O buffer handling?

Best regards

Jose C.

Dale C
Keithley Applications
Keithley Applications
Posts: 2849
Joined: June 10th, 2010, 6:22 am
Country: United States
Contact:

Re: 6221/2182A pair/ Problem with buffer handling?

Post by Dale C » March 20th, 2015, 12:08 pm

Ok, you only need one :READ? within the loop.
Make sure you set the sample count to 2.
Then a :READ? should take two readings.
This would eliminate the need for the second :READ? and therefore the extra byte.

Jose_Colino
Posts: 9
Joined: February 9th, 2015, 10:42 am
Country: Spain

Re: 6221/2182A pair/ Problem with buffer handling?

Post by Jose_Colino » March 20th, 2015, 12:18 pm

Yes, I know that.
But I need to make two VISA READS in each iteration, so I can get independent Channel 2 and Channel 1 measurements.
What is the extra byte? Any idea to rid of it?

Jose C.

Dale C
Keithley Applications
Keithley Applications
Posts: 2849
Joined: June 10th, 2010, 6:22 am
Country: United States
Contact:

Re: 6221/2182A pair/ Problem with buffer handling?

Post by Dale C » March 20th, 2015, 1:33 pm

Can you post what it looks like?
Maybe If I see it I can offer some suggestions.

Jose_Colino
Posts: 9
Joined: February 9th, 2015, 10:42 am
Country: Spain

Re: 6221/2182A pair/ Problem with buffer handling?

Post by Jose_Colino » March 24th, 2015, 5:51 am

Hi Dale,
please find attached the VI file that I have written to measure resistance on channel 1 (delta mode) and voltage on channel 2 sequentially by means of a FOR LOOP. As it runs, it generates reasonable results sometimes, however from time to time the I/O buffer gets a one byte (\n) or a "DCL" statement (device clear). Besides the outcome of a VISA READ does not allways goes into the right read string but the next one. Please note that it needs to use two visa reads as I don't know how to programatically combine a delta mode measurement and a direct read on channel 2.

I tried to use the I/O Flush buffer utility without any sucess.

Any advice?

Many thanks in advance

Jose C.
Attachments
FOR LOOP AND TWO VISA READS_ CH2voltages + CH1deltas.vi
LV version 8
(61.34 KiB) Downloaded 1515 times

Dale C
Keithley Applications
Keithley Applications
Posts: 2849
Joined: June 10th, 2010, 6:22 am
Country: United States
Contact:

Re: 6221/2182A pair/ Problem with buffer handling?

Post by Dale C » March 26th, 2015, 10:21 am

Can you single step through this VI and get good results?
Or does it error each time and at the same place?

Jose_Colino
Posts: 9
Joined: February 9th, 2015, 10:42 am
Country: Spain

Re: 6221/2182A pair/ Problem with buffer handling?

Post by Jose_Colino » April 22nd, 2015, 3:36 am

Hi Dale,
I have solved it by adding extra VISA READS in the loop, as many as Visa Writes used.
Now I get measurements correctly in each iteration, but it takes too long (16-18 seconds per iteration) in Highlight Execution mode

Next I tried to build executables to speed it up but then LV couldn't open the resource ("insufficient location information or the device not present...").
In my computer (Windows 7) the visa resource is typically first opened with Keithley Configuration Pannel 856C06, and the 6221 being a TCP/IP SOCKET.
If I run MAX to open such a resource as a socket network device, validation fails and I get the same message ("insufficient location...)

This sounds like my configuration not being correct.

What do you think?

Jose C.

Dale C
Keithley Applications
Keithley Applications
Posts: 2849
Joined: June 10th, 2010, 6:22 am
Country: United States
Contact:

Re: 6221/2182A pair/ Problem with buffer handling?

Post by Dale C » April 22nd, 2015, 9:03 am

In Highlight mode it will take very long.
Also it sounds like the Ethernet connection configuration is not correct.
What firmware level of the 6221 do you have?
I believe there was an issue with triggers in the Ethernet mode with the 6221.
Let me know.

Jose_Colino
Posts: 9
Joined: February 9th, 2015, 10:42 am
Country: Spain

Re: 6221/2182A pair/ Problem with buffer handling?

Post by Jose_Colino » February 4th, 2016, 10:57 am

Hi Dale, I have not yet solved the problem.
I tried different VIs made by myself - as told in previous messages -also the LV 2009 Keithley drivers to control my 6221-2182A instruments and the problem always occurs with VISA READS that follow a VISA WRITE: the first time a particular Visa Read executes, it does not retrieve the instrument data correctly (only "DCL" or void string or the like), but the next time it executes, it may start retrieving the information requested.

I agree with you that it seems a problem of triggering in the Ethernet mode. The 6221 is connected as a TCPIP sockect.

The VISA Test Panel, that I can open in MAX, is set to enable termination character (LF), then I can output an ID query and get the instrument reply correctly. The configuration setting are the default (Lock, trigger, etc). But If I click on "Assert Trigger", It would not return an ok but goes red. How can I fix this?


P.S.- I am using VISA 15.0 on LV 2014

Post Reply

Return to “Current Sources”

Who is online

Users browsing this forum: No registered users and 3 guests