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

0 Members and 7 Guests are viewing this topic.

Offline Messtechniker

  • Frequent Contributor
  • **
  • Posts: 782
  • Country: de
  • Old analog audio hand - No voodoo.
Re: Program that can log from many multimeters.
« Reply #2725 on: August 14, 2022, 01:19:25 pm »
Dunno where this A preceding the C comes from.

The definition file must be in unicode with a BOM or TestController cannot select the correct character set for it. If you remind me when you send the stuff I can add it.

Anyway. In the next few days I will send you by mail info on the 
BME 280 sensor processing hardware schematic for your DIY page.

I look forward to it.

Sent files today (Aug. 14, 2022) via PM :)
Agilent 34465A, Siglent SDG 2042X, Hameg HMO1022, R&S HMC 8043, Peaktech 2025A, Voltcraft VC 940, M-Audio Audiophile 192, R&S Psophometer UPGR, 3 Transistor Testers, DL4JAL Transistor Curve Tracer, UT622E LCR meter
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2726 on: August 15, 2022, 07:38:34 am »
 

Offline jord4231

  • Regular Contributor
  • *
  • Posts: 91
  • Country: au
Re: Program that can log from many multimeters.
« Reply #2727 on: August 17, 2022, 12:07:43 pm »
Any chance of a dark theme? or the ability to customise GUI colours (other than the graph) my eyes don't do well with bright things :(
Fantastic program by the way. Especially now I've got a DMM6500 thank you for all your hard work!

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2728 on: August 18, 2022, 08:56:29 am »
Any chance of a dark theme? or the ability to customise GUI colours (other than the graph) my eyes don't do well with bright things :(
Fantastic program by the way. Especially now I've got a DMM6500 thank you for all your hard work!

I do not have any current plans on added themes to TestController, this do not mean I will not do it at a later date.
 
The following users thanked this post: jord4231

Offline gby

  • Regular Contributor
  • *
  • Posts: 238
  • Country: us
Re: Program that can log from many multimeters.
« Reply #2729 on: August 23, 2022, 04:10:49 pm »
Hi HKJ,

I am trying to support a Vitrek V71 HiPot tester in TestController.  This device has RS232 and USB interfaces.  The RS232 interface is working but I am having trouble with the USB interface.  This USB interface is Windows "driver-less" in that the standard Windows HID device driver is used ofr this device.  Using Vitrek's utility communications over USB works.  For TestController I put the following in the device driver file:

#port usbhid
;  Per manual VID is 4292 and PID is 34869 in decimal.
#usbVendor 0x10C4
#usbProduct 0x8835

Running TestController in Debug mode I got the following

;; HIDv10C4p8835: Found HID: 10C4 8835  32 33 30 39 35
;; HIDv10C4p8835-59460199: Found usb device: \\?\hid#vid_10c4&pid_8835#9&1e6994ec&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
;; Stopping thread for: HIDv10C4p8835-59460199 - Vitrek V7x

From the above it seems that TestController found the device but closed the thread and did not stay connected.  I say it found the device since it found the right VID, PID number and retrieved the serial number....at least when I convert
   32 33 30 39 35
from hex to characters I get 23095 which is the serial number reported from *IDN? when I had RS232 interface working:
   VITREK,V71,23095,v1.27

I tried looking for documentation on TestController web pages with Google search "site:lygte-info.dk usbhid" but that only finds the one page and there is not much there.

Do I need to set a specific #driver value to talk to this device? Or, is there something else I am missing in the device driver file?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2730 on: August 23, 2022, 04:18:51 pm »
Do I need to set a specific #driver value to talk to this device? Or, is there something else I am missing in the device driver file?

You must use a driver that uses binary interface: https://lygte-info.dk/project/TestControllerConfigDevice%20UK.html#Device_drivers_overview

But the possibility it will work is fairly low, many driver less solutions uses a chip that need a baudrate setting transmitted from the PC (This has nothing to do with normal com ports) and I do not support that.
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2731 on: August 26, 2022, 07:35:54 am »
Hi, this is a follow up from message #2644.

I have spent some time with this Hyperion device. I have now the process to generate the checksum. This is what we suspected.
It is a SUM of the ASCII chars and the result is converted to HEX and appended to the data stream. You then have to add a leading 0x0c and a trailing 0x0d.

