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

0 Members and 9 Guests are viewing this topic.

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2750 on: October 06, 2022, 09:03:22 am »
How to convert these strings (0000000B01F4) to something like this:

0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x42 0x30 0x31 0x46 0x34

You need to do it for each item, but it is a bit hard.

To make it easier I have added this function:
bytesAsHex(item);
bytesAsHex(item,digits);
bytesAsHex(item,digits,reverse);
item: is any variable that is cast to bytes and then converted to 0xnn items in a string result.
digits: is number of bytes to show in the final string, when not present it will show the actual number of bytes.
reverse: reverse the byte sequence in the output string.

bytesAsHex(formatInt(a,8,8)); -> 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x31
bytesAsHex(a); -> 0x01
bytesAsHex(a,8); -> 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
bytesAsHex(a,8,1); 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01

You can get a new .jar file from here (It is version 2.27):
http://lygte-info.dk/customers/5/d/1/lygte-info.dk/httpd.www/pic/Projects/TestController/TestController.jar

You will need to use the delimiter option in the "Set" control.

Thanks, was quick.
Is it the usual location for downloading the new binaries because link seems to be broken.

thanks
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2751 on: October 06, 2022, 09:45:49 am »

Is it the usual location for downloading the new binaries because link seems to be broken.

Yes, it is the usual location, I have edited the link here:

 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2752 on: October 06, 2022, 12:12:23 pm »
It looks like the "cache is back"  :)

Still getting the previous version, no matter if I clean my cache. By the way, if you own your web site, there are options to set the cache but that depends on your traffic...
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2753 on: October 06, 2022, 01:55:06 pm »
It looks like the "cache is back"  :)

Still getting the previous version, no matter if I clean my cache. By the way, if you own your web site, there are options to set the cache but that depends on your traffic...

I hope you have gotten the right version now, I just checked the download at it is V1.27 (I have not reuploaded it).
http://lygte-info.dk/pic/Projects/TestController/TestController.jar
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2754 on: October 06, 2022, 05:25:18 pm »
Still version of yesterday
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2755 on: October 07, 2022, 05:06:01 am »
Still version of yesterday

I have a suspicion you are downloading the .zip file, not the .jar file. The .zip file is not updated, it contains the general release.
 
The following users thanked this post: rachdatu

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2756 on: October 07, 2022, 07:26:30 am »
Oh, right. Now I finally got that file...had to go through all the security warnings.  :box:

Now about the #checksum parameter. Do you have an example how I should use it?
Thanks again
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2757 on: October 07, 2022, 07:48:39 am »
Now about the #checksum parameter. Do you have an example how I should use it?

Check the manual: https://lygte-info.dk/project/TestControllerConfigDevice2%20UK.html#Checksum_and_CRC
 

Offline rachdatu

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

Thanks for the great job. The hex conversion works like a charm and the checksum as well.

There is now a functionality that doesn't work as before. Here is a working and simplified example to illustrate the problem.

Code: [Select]
#idString Test,006,
#name     Test 006
#handle   JB006
#port comfixedbaud
#baudrate 9600
#driver Block

#eol \r
#checksum sum16 hexhl 0 0
#scpiCmd updatetest tx (value)

; #### Memory_Editor tab ####

#cmdSetup combobox Store_in_Memory_# Memory_Editor
:read:
:write: ((hex(value)))
:buttontext: Store
1 1
2 2
3 3
4 4
5 5

#cmdSetup combobox Battery_type Memory_Editor
:write: ((hex(value)))
NiCd 0
NiMh 1
LiIo 2
LiPo,LiMn 3
LiFe 4
Pb 5

#cmdSetup combobox Number_Cells Memory_Editor
:write: ((hex(value)))
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14

#cmdSetup number PB_Bat_Float_Voltage Memory_Editor
:read:
:write: (hex((round((value*100.0-442.0)/2.0)*2.0+442.0)/100.0))
:enable: (Memory_Editor.Battery_type !="0000") && (Memory_Editor.Battery_type !="0001") && (Memory_Editor.Battery_type !="0002") && (Memory_Editor.Battery_type !="0003") && (Memory_Editor.Battery_type !="0004")
V 4.42 4.60

;#cmdSetup set Update Memory_Editor
;:write: updatetest ((bytesAsHex("004E01",6,0))+" "+(bytesAsHex(value)))
;Memory_Editor.Store_in_Memory_# Memory_Editor.Battery_type Memory_Editor.Number_Cells Memory_Editor.PB_Bat_Float_Voltage
;\x20 not used

