HKJ,
Thanks for the #DEVICELOGGINGDISABLE, #DEVICELOGGINGENABLE script commands. So far they seem to work as desired. I will check them out more thoroughly soon.
I do have a question about a problem I am having getting an 8 byte return and parsing the last byte out. Below is the device file code for the command:
#scpiCmd samplePVIT? txrxnBin? 7 \x5E\x00\x5C\x00\x5A\x00\x3A\x00\x38\x00\x8A\x00\x88\x00\x4c\x00
:readmath: binConv(int(value),0,3,0,1)/256.0+", "+binConv(int(value),3,2,1,1)*0.5587935448+", "+binConv(int(0xF0FFFFFFFFFFFF&value),5,2,1,1)*DIpeak/9668+", "+binConv(int(value),7,1,0,0)
This device is using #driver ascii. Below is the output from the DOS debug window:
samplePVIT?
;; S200: Tx <samplePVIT?>
;; S200: Tx <txrxnBin? 7 \x5E\x00\x5C\x00\x5A\x00\x3A\x00\x38\x00\x8A\x00\x88\x00\x4c\x00>
;; COM1: TxBin: <^.\.Z.:.8.?.?.L.> 5E 00 5C 00 5A 00 3A 00 38 00 8A 00 88 00 4C 00
;; COM1: RxBin: 9A D1 05 00 01 00 18 36
;; S200: Rx <39633.01953125, 0.5587935448, 0.029788994621431527, 0>
;; 39633.01953125, 0.5587935448, 0.029788994621431527, 0
Note that the last byte received is 36 hex but the last number in the received value after the readmath is 0. Nothing I do seems to get that last byte to be anything other than 0. Using the same code in a script:
= binConv("\x9A\xCF\xFA\x00\x00\x00\x48\x36",7,1,0,0)
properly gives decimal 54 back.
The first 7 received bytes all get handled properly. It is just the eighth one that comes back as zero in the received command. I had thought it would put the 8 bytes into a long integer which is 8 bytes long and would be able to handle it.
Thoughts on what I might be doing wrong or what might be going wrong inside TC? Suggestions to try?