Posted Thu, 12 Jan 2023 13:53:31 GMT by Fischer, Axel
Hi,

I am controlling the 4200A-SCS via GPIB using KXCI. The communication works and I can write and read messages.

However, I have problems with using the commands "GD" and "EX" to interact with user libraries. Beforehand, I sent "UL" to switch to the user library commands.

The command "GD" results in the following response: "Description: ERROR: No user library module currently defined."

For example I have tested with "GD Matrixulib ConnectPins" among other user libraries/user modules. The user library modules that I have tested with are present in the system and can also be found with KULT or in Clarius.

Is there anything I can do to access the user libraries via GPIB? 
Would it be also possible to access user libraries/user modules via lptlib.dll?

Thanks and best,
Axel
Posted Fri, 13 Jan 2023 18:18:17 GMT by C, Andrea

Here is an older forum post showing some success, but with different module:

Successful Use of UL and EX with KXCI

Is the external 707x matrix the item you need to control?  Or just using it as a sample?

 

Posted Fri, 13 Jan 2023 19:01:04 GMT by Fischer, Axel
Thanks for the answer. Matrixulib ConnectPins is just an example that I tried as well, but it is actually about starting a self-made user module that aldready runs successfully in Clarius and can also be seen in KULT. I added the Matrixulib example to prove that also more standard libraries are not recognized at all. It seems that none of the user modules is found at all. Thanks for the link. I can also try the pmuulib but your example is actually as we already try to use the UL, GD and EX commands. I also checked what happens if I use a wrong name for a user library or user module. In both cases, the return message is "Description: ERROR: No user library module currently defined." So, it makes no difference whether I use the correct name or a wrong name which seems like KXCI cannot find the user libraries at all.

In your first reply, your write that you attached some pages, but I cannot see them here. Are they maybe missing?
Posted Fri, 13 Jan 2023 19:06:46 GMT by Fischer, Axel
One thing I have to add: After sending "UL", KXCI shows a warning:
"WARNING: Access to all GPIB instruments from the 4200 as controller are illegal"
Is this maybe relevant or does this only point to the fact that the 4200-SCS cannot control any other equipment via GPIB if KXCI is using GPIB to wait for external commands?
Posted Fri, 13 Jan 2023 21:59:19 GMT by C, Andrea
Here I've managed to attach the document.

As for the warning, I agree with you.  Once KXCI using GPIB is invoked, the GPIB interface can no longer be controller in charge.
So if you had a KULT library that controlled an external item over GPIB bus, seems there would be prohibition to execute that KULT code from the UL and EX of KXCI.....if using KXCI over GPIB.
Can you try LAN for KXCI?  If you use LAN, be sure to append null ('\0') onto your command strings.

What version of Clarius software is on your 4200A-SCS?
Posted Sun, 15 Jan 2023 19:33:44 GMT by Fischer, Axel
Thanks for the document. It is consistent with what I already tried.

Actually, I already tried to use LAN. However, there are two network adapters at the computer and if I start KXCI, it is connecting to the wrong network with the wrong IP. In KCON I did not find any option to select the IP address. Can you tell me how to change the network adapter/IP address that KXCI uses to run the server?
Posted Wed, 18 Jan 2023 20:40:52 GMT by C, Andrea
IP address is controlled in the "normal" way for a Windows computer (Network settings).
Good question about if it uses the upper or lower port.  I find that it uses the one that is connected to my network.
If I have LAN cable connected to both of them, I'm finding that KXCI will attach the IP address of the upper port.

I did a little experiment with the commands.
In KULT, build a simple Library and Module for the the system beep to play a tone.
I'm able to remotely execute it with the UL and EX commands.
The GD command brings back the info about the parameters of the library.
See the attached images.

I've got version 1.11 of Clarius on the 4200A-SCS
Posted Thu, 19 Jan 2023 17:00:27 GMT by Fischer, Axel

Thanks for cross-checking it. I will be able to test the beep example next week and will post my findings here.

Posted Wed, 01 Feb 2023 20:36:55 GMT by Fischer, Axel
I was able to test again with a 4200-SCS and I figured out that the GD command does not work right after sending the UL command. One needs to issue at least once beforehand the EX command. Attached you can find my KXCI log for GPIB and TCPIP/Socket communication. It works in both cases but not with GD right after UL as you can see in the beginning of the log.

So the problem is solved, but I guess it is some kind of bug, because I would expect the GD command to work immediately after UL as this could be helpful to check the communication before, e.g. a very long library module is started with EX.

One difference I saw between GPIB and TCPIP is that it is easy to trigger a Device Clear (DCL) with GPIB by calling the clear function of the visa runtime. However, there is no effect in case of TCPIP/Socket communication (see attached log). As Device Clear is not related to a communication command, I do not know how to trigger it in case of a socket communication. So far it looks like that a Device Clear at the beginning is essential to make proper current measurements.

Furthermore, I have the following problem with the EX command:
In case of GPIB, the EX commands returns the result once after the Library module has finished. However, in case of TCPIP the EX commands results in an immediate return of "ACK" and a second read operation to retrieve the result of the Library module times out (even for larger timeout values that are for example sufficiently high for the beep test function). The terminator is already set to be \x00 which works fine for other commands like retrieving measurement data or setting voltages. Could you crosscheck this with your beep example as well, please?

Thanks again and best regards,
Axel

You must be signed in to post in this forum.