The PB Bat Float Voltage field is enabled/disabled depending on the type of battery. If Pb is chosen, then PB Bat Float Voltage field is enabled. In the other cases, this field is disabled.
The issue is that with the update field enabled this logic only works if you first send a set of data to the device. And we don't want that. PB_Bat_Float_Voltage field should be disabled before we can send any data to the device.

Do you have another solution to solve this issue?

Thanks
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2759 on: October 07, 2022, 04:27:35 pm »
Do you have another solution to solve this issue?

Because you do not have any :read: the values are empty at the start and that value is definitely different from all your specified values (It will probably match a empty string, i.e. "").
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2760 on: October 08, 2022, 05:23:12 pm »
Do you have another solution to solve this issue?

Because you do not have any :read: the values are empty at the start and that value is definitely different from all your specified values (It will probably match a empty string, i.e. "").

Do you mean reading data from the device? I think this is not going to help. The device doesn't know what type of battery is connected.
Maybe I didn't get what you meant.

Another possible solution is to create a tab for each chemistry with just a few parameters differing with different batteries. A lot of work and a lot of similar entries.
What do you think?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2761 on: October 08, 2022, 06:41:02 pm »
Do you mean reading data from the device? I think this is not going to help. The device doesn't know what type of battery is connected.
Maybe I didn't get what you meant.

Another possible solution is to create a tab for each chemistry with just a few parameters differing with different batteries. A lot of work and a lot of similar entries.
What do you think?

The missing :read: is not a problem, it just means that no initial value is obtained.
You need to include that option in your tests. Check out the displayVar function: https://lygte-info.dk/project/TestControllerFunctions%20UK.html#displayVar it can be used in any expression and will show the current value of a variable. It will also make TestController fairly slow when using it, but that is usually acceptable when doing these test.
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2762 on: October 10, 2022, 03:58:08 pm »
Do you mean reading data from the device? I think this is not going to help. The device doesn't know what type of battery is connected.
Maybe I didn't get what you meant.

Another possible solution is to create a tab for each chemistry with just a few parameters differing with different batteries. A lot of work and a lot of similar entries.
What do you think?

The missing :read: is not a problem, it just means that no initial value is obtained.
You need to include that option in your tests. Check out the displayVar function: https://lygte-info.dk/project/TestControllerFunctions%20UK.html#displayVar it can be used in any expression and will show the current value of a variable. It will also make TestController fairly slow when using it, but that is usually acceptable when doing these test.

OK thanks; I see the problem in the :enable: tag now.

Code: [Select]
#idString Test,006,
#name     Test 006
#handle   JB006
#port comfixedbaud
#baudrate 9600
#driver Block

#eol \r
#checksum sum16 hexhl 0 0
#scpiCmd updatetest tx (value)

; #### Memory_Editor tab ####

#cmdSetup combobox Store_in_Memory_# Memory_Editor
:read:
:write: ((hex(value)))
:buttontext: Store
1 1
2 2
3 3
4 4
5 5

#cmdSetup combobox Battery_type Memory_Editor
:read:
:write: (displayVar((hex(value))))
;:write: (hex(value))
NiCd 0
NiMh 1
LiIo 2
LiPo,LiMn 3
LiFe 4
Pb 5


#cmdSetup combobox Number_Cells Memory_Editor
:read:
:write: ((hex(value)))
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
13 13
14 14

#cmdSetup number PB_Bat_Float_Voltage Memory_Editor
:read:
:write: (hex((round((value*100.0-442.0)/2.0)*2.0+442.0)/100.0))
:enable: (Memory_Editor.Battery_type !="0") && (Memory_Editor.Battery_type !="1") && (Memory_Editor.Battery_type !="2") && (Memory_Editor.Battery_type !="3") && (Memory_Editor.Battery_type !="4")
V 4.42 4.60


#cmdSetup set UPDATE Memory_Editor
:write: updatetest ((bytesAsHex("004E01",6,0))+" "+(bytesAsHex(value)))
Memory_Editor.Store_in_Memory_# Memory_Editor.Battery_type Memory_Editor.Number_Cells Memory_Editor.PB_Bat_Float_Voltage
;\x20 not used

However, I am still not getting what I have explained above: selecting "Pb" should unlock "PB_Bat_Float_Voltage" before doing anything with the "Set" button.

