Whoa, the language in the definition files is a true programming language
![Scared :scared:](https://www.eevblog.com/forum/Smileys/default/scared.gif)
Yes, but you only have access to a small part of it.
#initCmd init
The ascii driver only understands tx/txrx/txrx?, anything else must be defined with #scpiCmd
;; COM9: Tx: <T0.> 54 30 0A
The dot is used to show non-printable characters, here it is a LF or 0A code, as can be see in the hex part.
Then, why after:
;; COM9: Tx: <WRT 1.> 57 52 54 20 31 0A
;; COM9: Tx: <M?.> 4D 3F 0A
(Excluding the dot..) It do:
;; COM9: Tx: <TMO 1.0.> 54 4D 4F 20 31 2E 30 0A
And not an rd for read the device mode?
The driver keeps track of timeout setting and when it is changed it will send a new timeout command to the gpib device. As long as the gpib controller is only handling one device you will probably only see the TMO command once.
To do a read you do a txrx? (txrx works the same way, but you will not get the result) and then you are supposed to see:
WRT deviceAddress
The actual string you want to write
Optional a TMO
A RD #chars,deviceAddress
And then the result, it can either be a timeout or a string.
A write is done with tx and you will see:
WRT deviceAddress
The actual string you want to write
For a more simple definition use:
#value VoltageDC V si
and put a ; before #askmode:
;#askMode
This means TestController will always show one data value for the device called "VoltageDC"
Then you can work with #askValues to get the readings from the meter.
Probably something like:
#scpiCmd value? txrx? G
#askValues value?
And you need to init the meter for single shot measurements:
#scpiCmd sampleMode tx T(value)
#initCmd sampleMode 0
When you have this working, you can implement the different modes and maybe also add range and sample time selections.