I have an idea about a dialog box; will start with something easy and short.
All the parameters must be sent in one command, even those that are not being modified. We just send default values.
That means we have to convert and concatenate the variables and calculate the checksum on the fly. I don't know if we have a function for that.

We have in some cases to apply multiplication/division factors but I know which parameters need a special process.

That's it for the moment. I have attached 2 screenshots for explanation. Hope that helps.

Thanks
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2732 on: August 26, 2022, 03:10:29 pm »
Hi, this is a follow up from message #2644.

I have spent some time with this Hyperion device. I have now the process to generate the checksum. This is what we suspected.
It is a SUM of the ASCII chars and the result is converted to HEX and appended to the data stream. You then have to add a leading 0x0c and a trailing 0x0d.

I have an idea about a dialog box; will start with something easy and short.
All the parameters must be sent in one command, even those that are not being modified. We just send default values.
That means we have to convert and concatenate the variables and calculate the checksum on the fly. I don't know if we have a function for that.

We have in some cases to apply multiplication/division factors but I know which parameters need a special process.

That's it for the moment. I have attached 2 screenshots for explanation. Hope that helps.

I hope the sum16 method works for checksum.

I am working on a function to send multiple setting lines in one string, but it is not ready yet.
 
The following users thanked this post: rachdatu

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2733 on: August 29, 2022, 10:29:47 am »



The idea is the new control collects writes from other controls and combine them. It will support all controls with a "Set" button (including multi).
This is very similar to the multi control, but can handle many more parameters.
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2734 on: August 29, 2022, 03:42:17 pm »
Thanks for the quick update.

Question: I understand that the unique Set button will send and update the different values to the device.
Will that be possible to add 2 or more buttons with different type of values (from the same dialog box) being sent to the device? See image.

Thanks

 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2735 on: August 29, 2022, 03:55:51 pm »
Thanks for the quick update.

Question: I understand that the unique Set button will send and update the different values to the device.
Will that be possible to add 2 or more buttons with different type of values (from the same dialog box) being sent to the device? See image.

The set control has a list of other controls it must control (They can be on multiple pages, but do not support anything with selector), i.e. you can have multiple set controls on a page that can use different controls or even share some controls.
 

Offline DiplIngenieur

  • Newbie
  • Posts: 1
  • Country: de
Re: Program that can log from many multimeters.
« Reply #2736 on: September 04, 2022, 12:04:36 pm »
I tried to setup my devices with TC most of them worked out of the box but I had a few issues with my Rigol DM3058E. This device has only serial connection and with my old firmware 02.03.01 you need to add the #eol \r\n to the Rigol DM30xx.txt then it worked. It seems to be accepted only in the global context not just for the 3058E.
Changing modes took very long (like 7 seconds)  I could fix that by using a delay e.g. FUNC:VOLT:DC;[50] instead of [opc*].
Changing speeds although took very long and the read back does not work. I could fix this by changing the read rate e.g :read: [50];RATE:VOLT:DC?
Now everything works. Can you somehow include this to the generic Rigol DM30xx.txt file or should I make a seperate one and you delete  metadef in the generic one?

I also added my Owon power supply P4603 and Owon Multimeter XDM3051 I used an existing file and created a new one. The files are attached.

Is there a reason why the #help tag loads files from the internet in your user directory, would it be a better to include the help in the device file directly?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2737 on: September 05, 2022, 07:28:27 am »
I tried to setup my devices with TC most of them worked out of the box but I had a few issues with my Rigol DM3058E. This device has only serial connection and with my old firmware 02.03.01 you need to add the #eol \r\n to the Rigol DM30xx.txt then it worked. It seems to be accepted only in the global context not just for the 3058E.
Changing modes took very long (like 7 seconds)  I could fix that by using a delay e.g. FUNC:VOLT:DC;[50] instead of [opc*].
Changing speeds although took very long and the read back does not work. I could fix this by changing the read rate e.g :read: [50];RATE:VOLT:DC?
Now everything works. Can you somehow include this to the generic Rigol DM30xx.txt file or should I make a seperate one and you delete  metadef in the generic one?

You say "old firmware" and that may be the issue, if you make another Rigol definition and call it "Rigol 3058E V2" it can coexist with the current definition. Adding a #notes in the file explaining what version you tested with would be a nice touch.


I also added my Owon power supply P4603 and Owon Multimeter XDM3051 I used an existing file and created a new one. The files are attached.

I will include them in the next release.

Is there a reason why the #help tag loads files from the internet in your user directory, would it be a better to include the help in the device file directly?

Mostly to allow updates "on the fly", you can still make and test it locally, you just have to do it in the "...\Documents\TestController\Settings" directory and then send it to me when you are finished, then I will put it on the server. When it is on the server you cannot edit it locally anymore (Except if you rename it while doing it)
 
The following users thanked this post: jord4231

Offline Curious

  • Contributor
  • Posts: 11
  • Country: us
Re: Program that can log from many multimeters.
« Reply #2738 on: September 13, 2022, 01:39:32 am »
Hi, Trouble getting started.  Installation guide https://lygte-info.dk/project/TestControllerInstalling%20UK.html  for Java (version 8.1 or higher) has links for the Java Development Kit (presently at version 18).  Is Java the same as Java Development Kit (JDK)?????

I started down the path of Open JDK, download a large .zip file, extract it, but find no obvious installer like setup.exe, or install. bat.  Gave up on Open JDK and went to Oracle Java (windows) and get some possibilities to download some files that include the name JDK https://www.oracle.com/java/technologies/downloads/#jdk18-windows.  The x64 Installer looks promising, but not wanting to install JDK, if it's different from Java and not what TestController requires.

If Java = JDK, and that's what TestController requires, then any reason to use OPEN JDK vs. Oracle Java?

Thanks!
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2739 on: September 13, 2022, 04:55:14 am »
If Java = JDK, and that's what TestController requires, then any reason to use OPEN JDK vs. Oracle Java?

Java exist in a couple of different versions and TestController works with all.
JDK stands for Java Developer Kit and contains stuff for developing Java programs. It will use more disk space than Java SE, but works just as well.

In some cases Oracle requires a paid license, the Open version do not.
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2740 on: September 19, 2022, 03:26:36 pm »
Hello

I have a test equipment where its units change according to their values. For example, mV becomes V above 300 mV, same for Hz becoming kHz, etc.

Code: [Select]
;; jSerialComm version: 2.9.1
;; COM5: Set params: 115200
;; Start thread for: AR488 B:2 - Test 007
;; COM5: Tx: <++default.> 2B 2B 64 65 66 61 75 6C 74 0A
;; Found Test 007 on AR488 B:2
;; JB007: Tx <txrx? RD1>
;; COM5: Tx: <++addr 2.> 2B 2B 61 64 64 72 20 32 0A
;; COM5: Tx: <RD1.> 52 44 31 0A
;; COM5: Tx: <++read_tmo_ms 950.> 2B 2B 72 65 61 64 5F 74 6D 6F 5F 6D 73 20 39 35 30 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <NULL> 4E 55 4C 4C
;; JB007: Rx <NULL>
;; JB007: Delay: 500ms
;; JB007: Tx <txrx? RD2>
;; COM5: Tx: <RD2.> 52 44 32 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <NULL> 4E 55 4C 4C
;; JB007: Rx <NULL>
;; JB007: Delay: 500ms
;; JB007: Tx <txrx? RD3>
;; COM5: Tx: <RD3.> 52 44 33 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <19.888kHz> 31 39 2E 38 38 38 6B 48 7A
;; JB007: Rx <19.888kHz>
;; JB007: Delay: 500ms
;; JB007: Tx <txrx? RD4>
;; COM5: Tx: <RD4.> 52 44 34 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <NULL> 4E 55 4C 4C
;; JB007: Rx <NULL>
;; JB007: Delay: 500ms
;; JB007: Tx <txrx? RD5>
;; COM5: Tx: <RD5.> 52 44 35 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <19.889kHz> 31 39 2E 38 38 39 6B 48 7A
;; JB007: Rx <19.889kHz>
;; JB007: Delay: 500ms
;; JB007: Tx <txrx? RD6>
;; COM5: Tx: <RD6.> 52 44 36 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <219mV> 32 31 39 6D 56
;; JB007: Rx <219mV>
;; JB007: Delay: 500ms
;; JB007: Tx <txrx? RD7>
;; COM5: Tx: <RD7.> 52 44 37 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <NULL> 4E 55 4C 4C
;; JB007: Rx <NULL>
;; JB007: Delay: 500ms
;; JB007: Tx <txrx? RD8>
;; COM5: Tx: <RD8.> 52 44 38 0A
;; COM5: Tx: <++read eoi.> 2B 2B 72 65 61 64 20 65 6F 69 0A
;; COM5: Rx: <NULL> 4E 55 4C 4C
;; JB007: Rx <NULL>
;; JB007: Delay: 500ms
;; JB007: Rx after :readmath: value=="whatever"?whatever:value <NULL NULL 19.888kHz NULL 19.889kHz 219mV NULL NULL>
;; JB007: Rx as numbers <0.0 0.0 19.888 0.0 19.889 219.0 0.0 0.0>