Thanks
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2763 on: October 10, 2022, 05:21:17 pm »

However, I am still not getting what I have explained above: selecting "Pb" should unlock "PB_Bat_Float_Voltage" before doing anything with the "Set" button.

Use the debug mode (I.e. start the program with "testControllerDebug.bat" and watch the DOS windows for any error messages.

A easy way to check for a couple of string values in to use the function inList() https://lygte-info.dk/project/TestControllerFunctions%20UK.html#inList  it is shorter than a bunch of equal or not equal tests and easier to read.
 

Offline bateau020

  • Regular Contributor
  • *
  • Posts: 243
  • Country: fr
Re: Program that can log from many multimeters.
« Reply #2764 on: October 14, 2022, 09:54:00 pm »
Am adding GPIB support for some devices that right now only have com port support foreseen in the device files.
My question:
For devices where the device file permits multiple port types, (com and GPIB for example), is there any way to detect which port type the user has configured?


In my case, the device does not support some commands (SYS:LOC and SYST:REM in my case, HP663xB) when on GPIB, but does support them in RS232.
I cannot interrogate the device to see what port it uses, as that command does not exist.
So unless I remove the offending commands from the device file, thereby potentially breaking things for existing users, GPIB users will be stuck with loads of errors on the device.
Both options are not ideal. It would be best if I could detect the device config and adapt the commands to it.
Something like:

Code: [Select]
#port comfixedbaud GPIB
.....
if (port=="comfixedbaud")
   #initCmd *RST;SYST:REM
else
   #initCmd *RST
endif
Is something like this possible?
« Last Edit: October 14, 2022, 09:57:20 pm by bateau020 »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2765 on: October 15, 2022, 12:52:05 pm »
Is something like this possible?

At the current time: No.

But I will take a look at it.

 

Offline bateau020

  • Regular Contributor
  • *
  • Posts: 243
  • Country: fr
Re: Program that can log from many multimeters.
« Reply #2766 on: October 16, 2022, 05:15:35 pm »
Here is an updated file for the AgilentHP 663xB series. Additions:
* 66332A
* easier switching to low amp range
* GPIB (but I had to remove the RS232 only commands, should still work.)
* control for relay option board #760

Motivation: I just made that last board for my 66332A.
 
The following users thanked this post: croma641

Offline adso85swe

  • Contributor
  • Posts: 11
  • Country: se
Re: Program that can log from many multimeters.
« Reply #2767 on: October 17, 2022, 05:15:18 am »
Hi. I’ve got some n00b questions regarding using this software with Arduino.

  • Can you use the software to log data from the Arduino serial port? If so, great!   8)
  • Is it documented somewhere on which format you need to send the serial data from the Arduino?
  • Can the software create time stamps of the data based on when it’s received, preferably in the sub-second (millisecond) region? That would be pretty helpful as you wouldn’t need to fiddle with an RTC on your device, and those libraries usually don’t report less than second resolution.

EDIT: Nevermind my questions, I found the Arduino documentation on the website  :) I will look into it and play around. I guess the only thing that is still unclear is if there is sub second time stamp resolution, but I will find out by trying around.
« Last Edit: October 17, 2022, 05:38:11 am by adso85swe »
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2768 on: October 17, 2022, 07:16:37 am »
Here is an updated file for the AgilentHP 663xB series. Additions:

Thanks, this will be included in the next update.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2769 on: October 17, 2022, 07:27:18 am »
  • Can you use the software to log data from the Arduino serial port? If so, great!   8)
  • Is it documented somewhere on which format you need to send the serial data from the Arduino?

Yes. You can use many different formats, but following these examples is the easiest:
https://lygte-info.dk/project/TestControllerArduino1%20UK.html
https://lygte-info.dk/project/TestControllerArduino2%20UK.html

  • Can the software create time stamps of the data based on when it’s received, preferably in the sub-second (millisecond) region? That would be pretty helpful as you wouldn’t need to fiddle with an RTC on your device, and those libraries usually don’t report less than second resolution.


The fastest speed you can log with is 100 times a second (200 in some conditions), timestamps are made to the millisecond, but usually not displayed with that resolution.
When logging the logging speed will be reduced if some device has problems keeping up. I.e. you may select 0.01 second logging interval. but only get 0.5 second, due to a slow device. You can use the #commandtime? command on the TestController command line to see how fast the devices answers (It only captures times when logging or some readout is active).

