Author Topic: Program that can log from many multimeters.  (Read 489488 times)

0 Members and 3 Guests are viewing this topic.

Offline Scheppo

  • Contributor
  • Posts: 23
  • Country: de
Re: Program that can log from many multimeters.
« Reply #2350 on: April 13, 2022, 06:05:29 pm »
Thank you for the infos.

The only way to readout V and A from the Channels ist the Command READ
READ output always all Channels in one String:
21.00V 22.00V 23.00V 24.00V ;1.100A 1.200A 1.300A 1.400A ;OFF F1 OFF F2 OFF F3 OFF F4
I need only the first 8 values.

Your Code for reading V and A dont work:
#scpiCmd getVoltage txrx? READ
:readmath: replace(getElement(value,inputValue-1,"[; ]"),"V","");
#scpiCmd getCurrent txrx? READ
:readmath: replace(getElement(value,inputValue+3,"[; ]"),"A","");

If i change inputValue+3 to inputValue+2, the output of getCurrent is 23V
Iam not a programmer, so i dont know what is wrong with the Code.
« Last Edit: April 13, 2022, 06:07:46 pm by Scheppo »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2351 on: April 13, 2022, 06:17:44 pm »
Thank you for the infos.

The only way to readout V and A from the Channels ist the Command READ
READ output always all Channels in one String:
21.00V 22.00V 23.00V 24.00V ;1.100A 1.200A 1.300A 1.400A ;OFF F1 OFF F2 OFF F3 OFF F4
I need only the first 8 values.

Your Code for reading V and A dont work:
#scpiCmd getVoltage txrx? READ
:readmath: replace(getElement(value,inputValue-1,"[; ]"),"V","");
#scpiCmd getCurrent txrx? READ
:readmath: replace(getElement(value,inputValue+3,"[; ]"),"A","");

If i change inputValue+3 to inputValue+2, the output of getCurrent is 23V
Iam not a programmer, so i dont know what is wrong with the Code.

Two details:
You have to add a ? on the getCurrent and getVoltage commands
When using them you have to specify channel after the command, i.e. getCurrent? 1
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2352 on: April 13, 2022, 07:33:04 pm »
Hello

Sorry to come back in the middle of this discussion. I finally managed to connect to my device with an AR488. It works pretty well.

I have the following problem. This device returns ASCII strings and I need to "extract" numbers. I am sending this command:

Code: [Select]
txrx? FREQ A
and it returns this:

Code: [Select]
;; FREQ   001.038546E+3
1) How do I get the number out of this string?
2) Can I multiply this value by 1000 and convert it to an integer?

Can I send the resulting command on the command line to verify its behaviour?

Thanks for your help.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2353 on: April 13, 2022, 08:24:02 pm »
Hello

Sorry to come back in the middle of this discussion. I finally managed to connect to my device with an AR488. It works pretty well.

I have the following problem. This device returns ASCII strings and I need to "extract" numbers. I am sending this command:

Code: [Select]
txrx? FREQ A
and it returns this:

Code: [Select]
;; FREQ   001.038546E+3
1) How do I get the number out of this string?
2) Can I multiply this value by 1000 and convert it to an integer?

Can I send the resulting command on the command line to verify its behaviour?

Code: [Select]
#scpiCmd getFreqA? txrx? FREQ A
:readmath: getElement(value",1)

You define your own command in the definition file as shown above.
TestController will automatic convert between text and numbers when needed.
 

Offline Scheppo

  • Contributor
  • Posts: 23
  • Country: de
Re: Program that can log from many multimeters.
« Reply #2354 on: April 13, 2022, 08:52:22 pm »
Two details:
You have to add a ? on the getCurrent and getVoltage commands
When using them you have to specify channel after the command, i.e. getCurrent? 1

Wow, now it works with ? at the end.
I also have to change the +3 by +4 in the getCurrent Line and all work fine.
Thx for your Help

 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2355 on: April 14, 2022, 04:45:15 pm »
Quote
Code: [Select]
#scpiCmd getFreqA? txrx? FREQ A
:readmath: getElement(value",1)

Yep, that works with a slight modification. Thanks.

Now, I need to send 3 commands. Only the first one displays a result and then it gets stuck. These commands do work within Putty. I don't know if a terminator has to be sent in between.
Anyway, this is what I have:

Code: [Select]
#value getVmaxA? V D1
#value getVminA? V D1
#value getFreqA? Hz D0

#scpiCmd getVmaxA? txrx? VMAX A
:readmath: getElement(value,1)

#scpiCmd getVminA? txrx? VMIN A
:readmath: getElement(value,1)

#scpiCmd getFreqA? txrx? FREQ A
:readmath: getElement(value,1)

#askValues getVmaxA?; getVminA?; getFreqA?;

#readingDelay 3

Thanks again
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2356 on: April 15, 2022, 07:43:52 am »
Now, I need to send 3 commands. Only the first one displays a result and then it gets stuck. These commands do work within Putty. I don't know if a terminator has to be sent in between.
Anyway, this is what I have:

Code: [Select]
#value getVmaxA? V D1
#value getVminA? V D1
#value getFreqA? Hz D0

You column names are a bit silly here. It is not the function/command that is expected after the #value, but the column name.
Using the function name will not do any damage, but not any good either.

Code: [Select]
#askValues getVmaxA?; getVminA?; getFreqA?;

The #askValues will send the 3 commands on separate lines. You can always run TestController in debug mode to see what is transmitted and received.
If the separate commands works, the will usually also work when put together, except if the device has problems keeping up with the commands. You can add delay with ;[100]; the 100 means 100ms.
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2357 on: April 15, 2022, 08:59:15 pm »
Thanks for your quick answer.
Still no success.

I have added a delay between the commands :

Code: [Select]
#askValues getFreqA?;[100];getVmaxA?;[100];getVminA?;[100];
I noticed that all values are filled with the first value; in this case the frequency. Vmax and Vmin are not shown.
If I swap the order and put Vmax first, then all values are filled with Vmax.

The individual commands when executed from the command line show the same behaviour. If I execute the getFreqA? first and then getVmax?, I get the frequency and not Vmax.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2358 on: April 16, 2022, 06:19:06 am »
Still no success.

You will have to run TestController in debug mode, to see what is going on. On Windows there is a .bat file to start it in debug mode.
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2359 on: April 16, 2022, 09:48:25 am »
Ok
I fired the debug mode under windows and I got the following:

Code: [Select]
Starting
;; jSerialComm version: 2.9.1
;; COM5: Set params: 115200
;; Start thread for: AR488 A:6 - Philips PM6666
;; COM5: Tx: <++default.> 2B 2B 64 65 66 61 75 6C 74 0A
;; Found Philips PM6666 on AR488 A:6
;; PM6666: Tx <getFreqA?>
;; PM6666: Tx <txrx? FREQ A
:readmath: getElement(value,1)>
;; COM5: Tx: <++addr 6.> 2B 2B 61 64 64 72 20 36 0A
;; COM5: Tx: <FREQ A.> 46 52 45 51 20 41 0A
;; COM5: Tx: <++read_tmo_ms 2950.> 2B 2B 72 65 61 64 5F 74 6D 6F 5F 6D 73 20 32 39 35 30 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <FREQ   001.183061E+4> 46 52 45 51 20 20 20 30 30 31 2E 31 38 33 30 36 31 45 2B

34
;; PM6666: Rx <001.183061E+4>
;; PM6666: Delay: 100ms
;; PM6666: Tx <getVmaxA?>
;; PM6666: Tx <txrx? VMAX A
:readmath: getElement(value,1)>
;; COM5: Tx: <VMAX A.> 56 4D 41 58 20 41 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <FREQ   001.183048E+4> 46 52 45 51 20 20 20 30 30 31 2E 31 38 33 30 34 38 45 2B

34
;; PM6666: Rx <001.183048E+4>
;; PM6666: Delay: 100ms
;; PM6666: Tx <getVminA?>
;; PM6666: Tx <txrx? VMIN A
:readmath: getElement(value,1)>
;; COM5: Tx: <VMIN A.> 56 4D 49 4E 20 41 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <FREQ   001.183052E+4> 46 52 45 51 20 20 20 30 30 31 2E 31 38 33 30 35 32 45 2B

34


Then, I started a Putty session and listed the commands I need to run to make it works. Here, they are:

Code: [Select]
++addr 6
++auto 1
freq a
FREQ   001.181477E+4
vmax a
VMAX   0000000.28E+0
vmin a
VMIN   -000000.26E+0

There is definitely something not right in TC.
I will be out for the next few days.

Thanks for your help.



 

Offline Scheppo

  • Contributor
  • Posts: 23
  • Country: de
Re: Program that can log from many multimeters.
« Reply #2360 on: April 16, 2022, 11:07:47 am »
Your Programm is the best for all tools with serial output, thank you for your work.

My goal is to send every command over a graphical interface, but my programming skills are not good enough.
I think the only way to do this is programming the Grid Panel
I Read and search in the Manual but I have no idea for the following problems:
1. I need On/Off Buttons for every channel, I can make them but they give no reaction with right mouse click
2. how I can switch channel on with one Command? (I must send 2 Commands „sel 1“ and „enable“)
3. The Math readouts in Grid Panel  give output „0.0000AH“ but I need „0.00 AH“
4. I need Digital font in Grid Panel, is it possible to use other fonts?
5. what basic interface commands can I use with the Hameg 7044?

Here is my Code:

#idString HAMEG,HAMEG 7044
#name Hameg 7044
#handle HAMEG7044
#driver Ascii
#port comfixedbaud
#baudrate 9600N82
#eol \r

#scpiCmd sel txrx? SEL (value)
#scpiCmd setV tx SET (value) V
#scpiCmd setC tx SET (value) A
#scpiCmd getV? txrx? READ
:readmath: replace(getElement(value,inputValue-1,"[ ;]"),"V","");
#scpiCmd getC? txrx? READ
:readmath: replace(getElement(value,inputValue+4,"[ ;]"),"A","");

#scpiCmd ch1 tx sel 1
#scpiCmd ch2 tx sel 2
#scpiCmd ch3 tx sel 3
#scpiCmd ch4 tx sel 4
#scpiCmd ch12 tx sel 1,2
#scpiCmd ch13 tx sel 1,3
#scpiCmd ch14 tx sel 1,4
#scpiCmd ch23 tx sel 2,3
#scpiCmd ch24 tx sel 2,4
#scpiCmd ch34 tx sel 3,4
#scpiCmd cha tx sel a
#scpiCmd ch0 tx sel n


#value V1 V D2
#value V2 V D2
#value V3 V D2
#value V4 V D2
#value A1 A D3
#value A2 A D3
#value A3 A D3
#value A4 A D3

#askValues getV? 1;getV? 2;getV? 3;getv? 4;getC? 1;getC? 2;getC? 3;getC? 4


Here the Grid Panel:
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2361 on: April 16, 2022, 01:56:57 pm »
I fired the debug mode under windows and I got the following:

First idea is to try:
#EOL \r\n

Another point: In putty it looks like your are using a GPIB interface, but not in TestController, why?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2362 on: April 16, 2022, 02:10:58 pm »
I think the only way to do this is programming the Grid Panel

It is a very nice layout you have made in GridPanel. If you can accept a smaller font size for most of the value, try the "Specific type readout, PS & Load readout"
But I would recommend making a setup panel in the definition also.

I Read and search in the Manual but I have no idea for the following problems:
1. I need On/Off Buttons for every channel, I can make them but they give no reaction with right mouse click

The on/off buttons in GridPanel depends on a implemented #interface or you can use user programable buttons.

2. how I can switch channel on with one Command? (I must send 2 Commands „sel 1“ and „enable“)

You are allowed to list multiple commands with a ; between. TestController will split them up and send them independently to the device.

3. The Math readouts in Grid Panel  give output „0.0000AH“ but I need „0.00 AH“

You can change decimals in the "Table" view or from scripting.
Add the script lines to the script that restores GridPanel.

4. I need Digital font in Grid Panel, is it possible to use other fonts?

Sorry, but no. I have not made it possible to select a font anywhere in TestController.

5. what basic interface commands can I use with the Hameg 7044?

You define your own, probably something like (I have not finished all definitions):
#interfaceType PS PS:2 PS:3 PS:4
#interface setVoltage sel (channel);setV (value)
#interface setCurrent sel (channel);setC (value)
#interface setOn
#interface getVoltage
#interface getCurrent
#interface getOn
#interface readVoltage 0 1 2 3
#interface readCurrent 4 5 6 7
[/quote]

There is a popup function to test these definitions
« Last Edit: April 16, 2022, 02:17:53 pm by HKJ »
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2363 on: April 18, 2022, 09:52:04 am »
Quote
Another point: In putty it looks like your are using a GPIB interface, but not in TestController, why?

Nope. AR488 is used in both setups.

Current def. file (still no success, same as before)

Code: [Select]
#idString PM6666/016/32,,
#name Philips PM6666
#handle PM6666
#port GPIB
#driver ascii
#eol \r\n

#value FreqA Hz D0
#value VmaxA V D2
#value VminA V D2

#scpiCmd getID? txrx? id?

#scpiCmd getFreqA? txrx? FREQ A
:readmath: getElement(value,1)

#scpiCmd getVmaxA? txrx? VMAX A
:readmath: getElement(value,1)

#scpiCmd getVminA? txrx? VMIN A
:readmath: getElement(value,1)

#askValues getFreqA?;[100];getVmaxA?;[100];getVminA?;[100];

#readingDelay 3
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2364 on: April 18, 2022, 05:26:01 pm »
Current def. file (still no success, same as before)

I do not have any idea at the current time.
It looks like TestController continues to receives the same answer, can it be related to any settings in the AR488?
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2365 on: April 18, 2022, 07:36:50 pm »
Is there a way to not send these 2 commands:

Code: [Select]
;; COM5: Tx: <++read_tmo_ms 2950.> 2B 2B 72 65 61 64 5F 74 6D 6F 5F 6D 73 20 32 39 35 30 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A

To me, that the ones that creates the problems.

And can we send this command instead:

Code: [Select]
++auto 1
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2366 on: April 19, 2022, 05:11:02 am »
Is there a way to not send these 2 commands:

Code: [Select]
;; COM5: Tx: <++read_tmo_ms 2950.> 2B 2B 72 65 61 64 5F 74 6D 6F 5F 6D 73 20 32 39 35 30 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A

To me, that the ones that creates the problems.

And can we send this command instead:

Code: [Select]
++auto 1

++read eoi is controlled with #gpibReadEol
++read_tmo_ms is controlled with #readingDelay

On the GPIB tab you can add direct commands to the GPIB interface in the "Settings" column
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2367 on: April 19, 2022, 08:33:19 am »
Quote
Quote
++read eoi is controlled with #gpibReadEol
++read_tmo_ms is controlled with #readingDelay

On the GPIB tab you can add direct commands to the GPIB interface in the "Settings" column

I think I got it right now:

Add
Code: [Select]
++auto 1to the GPIB settings and use this file:

Code: [Select]
#idString PM6666/016/32,,
#name Philips PM6666
#handle PM6666
#port GPIB
#driver ascii
;#eol \r\n

#value FreqA Hz D0
#value VmaxA V D2
#value VminA V D2

#scpiCmd getID? txrx? id?

#scpiCmd getFreqA? txrx? FREQ A
:readmath: getElement(value,1)

#scpiCmd getVmaxA? txrx? VMAX A
:readmath: getElement(value,1)

#scpiCmd getVminA? txrx? VMIN A
:readmath: getElement(value,1)

;#askValues getFreqA?;[100];getVmaxA?;[100];getVminA?;[100];
#askValues getFreqA?;getVmaxA?;getVminA?;

;++read_tmo_ms is controlled with #readingDelay
#readingDelay 3 

;++read eoi is controlled with #gpibReadEol
#gpibReadEol 10


Thanks again for your great help.



 

Offline Scheppo

  • Contributor
  • Posts: 23
  • Country: de
Re: Program that can log from many multimeters.
« Reply #2368 on: April 23, 2022, 03:00:13 pm »
Iam working on Ascii-Driver for a HCS3004

How can i seperate the Volt and Current Output from PS:
;getting Volt & Current Setting value from PS
;in this Case 14.4V and 03.0A
GETS

144030

;Get Display Volt & Current value from PS
;14.44V 01.86A Status ON (0=ON,1=OFF)
GETD

144401860
---------------------------------------
#scpiCmd getVS? txrx? GETS
:i dont know what readmath formula i mus use here

thx for Help

 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2369 on: April 23, 2022, 04:32:38 pm »
How can i seperate the Volt and Current Output from PS:
;getting Volt & Current Setting value from PS
;in this Case 14.4V and 03.0A
GETS

144030

You have to split it onto two values with a space between and adjust the values to volt and ampers, for this you use string functions:
:readmath: (substring(value,0,3)/10.0)+" "+(substring(value,3,6)/10.0)

You can test type of math on the Command page, first define a variable called value and the the expression.
=var value="144030"
=(substring(value,0,3)/10.0)+" "+(substring(value,3,6)/10.0)

You have to put a = before each line to use the calculator mode.

For the set point you may want to only return one value at a time, i.e. doing something like:
#scpiCmd getVolt? txrx? GETS
:readmath: (substring(value,0,3)/10.0)

#scpiCmd getCurrent? txrx? GETS
:readmath: (substring(value,3,6)/10.0)
« Last Edit: April 23, 2022, 04:40:41 pm by HKJ »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2370 on: April 23, 2022, 07:03:38 pm »
Iam working on Ascii-Driver for a HCS3004

What is a HCS3004,?
I can see from your questions it is a power supply, but feeding the number to google do not show any power supply!

If you have a link to it, please post it.

Anyway I hope you will post the final definition when it works, you are probably not the only one with a HCS3004.
 

Offline Scheppo

  • Contributor
  • Posts: 23
  • Country: de
Re: Program that can log from many multimeters.
« Reply #2371 on: April 23, 2022, 07:50:13 pm »
Thank you for your help.
Your Program is so extensive, i must learn all Commands to use it but iam an old Guy, to old :)

Sorry i made a Mistake, the PS called HCS 3404 from China. In Germany is called Voltcraft DPPS-60-10
https://www.manson.com.hk/product/hcs-3404-usb/

Ok, one Problem:
#scpiCmd getON? txrx? GETD
:readmath: (substring(value,8,9))

Here is the result "0" or "1" but i need ON and OFF
Can i add an Formula in the readmath to do this?

I will post the final definition but i think i can only make standart txt for read and set the values.
I will do much more but my old Brain doesnt understand the many formulas :(
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2372 on: April 23, 2022, 08:04:51 pm »
Thank you for your help.
Your Program is so extensive, i must learn all Commands to use it but iam an old Guy, to old :)

Sorry i made a Mistake, the PS called HCS 3404 from China. In Germany is called Voltcraft DPPS-60-10
https://www.manson.com.hk/product/hcs-3404-usb/

Ok, one Problem:
#scpiCmd getON? txrx? GETD
:readmath: (substring(value,8,9))

Here is the result "0" or "1" but i need ON and OFF
Can i add an Formula in the readmath to do this?

Easily, use getElement("off on", value), you replace value with the expression that get 0/1 or place the getelement on another :readmath: line (Only possible with #scpiCmd).

I will post the final definition but i think i can only make standart txt for read and set the values.
I will do much more but my old Brain doesnt understand the many formulas :(

I am not exactly young, but I enjoy figuring out technical stuff.
In my opinion it is more about motivation than age and I am not old enough to have lost my motivation.

When you have figured out how the definitions works, it is only a question about time how complete you want to make it. Checking other definitions may help.
 

Offline Scheppo

  • Contributor
  • Posts: 23
  • Country: de
Re: Program that can log from many multimeters.
« Reply #2373 on: April 24, 2022, 12:00:17 am »
The readout Voltage is switching sometimes from 15V to 1V, see Picture attached.

Here is my Code for the HCS Series 3xxx PS:

#handle HCS3404
#driver Ascii
#port comfixedbaud
#baudrate 9600N81
#eol \r\n
;-----------------------------
#scpiCmd setV tx VOLT(value)
#scpiCmd setC tx CURR(value)
#scpiCmd getVS? txrx? GETS
:readmath: (substring(value,0,3)/10.0)
#scpiCmd getCS? txrx? GETS
:readmath: (substring(value,3,6)/10.0)
#scpiCmd getV? txrx? GETD
:readmath: (substring(value,0,4)/100.0)
#scpiCmd getC? txrx? GETD
:readmath: (substring(value,4,8)/100.0)
#scpiCmd getON? txrx? GETD
:readmath: (substring(value,8,9))
#scpiCmd outON tx SOUT0
#scpiCmd outOFF tx SOUT1
;-----------------------------
#value VSet V D2
#value VGet V D2
#value CSet A D2
#value CGet A D2

#askValues getVS?;getV?;getCS?;getC?
#readingDelay 2
;-----------------------------
#interfaceType PS
#interface setVoltage setV (value)
#interface setCurrent setC (value)
#interface setOn outON
#interface setOff outOFF
#interface getVoltage getV?
#interface getCurrent getC?
#interface readVoltage 0
#interface readCurrent 0
 
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2374 on: April 24, 2022, 06:05:57 am »
The readout Voltage is switching sometimes from 15V to 1V, see Picture attached.

I have no idea why.
You can try using debug mode, it is also possible to add delay between the commands:

#askValues getVS?;[10];getV?;[10];getCS?;[10];getC?

#scpiCmd setV tx VOLT(value)
#scpiCmd setC tx CURR(value)

Depending on your protocol you might want to format and/or scale the value.
There is a format function for that: https://lygte-info.dk/project/TestControllerFunctions%20UK.html#formatDouble
If you need to scale the value, you can just multiply with 10 or 100.
Something like this will always return 3 digits with no decimals:
(formatDouble(value*10,3,3,0,0))


#interface setOn outON
#interface setOff outOFF

For the interface setOn must have a parameter to switch output on/off:

#interface setOn (value?"outON":"outOFF")

#interface readVoltage 0
#interface readCurrent 0

The number is the column for the data, this means you probably want:
#interface readVoltage 1
#interface readCurrent 3


I will also suggest adding a setup menu, here is a entry for voltage:

#cmdSetup number Voltage
:read: getV?
:write: setV
Volt 0 30
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf