I was using #driver Block in my device file. With that driver the txrx1Bin? and txrxnBin? commands send nothing over the serial port and the txrx1? and txrxn? commands do send characters over the serial port. I changed to #driver ascii and now the txrx1Bin? and txrxnBin? commands do send. Sorry for my confusion.
The bin suffix are not supported on the block device, because all commands are binary.
For each driver (block/ascii/etc.) the commands are coded separately, the names may be similar, but the parameters and functions may not be.
Unfortunately, using #driver ascii with txrx1Bin? does not always send the correct character. From 0x00 up to 0x7f and from 0xa0 to 0xff all seems to work. But any value from 0x80 to 0x9f seems to always incorrectly send value 0x3F or character "?". See below from the DOS debug window showing selected values working and values 0x8a and 0x90 not working with 0x3F incorrectly sent.
So, how to get TC to correctly send binary values between 0x80 and 0x9f??
Oops, it is fixed in the interim release below.
On the question for signed versus un-signed and on byte order this device does have signed integers and will receive ms byte first and ls byte second. So, commands to help with that natively would be convenient. For now using "readmath" will do.
New function:
binConv(value,offset,count{,signed{,swap}})
;I use hex() function to show actual byte swapping
hex(binConv(0x12345678,0,4)) -> 12345678
hex(binConv(0x12345678,0,2)) -> 5678
hex(binConv(0x12345678,1,2)) -> 3456
hex(binConv(0x8012,0,2,1)) -> FFFF8012 this is a negative number
hex(binConv(0x12345678,0,4,0,1)) -> 78563412
hex(binConv(0x12345678,0,4,0,"3120")) -> 12563478
hex(binConv("\x12\x34\x56\x78",0,4)) -> 78563412
Another question. If a device had a register in counts that needs to be scaled and offset to convert to real units, then for the read #scpiCmd it is a simple matter of :readmath:. But, if this register is read/write how to do a #scpiCmd for the write that takes the user/real units in and coverts to a single byte in counts before sending?
The result when using () in a line is a string result, i.e. you must convert the result to hex with the hex() function to use it as a hex argument. From the interim version it is possible to specific digits in the hex function (You need two for the above):
hex(value)
hex(value,digits)
#scpiCmd Temp txrx1Bin? \x21\x(hex(round((value + 0.6)/22.3),2))
Interim release:
http://lygte-info.dk/pic/Projects/TestController/TestController.jar