EDIT: Nevermind my questions, I found the Arduino documentation on the website  :) I will look into it and play around. I guess the only thing that is still unclear is if there is sub second time stamp resolution, but I will find out by trying around.

Other may have similar questions, so you got a full answer.
 
The following users thanked this post: adso85swe

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 708
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Program that can log from many multimeters.
« Reply #2770 on: October 21, 2022, 12:55:04 am »
I have FINALLY started to mess with trying to get a GPIB setup running on some of my volt nut gear.

I have added an Agilent E5810A GPIB controller to my LAN, the E5810A is connected to 5 GPIB devices, I can talk to all the devices using the E5810A web server (on its LAN IP address)

What I can't figure out is how to setup TC to use the E5810A, so that TC can then talk to the devices.

Has anyone else done this ?

I am very new to GPIB too (yeah I am a slow starter, it's not like it has been around for 40 years or anything), so I have a big learning curve here to start with.
« Last Edit: October 21, 2022, 01:18:32 am by TheDefpom »
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline bateau020

  • Regular Contributor
  • *
  • Posts: 243
  • Country: fr
Re: Program that can log from many multimeters.
« Reply #2771 on: October 21, 2022, 05:51:39 am »
Multiple questions for people knowing the device description syntax.

1) is there a way to debug the what value is interpreted by a #cmdSetup selector?
I managed to feed a selector from a #cmdSetup combobox, but haven't managed to feed it from a #cmdSetup checkbox or #cmdSetup comboboxhot. But a combobox requires 2 clicks, and the two others don't.
2) is there a way to do a :write: with a fixed string? So without sending the value? I need to fire :update: from a control, which needs a write to function, but in reality I don't want to write, so a fixed string is better than "random" text which confuses the device, requiring me to do a *CLS afterwards.
3) is there a way to persist user choices between invocations  of the setup popup? Is Mode the only way?

I use the following construct:
Code: [Select]
#cmdSetup combobox Relay_Board Main
; This is used for activating the relay board option #760.
; Neither checkbox nor comboboxhot seem to work here
; Something has to be sent in order to call :update:, but it confuses the device so I do a *CLS afterwards.
: I have not found a way to persist that user choice. So you will have to select it every time you open the Setup popup.
:write: #;*CLS
:update: No_Relay_Board
:tip: Output Relay Board (#760) present?
Absent Absent
Installed Installed

#cmdSetup selector No_Relay_Board Main
Main.Relay_Board
; The name is like this because the name of this selector only shows up when disabled.
Absent
Installed Main.Output_Relay;Main.Output_Polarity_Reversed
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2772 on: October 21, 2022, 06:36:12 am »
What I can't figure out is how to setup TC to use the E5810A, so that TC can then talk to the devices.

TC do not have build-in support for the E5810, I have not found any documentation on how it works.
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2773 on: October 21, 2022, 06:51:45 am »
1) is there a way to debug the what value is interpreted by a #cmdSetup selector?
I managed to feed a selector from a #cmdSetup combobox, but haven't managed to feed it from a #cmdSetup checkbox or #cmdSetup comboboxhot. But a combobox requires 2 clicks, and the two others don't.

The displayVar() function may do it. It can be used in any expression and will returns its argument.


2) is there a way to do a :write: with a fixed string? So without sending the value? I need to fire :update: from a control, which needs a write to function, but in reality I don't want to write, so a fixed string is better than "random" text which confuses the device, requiring me to do a *CLS afterwards.

I have not tested it, but maybe something like [000] may work (It is a request to wait 0 milliseconds).

3) is there a way to persist user choices between invocations  of the setup popup? Is Mode the only way?

Generally a definition do not store any state information, but obtain it from the connected device, but you can get around it when using #scpiCmd (Requires SCPIx or other drivers), they can create and read persistent variables.
To access variables you may want to use getVar("name"), it will not fail on a undefined variable, but return a empty value.


You can use checkboxes in the mode menu and they create local modes that can be used in the setup menu.
 

Offline bateau020

  • Regular Contributor
  • *
  • Posts: 243
  • Country: fr
Re: Program that can log from many multimeters.
« Reply #2774 on: October 21, 2022, 10:58:28 am »
ok, thanks, will do some debugging. Will very probably prepare a new AgilentHP 663xB.TXT file before the end of coming weekend.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf