12-23-2019 04:42 PM
Hi all,
I have been tried to connect the Keithley 6517B to PC using RS232-to-USB cable.
I would like to get continuous currents as a function of time from the 6517B.
I set up the parameters of both 6517b and PC COM port are the same; RS232 mode, 9600 baud rate, CR, NONE flow control, RDG=y, RDG#=y, UNIT=y, 8 data bits, 1 stop bits. I also tried several COM ports from 1 to 4.
This is my cable and RS232 extension: Ugreen RS232-to-USB (https://www.ugreen.com.cn/products/usb-2-0-to-rs232-serial-cable?variant=15398911737901)
Cable extension: iCan RS232 straight-through extension cable (https://www.canadacomputers.com/product_info.php?cPath=5_1340_1418_1450&item_id=005367)
I got a 6517b for RS232 example (RS232_6517BtracedataRS232_example 1.vi, attached), but the timeout expired error appeared at VISA Read. Before reading the data, the 6517B works well. (e.g., voltage set 1.0V, changed the mode as current measurement, and others).
Here are the error code and diagram for mine
Possible reason(s): VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.
I also got another example of 6517B for RS232 (RS232_6517BRS232_example 2.vi, attached). it indicated the same error as above.
Possible reason(s): VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.
IDN*? or other simple SCPI based commands work well, but I think only VISA Read part is not working.
It would be appreciated if you could advise me.
Is the cable (RS232-to-USB) issue?, the LabView programming issue?, or the parameter (baud rate, CR, or others) issue?
If the cable issue, we also consider the purchase of the Prologix GPIB-to-USB adapter.
Happy holiday and I hope you all the best. Thank you.
Solved! Go to Solution.
12-23-2019 09:40 PM
You are sending the INIT command and then immediately asking for the trace. You need to wait for all the points in your measurement to be measured before you can request the data. There are a few ways you could do this; time delay, *OPC?, *WAI, SRQs.
The later three are preferable the first will work if this is just a quick one time data collection need - send init, wait NNNs for measurement to complete, read back data.
Craig
12-24-2019 12:56 AM - edited 12-24-2019 12:57 AM
Hi Craig,
Thanks for letting me know the information.
Did you mean that I have to use some commands like "*OPC?, *WAI, SRQs" for delaying the reading the data?
If I'm right, I will try to do it as soon as possible. Thank you.
Regards,
Steven
12-30-2019 10:00 PM - last edited on 11-16-2024 03:11 PM by Content Cleaner
You could just set a longer timeout and wait. But read this to better understand synchronizing instrument requests.. https://www.ni.com/en/support/documentation/supplemental/06/using-instrument-status-registers-and-se...
12-31-2019 06:21 PM
Hi Craig,
Thanks for your considerations. I will read it.
If you don't mind, could you upload the vi as the 2018 version?
I couldn't test the uploaded file.
Thanks again, happy new year!
01-01-2020 04:40 PM
Hi Craig,
I mimicked your vi with "VISA Set Timeout" function.
However, the timeout expired error appeared without reading the buffer after the time, what I set as the timeout as 20,000 (in your example 2,000,000).
The measurements had been done before the timeout (20,000). I set to measure the point per every second for 10 secs, but ":TRACE:DATA?" didn't read the buffer from the equipment.
I think the problem is ":READ?" and ":TRACE:DATA?" these parts. the instruments didn't get back the data.
for the example 1 case (:TRACE:DATA?), it couldn't read from the buffer. it just indicated "" on reading buffer part.
for the example 2 case (:READ?), it could read once, but the error appeared.
It would be appreciated if you could give me other advice for me. Thank you.
01-02-2020 03:40 PM
In your code you need to set the timeout before you send the :INIT; command. That command starts the measurement and the wait is only 1000ms, but then you immediately ask for data which will cause the timeout.
In your original code you used a Line Feed, now you are using a CR as termination. Are you 100% certain you need either? VISA should handle that for you. You might be appending a second termination character.
Also the 6517B has a nice LabVIEW driver you could use...
Craig
01-07-2020 08:05 PM - edited 01-07-2020 08:10 PM
Sorry for the late reply. I have to finish some works first.
I know the 6517b has the NI driver, but this for GPIB... (recently, I ordered a gpib-to-usb cable to use this driver).
Now, I recognized that I should have used time delay before using the reading commands (e.g., :READ? or :TRACE:DATA?). I understood that's the reason why I couldn't get a real-time reading response from the equipment. Actually, I would like to do that.
However, even if I increased the timeout, I couldn't read the data. Still, I don't know how to solve/design for measuring/reading the data from equipment simultaneously or at once. Thus, I made two vi files, and it worked (one for control, and the other for reading).
I know that it is very stupid, but I don't have any ideas about how to simplify them. Now, I'm just about to use two files, or I will wait for receiving the gpib-to-usb cable to use NI driver...
If you have any advice for me, It would be appreciated. Thank you!
01-08-2020 12:19 PM
This is never going to be a real-time system, an Electrometer is not a high speed streaming type instrument. Integration times can be very long..some of mine are 1-2mins/pt.
You might want to review exactly what the :READ? and :TRACE:DATA? commands do as I don't think they are identical. Generally :READ? initiates a trace, then returns that new measured data. I'm not sure what :TRACE:DATA? does, but it might just be returning what is currently stored in memory and could be nothing at all. RTM.
You should look at the NI driver and how they sequence commands to accomplish measurements and data processing. It might work with RS232, I don't see why not except there might be som VIs that use GPIB bus specific *OPC/*WAI commands but those could be avoided easily enough. At the very least look at how they do the data parsing, it will make your life easier.
Craig
09-09-2020 07:19 AM
I think that :TRACE:DATA? is used for 6521 which is a scanning card (10 channels max) to be inserted on the rear panel of 6517B.