I need to apply a factor (1000 in this particular case) to be able to work with kHz and V before the values are displayed on the same line.

How can I solve this?

Thanks
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2741 on: September 19, 2022, 03:46:46 pm »
I have a test equipment where its units change according to their values. For example, mV becomes V above 300 mV, same for Hz becoming kHz, etc.

I need to apply a factor (1000 in this particular case) to be able to work with kHz and V before the values are displayed on the same line.

How can I solve this?

There are two ways.
Quote
#askValuesReadFormat a list of what value to use and what value to remove
#askValuesMathFormat  expression, input is called value

For ReadFormat see here: https://lygte-info.dk/project/TestControllerConfigDevice%20UK.html#readFormat

MathFormat is the same as :readMath: for #scpiCmds, i.e. you can use any expression including parseSI() see here: https://lygte-info.dk/project/TestControllerFunctions%20UK.html#parseSI

For performance reason (Mostly relevant if you are logging fast with many devices) it is best to use ReadFormat when it can do it.
 
The following users thanked this post: rachdatu

Offline NaxFM

  • Regular Contributor
  • *
  • Posts: 124
  • Country: it
Re: Program that can log from many multimeters.
« Reply #2742 on: September 20, 2022, 07:55:01 am »
I know it may be too much to ask given what the program does already, but does it have some sort of scan feature for external scan cards?
I'm designing a scan card which will work with rs232 scpi and simple up-down-reset signals, is there any way to control this scan scard and ask the dmm for a measurement?
Even a simple "send a command on COM port before next measurement" would be extremely handy for me. Is there any way to do it?
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2743 on: September 20, 2022, 08:15:03 am »
I know it may be too much to ask given what the program does already, but does it have some sort of scan feature for external scan cards?
I'm designing a scan card which will work with rs232 scpi and simple up-down-reset signals, is there any way to control this scan scard and ask the dmm for a measurement?
Even a simple "send a command on COM port before next measurement" would be extremely handy for me. Is there any way to do it?

Not at the current time, but it is, more or less, on my ToDo list.
There is a couple of issue (or challenges) with it:
How to handle logging when only 1 of N values are available
It must be able to work with any device at least of the DMM type.
It must be able to send a send a one or more command to the device after each input change (To change range or mode).
What about devices with multiple logging values?

If you just want to switch manually, it is easy to create a device for your mux with buttons to select each input.
 

Offline NaxFM

  • Regular Contributor
  • *
  • Posts: 124
  • Country: it
Re: Program that can log from many multimeters.
« Reply #2744 on: September 20, 2022, 09:45:54 am »
Thank you for the reply.
I understand it must be very hard to implement, and of course i'm not asking you to do it, scan cards are a very niche thing.
I guess that for my particular case I'll write a simple python script to switch, measure and log everything in an excel file.
 

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2745 on: September 21, 2022, 04:40:06 pm »
I have a test equipment where its units change according to their values. For example, mV becomes V above 300 mV, same for Hz becoming kHz, etc.

I need to apply a factor (1000 in this particular case) to be able to work with kHz and V before the values are displayed on the same line.

How can I solve this?

There are two ways.
Quote
#askValuesReadFormat a list of what value to use and what value to remove
#askValuesMathFormat  expression, input is called value

For ReadFormat see here: https://lygte-info.dk/project/TestControllerConfigDevice%20UK.html#readFormat

MathFormat is the same as :readMath: for #scpiCmds, i.e. you can use any expression including parseSI() see here: https://lygte-info.dk/project/TestControllerFunctions%20UK.html#parseSI

For performance reason (Mostly relevant if you are logging fast with many devices) it is best to use ReadFormat when it can do it.

Thanks for your help.
However, I haven't found any "decent" RegEX to deal with data coming on a single line.

I have uploaded a def. file for the Marconi 2955 radio communications test set. Some features have not been implemented.
You can look at the file for more info.

