Hi HKJ,
I am trying to write a script and TestController is doing something that is confusing me. Hopefully you can easily explain it?
When I run the below code I am getting read's and writes to my connected device.
#logcmds 0
=var n = 0
=var done = 0
#while (done == 0)
= done = 1
#endwhile
Results from running the above in debug mode:
;; AKD2GS: Tx <REC.TRIG>
;; AKD2GS: Tx <txrx REC.TRIG>
;; 192.168.1.197: Tx: <REC.TRIG..> 52 45 43 2E 54 52 49 47 0D 0A
;; 192.168.1.197: Rx: <> 0D
;; AKD2GS: Tx <REC.DATA?>
;; AKD2GS: Tx <txrxn? 2 REC.RETRIEVEDATA 0
:readmath: getElement(value,1,"\n")>
;; 192.168.1.197: Tx: <REC.RETRIEVEDATA 0..> 52 45 43 2E 52 45 54 52 49 45 56 45 44 41 54 41 20 30 0D 0A
;; 192.168.1.197: Rx: <1> 31 0D
;; 192.168.1.197: Rx: <5490269972.049,0.001,3742633071,0.000,-0.005,1119> 35 34 39 30 32 36 39 39 37 32 2E 30 34 39 2C 30 2E 30 30 31 2C 33 37 34 32 36 33 33 30 37 31 2C 30 2E 30 30 30 2C 2D 30 2E 30 30 35 2C 31 31 31 39 0D
;; AKD2GS: Rx <5490269972.049,0.001,3742633071,0.000,-0.005,1119>
;; AKD2GS: Rx as numbers <5.490269972049E9 0.001 3.742633071E9 0.0 -0.005 1119.0>
The above is the sequence of communications to the attached device as if TestController is logging one point and executing the driver file #askValues line.
If I comment out the #while, #endwhile and then run this simple script the debug window is empty/no communications to the attached device.
If I change the #while, #endwhile to #if, #endif the same behavior of communicating with the device.
I would not expect any communications to the connected device when running "pure script commands". Can you explain why the #while or #if script lines seems to kick off an #askValues connected device communications sequence?
In my more complete script that is doing real work these extra data requests make it not work. So, is there a way to prevent talking to the connected devices except when explicitly communicating to them or logging data while running a script?
For reference, I am using TestController Ver 2.44 with my device "Kollmorgen AKD2G.txt" device. All operations were done while on the Commands Tab with data logging off.