Author Topic: Program that can log/control many multimeters and other devices.  (Read 1104288 times)

Ismo, 2X, flash2b and 12 Guests are viewing this topic.

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5500 on: January 22, 2026, 11:48:51 am »
What is the difference between the
runScriptAsync(""
+"#CLOSEALL\n"”
+"#ShowPopupSystem GridPanel 77 20 1092 321\n"


and the
runScriptAsync("""\#CLOSEALL
\x23ShowPopupSystem GridPanel 77 20 1092 321


The difference is the way you write it and I suspect the second way will be a tiny bit faster (Not that it matters, because it is only executed when you select the function and 0.001 second extra is totally insignificant).
Both generate exactly the same script for TC to run.
The second method is easier to use if you have many lines.

The “\x23” what is essentially and has any advantage or disadvantage over the “+"#”?

In definitions any line starting with # will start a new section (Each section belong to the preceding # statement, it do not matter if the command uses the data or not).
For that reason you cannot start a line with # if you want to stay in the same section, in this case your program must be fully in one section. By using the \x23 you avoid the # and \x23 is hex code for a # and the string parser will convert it it to # in the string (Like a \n is converter to a new line character).
TC has a couple of differing \ codes that can be used in strings, there are 3 groups, single letter, \x00 for hex codes and \u0000 for unicode, this is similar to other programming languages and makes it possible to put any character into a string, even if you are only using 7 bit ascii in the definition file.

 
The following users thanked this post: 2X

Online 2X

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5501 on: January 22, 2026, 12:00:28 pm »
What is the difference between the
runScriptAsync(""
+"#CLOSEALL\n"”
+"#ShowPopupSystem GridPanel 77 20 1092 321\n"


and the
runScriptAsync("""\#CLOSEALL
\x23ShowPopupSystem GridPanel 77 20 1092 321


The difference is the way you write it and I suspect the second way will be a tiny bit faster (Not that it matters, because it is only executed when you select the function and 0.001 second extra is totally insignificant).
Both generate exactly the same script for TC to run.
The second method is easier to use if you have many lines.

The “\x23” what is essentially and has any advantage or disadvantage over the “+"#”?

In definitions any line starting with # will start a new section (Each section belong to the preceding # statement, it do not matter if the command uses the data or not).
For that reason you cannot start a line with # if you want to stay in the same section, in this case your program must be fully in one section. By using the \x23 you avoid the # and \x23 is hex code for a # and the string parser will convert it it to # in the string (Like a \n is converter to a new line character).
TC has a couple of differing \ codes that can be used in strings, there are 3 groups, single letter, \x00 for hex codes and \u0000 for unicode, this is similar to other programming languages and makes it possible to put any character into a string, even if you are only using 7 bit ascii in the definition file.

Do you know why this not working +"#GridPanel Readout RTB2004.DVM1_Voltage - CH1_COLOR and this +"#GridPanel Readout RTB2004.DVM1_Voltage - (25,32,36)   works fine?

#replaceText CH1_COLOR (255,255,0) ;yellow  
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5502 on: January 22, 2026, 12:07:01 pm »
Do you know why this not working +"#GridPanel Readout RTB2004.DVM1_Voltage - CH1_COLOR and this +"#GridPanel Readout RTB2004.DVM1_Voltage - (25,32,36)   works fine?

#replaceText CH1_COLOR (255,255,0) ;yellow

I assume you are in a definition file.
Get rid of the ;yellow #replaceText takes everything litterally and readout do not know what ;yellow means.
 
The following users thanked this post: 2X

Online 2X

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5503 on: January 22, 2026, 12:13:44 pm »
I used the second code but still not working.
I beleive I have right something wrong.

#otherText
if (name=="Display voltmeters.txt")
runScriptAsync("""\#CLOSEALL
\x34ShowPopupSystem GridPanel 77 20 1092 321
\x34GridPanel Readout RTB2004.DVM1_Voltage
""");
endif;


Quote
Generally I uses TC to generate the code for the popups. I.e. open the readout and configure it, then right click in the log window and select "Generate script, Layout, In log Window". You can then pick a correctly formed statement for opening the readout the way you configured it.

This way works extremely well to find definitions from what you want to do.

From the attached image I assume that there is no way to change the font type to bold or italic and the typeface to Arial, Times New Roman?
« Last Edit: January 22, 2026, 12:23:34 pm by 2X »
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5504 on: January 22, 2026, 01:03:47 pm »
I used the second code but still not working.
I beleive I have right something wrong.

#otherText
if (name=="Display voltmeters.txt")
runScriptAsync("""\#CLOSEALL
\x34ShowPopupSystem GridPanel 77 20 1092 321
\x34GridPanel Readout RTB2004.DVM1_Voltage
""");
endif;


Very simple, \# is a invalid escape, get rid of the \ and use:
runScriptAsync("""#CLOSEALL

Yes, it was my mistake, I know that :)

Quote
Generally I uses TC to generate the code for the popups. I.e. open the readout and configure it, then right click in the log window and select "Generate script, Layout, In log Window". You can then pick a correctly formed statement for opening the readout the way you configured it.

This way works extremely well to find definitions from what you want to do.

From the attached image I assume that there is no way to change the font type to bold or italic and the typeface to Arial, Times New Roman?

No, mostly TC uses a fixed font.
 
The following users thanked this post: 2X

Online 2X

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5505 on: January 22, 2026, 02:31:14 pm »
Finally, I done it (with many help and patience from you). One more question.
Can I add a check box on the bottom of the “ Grid Panel” like in the attached picture (4 DVMs - Grid Panel - On Top Check Box), in order to turn ON & OFF the “ On Top” option?

Code: [Select]
; ================================ Meta Definition ================================
#metadef
; The empty #metadef will use the #meta exactly as it is, you can then fill or add other #metadef that overrides what needs to be changed for other devices.
;(0,255,0): (R, G, B) RGB colour code
; yellow
#replaceText CH1_COLOR (255,255,0)
; green
#replaceText CH2_COLOR (0,255,0)
; orange
#replaceText CH3_COLOR (255,128,0)
; blue
#replaceText CH4_COLOR (150,150,255)
; charcoal blue
#replaceText DVMS_BACKROUND_COLOR (54,68,78)


#meta
#author 2X
#idString Rohde&Schwarz,RTB2004,
#name     R&S RTB2004
#handle   RTB2004
#port 5025
; Alternate port types: comnobaud or com, com lets the user define baudrate on the "Load devices" page

; --------------------------------------------------------------------------------



; ================================ SCPI Commands ================================
; Create four Coloumns for reading values from 4 digital voltmeters of RTB24
#value DVM1_Voltage V SI
#value DVM2_Voltage V SI
#value DVM3_Voltage V SI
#value DVM4_Voltage V SI

; Read measurement/values from four oscilloscope Digital Multimeters(DVMX)
#askValues DVM1:RESult?; DVM2:RESult?; DVM3:RESult?; DVM4:RESult?
; ------------------------------------------------------------------------



; ========================== Other Menu Steup ================================
; Create "Other" menu button
#otherList
menuItem[0]="Display voltmeters.txt";

#otherText
if (name=="Display voltmeters.txt")
runScriptAsync("""#CLOSEALL
\x23ShowPopupSystem GridPanel 77 20 1092 321
\x23GridPanel 1 4
\x23GridPanel Readout RTB2004.DVM1_Voltage dh CH1_COLOR DVMS_BACKROUND_COLOR
\x23GridPanel Readout RTB2004.DVM2_Voltage dh CH2_COLOR DVMS_BACKROUND_COLOR
\x23GridPanel Readout RTB2004.DVM3_Voltage dh CH3_COLOR DVMS_BACKROUND_COLOR
\x23GridPanel Readout RTB2004.DVM4_Voltage dh CH4_COLOR DVMS_BACKROUND_COLOR
""");
endif;
; ------------------------------------------------------------------------
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5506 on: January 22, 2026, 02:38:26 pm »
Finally, I done it (with many help and patience from you). One more question.
Can I add a check box on the bottom of the “ Grid Panel” like in the attached picture (4 DVMs - Grid Panel - On Top Check Box), in order to turn ON & OFF the “ On Top” option?

No.

Theoretical you could add a script button that made a new version of the gridPanel with onTop or not, but that is to go way to far.
 
The following users thanked this post: 2X

Online 2X

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5507 on: January 22, 2026, 02:40:53 pm »
Finally, I done it (with many help and patience from you). One more question.
Can I add a check box on the bottom of the “ Grid Panel” like in the attached picture (4 DVMs - Grid Panel - On Top Check Box), in order to turn ON & OFF the “ On Top” option?

Also, when the TC recognizes the device can I display a message with some instructions/hints on the Log window (Picture: Log Window - Message )?
 

Online 2X

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5508 on: January 22, 2026, 02:41:31 pm »
There is any example to do something like this?
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5509 on: January 22, 2026, 02:46:29 pm »
Also, when the TC recognizes the device can I display a message with some instructions/hints on the Log window (Picture: Log Window - Message )?

No.

There is a #notes tag you can use in the definition, it will show up on the "Load devices" page and can show relevant information about the device setting and connection.
If you want to show something very important you could add a extra point in the "Other" to show it.
What about a function to take a screendump? If the scope support it, it is very simple, search in the Magnova file to see how it is done.
 
The following users thanked this post: 2X

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5510 on: January 22, 2026, 04:59:30 pm »
There is any example to do something like this?

That's already built-in to the grid panel. Right-click near the button on the left.
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 
The following users thanked this post: 2X

Online 2X

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5511 on: January 22, 2026, 05:06:47 pm »
There is any example to do something like this?

That's already built-in to the grid panel. Right-click near the button on the left.

Thanks for the reply.
I know this but I would place it directly on the grid panel (picture 4 DVMs - Grid Panel - On Top Check Box).
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5512 on: January 22, 2026, 05:11:11 pm »
I know this but I would place it directly on the grid panel (picture 4 DVMs - Grid Panel - On Top Check Box).

The issue is that you can resize the panel to any size and in some cases there would not be space for a checkbox.
With the right click menu it is always there and work the same on grid panel and single panel (That do not have a space at the bottom).
 
The following users thanked this post: 2X, KungFuJosh

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5513 on: January 22, 2026, 05:18:42 pm »
What font is TC using for system stuff like the grid panel marker at the bottom? 2X and I are both missing whatever's supposed to be between the grid numbers.
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 
The following users thanked this post: 2X

Online 2X

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5514 on: January 22, 2026, 05:23:44 pm »
I know this but I would place it directly on the grid panel (picture 4 DVMs - Grid Panel - On Top Check Box).

The issue is that you can resize the panel to any size and in some cases there would not be space for a checkbox.
With the right click menu it is always there and work the same on grid panel and single panel (That do not have a space at the bottom).

It would be very nice if at the bottom of the Grid Panel was a bar where we can add a button, checkbox etc. Also, an option for differnt font type would be nice. I don't know if these options could be added in a future version, but would be very nice.
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5515 on: January 22, 2026, 05:32:28 pm »
What font is TC using for system stuff like the grid panel marker at the bottom? 2X and I are both missing whatever's supposed to be between the grid numbers.

It is using the standard Java fonts, they map to some system font, but I do not remember which one.
Between the two number is a multiplication sign in unicode.
 
The following users thanked this post: 2X

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5516 on: January 22, 2026, 05:36:29 pm »
It would be very nice if at the bottom of the Grid Panel was a bar where we can add a button, checkbox etc.

What would be the purpose?
The individual panels can be broken out to a single panel and you have a lots of different functionality in them.
Buttons/checkboxes at the bottom would have to be assigned functions, that would probably be a large addition and it could not be moved to single panel.

Also, an option for differnt font type would be nice. I don't know if these options could be added in a future version, but would be very nice.

I am not that happy about implementing a font option, in my view it is not really needed.
 
The following users thanked this post: 2X, KungFuJosh

Online 2X

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5517 on: January 22, 2026, 05:42:33 pm »
Also, when the TC recognizes the device can I display a message with some instructions/hints on the Log window (Picture: Log Window - Message )?

No.

There is a #notes tag you can use in the definition, it will show up on the "Load devices" page and can show relevant information about the device setting and connection.
If you want to show something very important you could add a extra point in the "Other" to show it.
What about a function to take a screendump? If the scope support it, it is very simple, search in the Magnova file to see how it is done.

And this done. Very nice addition the "#notes" option for a new user.
Code: [Select]
; =================== Text for View button at Load devices tab ===================
#notes
* Because the updating rate from the Digital Voltemetes is not specified at the RTB24 or RTB2004 manual,
I made a question to the R&S and below is the reply from the company.
* R&S reply: The update rate of the digital voltmeter function is not specified.
  But we did some tests and can confirm that it the interval is about 1 s"
; --------------------------------------------------------------------------------
 

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5518 on: January 22, 2026, 05:43:57 pm »
It is using the standard Java fonts, they map to some system font, but I do not remember which one.
Between the two number is a multiplication sign in unicode.

Yes, I remember it being an x. However, it appears to be a bug that was introduced in v2.91 that it's missing. I went through my backup versions of TC, and the x is present until v2.91.

Thanks,
Josh
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 
The following users thanked this post: 2X

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5519 on: January 22, 2026, 05:55:53 pm »
Yes, I remember it being an x. However, it appears to be a bug that was introduced in v2.91 that it's missing. I went through my backup versions of TC, and the x is present until v2.91.

It is still present in my version!

Ohh, ok! The release is compile on a Linux machine, my devlop version is on windows. It is probably a code page issues between the two environment, I have replace it with a \u00d7 in the code, this will work in both cases.

There may be a few more of these instances in TC, I will fix them when somebody find them.
 
The following users thanked this post: 2X, KungFuJosh

Online 2X

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5520 on: January 22, 2026, 05:56:57 pm »
There is a way to predifine the display colors of each waveform in definition file? I want the waveforms/graphs displayed in the same colors like they are in the oscilloscopes screen.
I used the the generetion of a script at the log window of TC but the produced code didn't include something about waveforms color.


; Adding scales, when needed a missing scale will always be auto created
#scale RTB2004.DVM1_Voltage 2 0 0 1 1 1.0 1.0
#scale RTB2004.DVM2_Voltage 2 0 0 1 1 1.0 1.0
#scale RTB2004.DVM3_Voltage 2 0 0 1 1 1.0 1.0
#scale RTB2004.DVM4_Voltage 2 0 0 1 1 1.0 1.0
;
; Selection of curves only works when there is some table data
#ChartCurves  RTB2004.DVM1_Voltage RTB2004.DVM2_Voltage RTB2004.DVM3_Voltage RTB2004.DVM4_Voltage
#ChartX time
#ChartSamples "" ""
;
#HistogramOptions Count 50
#HistogramCurves  RTB2004.DVM1_Voltage
#HistogramSamples """ ""
;
#RangeSamples "" ""
#RangeOptions /s


https://lygte-info.dk/project/TestControllerIntro%20UK.html#Chart
« Last Edit: January 22, 2026, 05:59:45 pm by 2X »
 

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5521 on: January 22, 2026, 06:01:19 pm »
There is a way to predifine the display colors of each waveform in definition file? I want the waveforms/graphs displayed in the same colors like they are in the oscilloscopes screen.
I used the the generetion of a script at the log window of TC but the produced code didn't include something about waveforms color.

You need to right click on a chart and select "Layout", then you can change color.
To get it as script uses "Chart layout" instead of "Layout"

Be aware that the colors follows the curve numbers and you can move the actual curves around between the different curve numbers by enable/disable them in sequence.
 
The following users thanked this post: 2X

Offline KungFuJosh

  • Super Contributor
  • ***
  • Posts: 5949
  • Country: us
  • TEAS is real.
Re: Program that can log/control many multimeters and other devices.
« Reply #5522 on: January 22, 2026, 06:11:20 pm »
Yes, I remember it being an x. However, it appears to be a bug that was introduced in v2.91 that it's missing. I went through my backup versions of TC, and the x is present until v2.91.

It is still present in my version!

Ohh, ok! The release is compile on a Linux machine, my devlop version is on windows. It is probably a code page issues between the two environment, I have replace it with a \u00d7 in the code, this will work in both cases.

There may be a few more of these instances in TC, I will fix them when somebody find them.

Maybe a very careful Find & Replace of the original offending code? ;)
"Experience is something you don't get until just after you need it." - Steven Wright
Best Continuity Tester Ever
 
The following users thanked this post: 2X

Online HKJTopic starter

  • Super Contributor
  • ***
  • Posts: 3898
  • Country: dk
    • Tests
Re: Program that can log/control many multimeters and other devices.
« Reply #5523 on: January 22, 2026, 06:14:24 pm »
Maybe a very careful Find & Replace of the original offending code? ;)

If it was a specific character, that may work, but I suspect I may have used other characters that have code page problems. It it is the case it will probably be only a few.
 
The following users thanked this post: 2X, KungFuJosh

Online 2X

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gr
Re: Program that can log/control many multimeters and other devices.
« Reply #5524 on: January 22, 2026, 06:39:46 pm »
There is a way to predifine the display colors of each waveform in definition file? I want the waveforms/graphs displayed in the same colors like they are in the oscilloscopes screen.
I used the the generetion of a script at the log window of TC but the produced code didn't include something about waveforms color.

You need to right click on a chart and select "Layout", then you can change color.
To get it as script uses "Chart layout" instead of "Layout"

Be aware that the colors follows the curve numbers and you can move the actual curves around between the different curve numbers by enable/disable them in sequence.

How can I see the definitions from the script "Chart layout" in order to put them im my definition file?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf