Skip to content

Serial Devices (QST)

Michelle Sands edited this page Dec 5, 2025 · 5 revisions

On This Page

On Versioning

There's a bit of versioning nonsense in the code for future-proofing. The library we were previously using, serial, is slated to be deprecated, to be replaced with serialport. Serialport is only half-implemented in the version of MATLAB I'm coding in (2023b), so a lot of the serialport functions are untested or only partially tested.

For posterity, here are the resources I've been using:

Communication Protocol

Credit to pytscii for this list. If you're looking to communicate with this hardware in python, that library seems like a good pick.

LAB MEMBERS: You can access the actual manual for the TCSII on the lab's UQ RDM drive under CWGROUP-Q6080/LabTracking/Manuals/QST.

NON-MEMBERS: Sorry the actual manual isn't uploaded. I'm fairly sure it's available here under downloads, but it's password-protected so I'm not sure if they'll get cross at me for uploading it here.

TCSII serial commands:

Command Description
'H'. this help
'?'. returns 'TCS'
'Nxxx'. set neutral temperature in 1/10 degrees ('xxx'='200' to '400')
'G'. calibrate neutral temperature ( after few seconds return 'Nxxx' with xxx = neutral temperature in 1/10 degrees )
'Sxxxxx' enable/disable area 1 to 5 (x='1'=enable or '0'=disable)
'Csxxx' set stimulation temperature in 1/10 degrees ('s'='0'(all areas) or '1' to '5', 'xxx'='100' to '600')
'Vsxxxx' set stimulation speed in 1/10 degrees per seconds ('s'='0'(all areas) or '1' to '5', 'xxxx'='0001' to '9999')
'Rsxxxx' set return speed in 1/10 degrees per seconds ('s'='0'(all areas) or '1' to '5', 'xxxx'='0001' to '9999')
'Dsxxxxx' set stimulation Duration in ms ('s'='0'(all areas) or '1' to '5', 'xxxxx'='00001' to '99999')
'Txxxyyy' set Trigger number and duration (number 'xxx'='001' to '255', duration 'yyy'='010' to '999')
'P'. display stimulation Parameters (global and for each area)
'L'. start stimuLation
'A'. Abort current stimulation or exit 'follow mode', return to neutral
'F'. 'mute mode', disable display of temperatures between and during stimulations
'Yxxxx' set the duration of temperature display during stimulation in ten ms ('xxxx'='0000' to '9999') if set to '0000' (default state) displays temperatures during the entire stimulation
'Oa'. enable temperatures display between stimulations ( 1Hz, active by default )
'Ob'. enable temperatures display during stimulations ( 100Hz, active by default )
'Oc'. reset stimulator
'Od'. 'follow mode': probe goes to the setpoint temperature and remains there as long as the setpoint does not change.
'Omxxx' Defines a maximum stimulation temperature ('xxx' 1/10 degrees). 'C' command is limited to this temperature.
'Ovsxxxxx' set stimulation speed in 1/100 degrees per seconds ('s'='0'(all areas) or '1' to '5', 'xxxxx'='00001' to '99999')
'Orsxxxxx' set return speed in 1/100 degrees per seconds ('s'='0'(all areas) or '1' to '5', 'xxxxx'='00001' to '99999')
'Otsxxxx' set stimulation temperature in 1/100 degrees ('s'='0'(all areas) or '1' to '5', 'xxxx'='0001' to '6000')
'Oe'. display current temperatures for neutral and area 1 to 5 in 1/100 degrees
'Osx'. enable (x='e') or disable (x='d') the launch of a stimulation using the trigger in
'Oo'. Output trigger
'B'. display Battery voltage and % of charge
'Ix'. enable/disable Integral term, 'x'='1' : enable(default state), 'x'='0' : disable
'E'. display currEnt temperatures for neutral and area 1 to 5 in 1/10 degrees
'K'. get 'stim' & 'resp' buttons state ( CR+'00':both released, CR+'11':both pressed, CR+'10':'stim' button pressed,...)
'Q'. get error state ( return 'xxxxxx', for each zone+neutral: 'x'=0:OK,'x'>1:ERROR )
'Ur'. display temperature profile for each area: area number(1..5), profile enabled, number of points defined, points list
'Uwxxxxxnnndddtttdddttt...' User defined temperature profile, defined by segments of variable duration. 'xxxxx': areas defined ('11111' all areas, '10000' just area 1, ...), 'nnn': number of segments ('000' to '999'), 'dddttt': list of duration of segment in ten of ms ('001' to '999') and temperature at end of segment ('000' to '600')
'Uexxxxx' enable/disable temperature profile for each area (x='1'=enable or '0'=disable=default)
'Xr'. clock read hour and date, return hhmmssddmmyy
'Xwhhmmssddmmyy' clock write hour and date ( hh:heure, mm:minute, ss:seconds, dd:day, mm:month, yy:year )
'Zdddfff' Buzzer ddd: duration in 10x ms, fff: frequency in 10x Hz
'OiI'. program Irm room extension cable
'OiC'. program Control room extension cable
'Oim'. measure temperature of extension cable ( takes about 1.5s )
'Oit'. display temperature of extension cable
'Ofx' set IRM filter strength, 'x'='1':low, 'x'='2':medium, 'x'='3':high
'Ol' starts a stimulation which can be stopped by the response button
'Og' display current temperatures and buttons state (merges 'E' and 'K' command).

Troubleshooting

I expected StimControl to detect a serial device but it didn't

Try closing StimControl, restarting the serial device, then turning Stimcontrol back on. This is a known issue when trying to open serial devices using the old serial library (MATLAB version < 2023b). If this doesn't work, check your device is connected and that your computer is detecting the device.

StimControl is throwing an error when it tries to connect to a serial device

Your drivers may be out of date. I worked around this by querying the device in the command window using mode, then changing the device's baud rate to the sppropriate number. I wouldn't recommend doing this, but it did work when I tried it.

How can I check the point of failure?

You can use Coolterm to troubleshoot the serial connection itself without needing to go through MATLAB. The relevant parameters for QST devices are:

  • baud Rate: 115200
  • data bits: 8
  • no parity
  • stop bits: 1
  • no flow control

You can also use the windows command terminal to find relevant parameters for the serial connection: >> mode will list all relevant properties. Halfway through working on this my computer was force updated, and the drivers became out of date for the windows version. The workaround while I look for updated drivers is to hardcode the new baud rate, which for some reason is 115384.

Clone this wiki locally