To make it work, you need some kind of hardware between TC and the device. I am using an AR488 GPIB controller.

The interface is quite slow. You need patience. It takes around one minute to load the first time.
The interface is done in a way that not all data are loaded every time.

I have probably exaggerated the different delays. You can tune them down if you like.

At the beginning, you should start TC in Debug mode, so you can see the data in the console.

I do not have any transceiver, so very few tests have been done (only Audio Test in fact).

Maybe there is a way to improve the speed or the interface and fix some bugs!. Let me know.


 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2746 on: September 25, 2022, 11:55:51 am »
I have uploaded a def. file for the Marconi 2955 radio communications test set. Some features have not been implemented.
You can look at the file for more info.

Thanks, it will be included in next release.
 
The following users thanked this post: rachdatu

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2747 on: October 05, 2022, 10:28:32 am »
V2.26 is up
It includes some additions to TestController and a few new devices.
   Added: Grid Panel item to control a power supply with a couple of fixed settings.
   Added: Grid Panel item to control a two power supplies with a couple of fixed settings.
   Added: Grid Panel item to control one or more loads with a couple of fixed settings. This will automatic distribute the load between them.
   Added: Marconi 2955 Radio Communications Test Set (Thanks rachdatu)
   Added: Owon XDM3051 DMM (Thanks DiplIngenieur)
   Added: Owon P4603, Owon P4305 power supplies (Thanks DiplIngenieur)
   Added: Support for #scpiCmd that uses calculator scripts
   Added: control set, like multi, but can handle more parameters
   Added: :labelformat: Some text formatting on the "Setup" popups.
   Changed: RTC1002, HMC8012, NGE100 (Thanks PL)


Some of the addition makes more advanced device definitions possible:
The control set is similar to control multi, but instead combines regular controls (Including multi):


If is possible in #scpiCmd to use regular scripts, this is only for very special cases.

Some of the text on the setup popup can be adjusted with colors, font and style, again something that is recommended to use sparingly.

For the grid panel it is now possible to create simple controls to set a preset power supply:


This is also possible for a load or a couple of loads:

This makes it easy to use a couple of loads together for higher current/power.
 
The following users thanked this post: croma641, Pukker, 2N3055, rachdatu

Offline rachdatu

  • Regular Contributor
  • *
  • Posts: 54
  • Country: ch
Re: Program that can log from many multimeters.
« Reply #2748 on: October 05, 2022, 07:17:19 pm »
Hello

Thanks for the update. The concatenation of parameters works nicely. I have an issue with the format of the strings being sent and that crashes the application:

Code: [Select]
#scpiCmd SetParameterTest tx (value)

#cmdSetup combobox Battery_type Memory_Editor
:read:
: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 numberInt Capacity Memory_Editor
:read:
:write: (hex(((round(value/100))*100)))
mAh 0.1 5000

#cmdSetup set Update Memory_Editor
:write: SetParameterTest
Memory_Editor.Battery_type Memory_Editor.Number_Cells  Memory_Editor.Capacity
;\x20

;; Hyperion: Tx <SetParameterTest 0000000B01F4>
java.lang.NumberFormatException: For input string: "0000000B01F4"
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at dk.hkj.util.StringUtil.parseInt(StringUtil.java:584)
        at dk.hkj.devices.DeviceBlock$TranslatingCommInterface.parseWriteString(
DeviceBlock.java:209)
        at dk.hkj.devices.DeviceBlock$TranslatingCommInterface.writeRead(DeviceB
lock.java:471)
        at dk.hkj.devices.DeviceBlock$TranslatingCommInterface.write(DeviceBlock
.java:554)
        at dk.hkj.main.SCPICommand.writeReadInternal(SCPICommand.java:316)
        at dk.hkj.main.SCPICommand.writeRead(SCPICommand.java:365)
        at dk.hkj.main.SCPICommand.write(SCPICommand.java:413)
        at dk.hkj.devices.SetupFormats$SetField.localWrite(SetupFormats.java:511
3)
        at dk.hkj.devices.SetupFormats$SetField.actionPerformed(SetupFormats.jav
a:5130)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
rivilege(Unknown Source)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
rivilege(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
rivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)



How to convert these strings (0000000B01F4) to something like this:

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

Thanks
 

Offline HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: dk
    • Tests
Re: Program that can log from many multimeters.
« Reply #2749 on: October 06, 2022, 07:40:01 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf