Posted Wed, 01 Nov 2023 08:40:18 GMT by Bui, Quang Huy
Hello all
I using IVI Visa to comunication with Keithley 4200A through KXCI, some time our application send wrong command and KXCI display errors message table as attached file.
So with external comunication, How can I get this content error message?


 
Posted Sun, 05 Nov 2023 14:02:19 GMT by C, Andrea
Sounds like you are making very robust error handling in your application.

Looks like, right now, the only way for you to know the error detail is to look at tail of the KXCILogifile.txt in the C:\S4200\sys\kxci
In KXCI window, be sure to enable logging.
Can your application somehow map that drive location and do some file IO?

From the KXCI command set, you can interrogate the state of a bit in the status byte to know if an error has occurred.
But not aware of any way to query the error detail on this API.

Python sample for interrogating status byte:
​​​​​​​import time
import pyvisa
import socket


def main():
    rm = pyvisa.ResourceManager()
    dev_address = "TCPIP0::192.168.1.43::1225::SOCKET"
    my_4200A = rm.open_resource(dev_address)
    my_4200A.read_termination = "\0"
    my_4200A.write_termination = "\0"
    my_4200A.timeout = 1000

    # No Error in *IDN?
    print("Response to *IDN?: ", my_4200A.query("*IDN?"))
    status = my_4200A.query("SP")

    # Check bit B1 of status byte for previous command error
    if (int(status) & 0x02) != 0:  # Check bit B1 of SP response
        print("Error Detected. Bit B1 value: ", (int(status) & 0x02))
    else:
        print("No Error Detected. Bit B1 value: ", (int(status) & 0x02))

    # Error in *IDN?
    print("Response to *ID?: ", my_4200A.query("*ID?"))
    status = my_4200A.query("SP")

    # Check bit B1 of status byte for previous command error.
    if (int(status) & 0x02) != 0:  # Check bit B1 of SP response
        print("Error Detected. Bit B1 value: ", (int(status) & 0x02))
    else:
        print("No Error Detected. Bit B1 value: ", (int(status) & 0x02))

    my_4200A.close()


if __name__ == "__main__":
    main()

 
Posted Tue, 07 Nov 2023 01:30:46 GMT by Bui, Quang Huy
Hello Andrea,
Yes, I know that KXCI will save log data into file KXCILogifile.txt but our system only comunicate with Keithley PC through GPIB cable and If read log data and display error message continously to our application, we have to establish new connection like: LAN, Wifi... so It is every un-convinience.
For your method, interrogating byte status, I added it before but It is only check sucssess or un-success during writing command. So mean that, We don't have any command to extract data display from KXCI, right?
Posted Tue, 07 Nov 2023 17:03:10 GMT by C, Andrea
Is true.  At present the KXCI API has no means to read back the error detail.
I have created an enhancement request about it.
Posted Wed, 08 Nov 2023 00:10:29 GMT by Bui, Quang Huy
Great, thanks Andrea for your support!
Looking forward to hearing new update version of KXCI
Posted Thu, 01 Aug 2024 22:04:39 GMT by C, Andrea

An update:  with version 1.13 of Clarius software for the 4200A-SCS, there are now KXCI commands for error retrieval and error clear.

Visit tek.com and download and apply updated Clarius for 4200A-SCS.

:ERROR:LAST:CLEAR

:ERROR:LAST:GET

Posted Fri, 02 Aug 2024 01:00:58 GMT by Bui, Quang Huy
Hi Andrea,
Great, thank you so much

 

You must be signed in to post in this forum.