vxi_ip = "192.168.5.150"
instruments["R6581T"]=R6581T(ip=vxi_ip, gpib_address=22, lock=gpiblock, title="R6581T")
self.instr = vxi11.Instrument(self.ip, "gpib0,"+str(self.gpib_address))
self.instr.clear()
print("*IDN? -> "+self.instr.ask("*IDN?"))
print("TEMP? -> "+str(float(self.instr.ask(":SENSe:ITEMperature?")))+"˚C")
self.close_instr_conn()
[000] does not seem to work. Tried various forms.
About a cmd control driving a selector:
* one can debug the value sent to the selector but entering displayVar({page}.{control name}) instead of {page}.{control name}, on the "expression" line, the line just under the #cmdSetup.
* other functions like getExpression or match do not work there. They work in other situations, but cannot read from another control.
* :readmath: on the next line does not work
About the types of controls that drive the selector:
* combobox works as it should. Unfortunately for my use case, it is 3 clicks.
* checkbox sends "{text behind the checkbox}:{undefined number of spaces}{selected value}" to the selector, but that cannot be exploited since I do not have access to functions like match. No matter if :string: is added. The control does send the selected data via :write:
* comboboxhot sends "0" to the selector, no matter the selection. Otherwise, same as checkbox.
* radio sends "0" to the selector, no matter the selection. Otherwise, same as checkbox.
* slider sends nothing or empty string to the selector, no matter the selection Otherwise, same as checkbox.
* buttons sends nothing or empty string to the selector, no matter the selection. Otherwise, same as checkbox.
Can you look into this? It is not a blocker since combobox works, but it reeks like a (series of) bug(s) to me.
I have been playing around with it the past couple of days, I can talk to instruments using Python making use of the vxi11 system to specify the device by GPIB address, so if you can support vxi11 (if you don't already) that might mean that it can be used for a bunch of GPIB adaptors, as it seems pretty common.
It is not really bugs, but I will guess you are missing a :read: on the control. On most controls the variable will be updated when a value is returned from the device.
Changing the driver looks like a major enterprise, when I look at the files that use SCPIx. So I'm putting improving this (be it Mode or SCPIx) on my TODO list with "nice to have" priority.
Attached is the improved file, and I'll leave it to that for now. For me it is good to publish.
One remark: One cannot use #forceUpperCase with SCPIx, as then "none" will be translated to "NONE" and sent to the device, and then one must wait until a timeout. That looks like a bug, since #forceUpperCase is explicitly noted as something to use with SCPIx.
I downloaded the 2.28 version and see the E5810 option there, BUT it won't let me enter something like A:0 or A:22 in the ID field, it is not accepting the colon and stripping that out. so it ends up being A0 or A22.
I am keen to help you get this E5810A device up and running in TC.
It just occurred to me that when sending commands from python it included the GPIB interface and Device ids in its comms, such as “gpib0,22”, I didn’t see that in the comms from TC
Something is working, but I cant communicate with the DMM properly, I likely dont have the definition right as I have never done a GPIB def file.
using wireshark I can see TC is sending some commands to the E5810A, but im not getting a reply from the DMM, interestingly if I send a *IDN? from the command line in TC that doesn't get sent to the DMM, but I see a result in the window which matches the def file name, if I send READ? the DMM doesn't see it but I see it sent to the E5810A in wireshark.
I tried reading the info on the site relating to GPIB but there wasn't much said about it.
Attached is the file I am working on right now, most of it is commented out until I can get the basic comms working, maybe you can take a look and tell me what stupid mistakes I am making.
UPDATE:
It just occurred to me that when sending commands from python it included the GPIB interface and Device ids in its comms, such as “gpib0,22”, I didn’t see that in the comms from TC
#cmdSetup text Voc_List SAS_List
:write: LIST:SAS:VOC
:read: LIST:SAS:VOC?
:textwidth: 18
:tip: Enter comma-separated list of up to 512 Voc values
1000
LIST:SAS:VOC 64,63,62,61
;; E4360A: Tx <LIST:SAS:VOC 64,63,62,61>
LIST:SAS:VOC?
;; E4360A: Tx <LIST:SAS:VOC?>
;; E4360A: Rx <+6.400000E+01,+6.300000E+01,+6.200000E+01,+6.100000E+01>
;; +6.400000E+01,+6.300000E+01,+6.200000E+01,+6.100000E+01
LIST:SAS:VOC 64,63,62,61
;; E4360A: Tx <LIST:SAS:VOC 64,63,62,61>
LIST:SAS:VOC?
;; E4360A: Tx <LIST:SAS:VOC?>
;; E4360A: Rx <+6.400000E+01,+6.300000E+01,+6.200000E+01,+6.100000E+01>
;; +6.400000E+01,+6.300000E+01,+6.200000E+01,+6.100000E+01
Are there any known bugs with the text controls for device definitions?
Also, any suggestions on how best to tidy up the readback with :readFormat: or :readmath: ?
It returns each number in the comma-separated list in scientific notation, which isn't particularly human-readable. This would be straight-forward with a number field,
but I'm concerned I might have to try and shoehorn some standard java into the definition file to operate on an array or something!
#otherList
menuItem[0] = "Pull_DAC_Table.csv";
#otherData
var samples = 0;
var cmd = "CURR:DTAB:SAS?";
var currentTable = array(deviceRead(handle,cmd));
cmd = "VOLT:DTAB:SAS?";
var tempString = deviceRead(handle,cmd);
var voltageTable = array(tempString);
samples = countMatch(tempString,",");
tableInitHeader("index,Voltage,Current,Power");
var i;
for i = 0 to samples do
var v = voltageTable[i];
var c = currentTable[i];
var p = voltageTable[i] * currentTable[i];
tableAddRow(i,v,c,p);
i=i+1;
endfor;
chartx("Voltage");
chartCurves("Current","Power");
I'm trying to build all the necessary scripting/GUI so that my colleagues don't have to be fully versed in operating the software.
Below is the snippet that I'm working with - it all works except for the last two lines:Code: [Select]...
chartx("Voltage");
chartCurves("Current","Power");
Generally I will not recommend doing that from the device driver, but instead from a menu item.
If you really insist on putting it in the device driver you need to use, it uses the same #... commands as above:
runScript("#cmd");
or
runScript("#cmd1\n#cmd2\n#cmd3");
It was the runScript syntax that I was struggling with. Works really well now.
I still haven't gotten to working on the comma separated lists I mentioned previously. Trying my best to understand the use of #scpiCmd and #pgm#.
- On that note, is metadef limited to IDN? responses? *IDN returns the mainframe model number, but the module model numbers are returned by SYST:CHAN:MOD? (and then there's the option list which is another sub-set)!
Hi HKJ.
I ordered a replacement Atorch DL24M-H electronic load from China. However, the Chinese sent me an upgraded version of the DL24MP, which works on its own, but does not connect to the TC. I wrote to the Chinese that it wasn't working for me, so they sent me a communication protocol full of Chinese characters that mean nothing to me as a layman. You probably know from the last time you helped me that I don't know how to program, so I'm asking for your help again. I am connecting Chinese communication protocol. Thank you, Vladimir.
I tried adding it to ATorchPX100Devices and it didn't help. And that's probably the maximum of my programming skills.