The serial devices.
Status:
This documentation applies to version 1.1.4.8 of the serial devices.
Contents:

The SerialPortDigitalInOutTimer device
(CSerialPortDigitalInOutCalcTimerDevice, Based on CSerialPortCalcDevice)
CSerialPortDigitalInOutTimerDevice
Overview:
080307: The CCSerialPortDigitalInOutTimerDevice is under development. It is however using poll to read the inputs.
The CSerialPortDigitalInOutTimerDevice is started as a complete copy of CSerialPortDigitalInOutDevice, and (today) include all of the functionality of this (i.e. it is an extension of CSerialPortDigitalInOutDevice). The CSerialPortDigitalInOutTimerDevice is made so it can replace a CSerialPortDigitalInOutDevice.
The CSerialPortDigitalInOutTimerDevice has besides the control of RTS and DTR and status of the 4 serial control input pins. The additional posibility to use the RTS/CTS and the DTR/DSR pairs as timers (i.e. measure the time since the input last went high). When the input goes high the time is zeroed and the output is set low for one poll time. The idea is that external a flip-flop is triggered by a (short) trigger pulse. The flip-flop output goes high, which is sensed by CTS (or DSR). Time is zeroed, and RTS (or DTR) is set low for one poll time.
CSerialPortDigitalInOutTimerDevice parameters:
For address definition the device uses AddTypeId number 9 (Onedim addressing) which uses a0 to determine the parameter number.
parameter |
Suggested |
Parameter name |
Data type |
Interpretation |
Comment |
0 |
enable | Bit (W) | Enable device. When disabled, the serial port is disconnected | ||
1 |
errNo | Error number | Word (R) | Word. | A zero indicated all is OK, and anything else that something is wrong. |
2 | errStr | Error String | String (R) | String. | Text string with error. |
3 |
lstErr | String (R) | String. | ||
4 |
RTS | RTS | Bit (W) | RTS output pin 7 (DB9) | |
5 |
DTR | DTR | Bit (W) | DTR output pin 4 (DB9) | |
6 |
wIn | Word | All the bits from Serial Port Modem Status | ||
7 | CTS | CTS | Bit (R) | CTS input pin 8 (DB9) | |
8 | DSR | DSR | Bit (R) | DSR input pin 6 (DB9) | |
9 | RI | RI | Bit (R) | RI input pin 9 (DB9) | |
10 | DCD | DCD | Bit (R) | DCD input pin 1 (DB9) | |
11 | RTStimerOn | RTStimerOn | Bit (W) |
Makes the RTS/CTS pair acts as a timer. Default value is off (false) |
|
12 | RTStimer | RTStimer | Float (R) | The time in seconds since the CTS last went high | |
13 | RTSlastTime |
RTSlastTime
|
Float (R) | The value of the RTStimer when it was last reset | |
14 | RTScount | RTScount | Float (R) | Counter for RTS/CTS pulses | |
15 | RTScReset | RTScReset | Bit (W) | Reset of the RTS/CTS counter | |
16 | DTRtimerOn | DTRtimerOn | Bit (W) |
Makes the DTR/DSR pair acts as a timer. Default value is off (false) |
|
17 | DTRtimer | DTRtimer | Float (R) | The time in seconds since the DSR last went high | |
18 | DTRlastTime |
DTRlastTime
|
Float (R) | The value of the DTRtimer when it was last reset | |
19 | DTRcount | DTRcount | Float (R) | Counter for DTR/DSR pulses | |
20 | DTRcReset | DTRcReset | Bit (W) | Reset of the DTR/DSR counter | |
In a DB9 serial port signal ground (GND) is pin 5.
The outputs are at ~+12V when high, and at ~-12 when low.
The inputs are high when the voltage is above ~2.5 V, and low when the voltage
is below ~0.7 V.
The inputs are compatable with TTL, except that that unconnected inputs are low.
Using a Poll Rate of 10 ms, we achieve an accuracy of +-16 ms typical (have not seen any outside that span looking at more than 10 minutes)
CSerialPortDigitalInOutTimerDevice configuration:
The following parameters are stored in the .config file at the front-end computer on which the device is loaded:
- COM-Port: The serial port number.
- Poll rate: How often the device reads the inputs (default 50 ms).
The SerialPortDigitalInOut device
(CSerialPortDigitalInOutCalcDevice, Based on CSerialPortCalcDevice)
CSerialPortDigitalInOutDevice
Overview:
050805: The CCSerialPortDigitalInOutDevice is ready and working. It is however using poll to read the inputs.
CSerialPortDigitalInOutDevice parameters:
For address definition the device uses AddTypeId number 9 (Onedim addressing) which uses a0 to determine the parameter number.
parameter number (a0) |
Suggested Surname |
Parameter name | Data type | Interpretation | Comment |
0 | enable | Bit (W) | Enable device. When disabled, the serial port is disconnected | ||
1 | errNo | Error number | Word (R) | Word. | A zero indicated all is OK, and anything else that something is wrong. |
2 | errStr | Error String | String (R) | String. | Text string with error. |
3 | lstErr | String (R) | String. | ||
4 | RTS | RTS | Bit (W) | RTS output pin 7 (DB9) | |
5 | DTR | DTR | Bit (W) | DTR output pin 4 (DB9) | |
6 | wIn | Word | All the bits from Serial Port Modem Status | ||
7 | CTS | CTS | Bit (R) | CTS input pin 8 (DB9) | |
8 | DSR | DSR | Bit (R) | DSR input pin 6 (DB9) | |
9 | RI | RI | Bit (R) | RI input pin 9 (DB9) | |
10 | DCD | DCD | Bit (R) | DCD input pin 1 (DB9) | |
In a DB9 serial port signal ground (GND) is pin 5.
The outputs are at ~+12V when high, and at ~-12 when low.
The inputs are high when the voltage is above ~2.5 V, and low when the voltage
is below ~0.7 V.
The inputs are compatable with TTL, except that that unconnected inputs are low.
CSerialPortDigitalInOutDevice configuration:
The following parameters are stored in the .config file at the front-end computer on which the device is loaded:
- COM-Port: The serial port number.
- Poll rate: How often the device reads the inputs (default 50 ms).
The Keithley6514 device
(CKeithley6514CalcDevice, Based on CCalcDevice)
Keithley6514
Overview:
031205: Converting from old CKeithley6514Device, based on CSimpleDevice.
Keithley6514
Device parameters:
For address definition the device uses AddTypeId number 9 (Onedim addressing) which uses a0 to determine the parameter number.
parameter |
Suggested |
Parameter name |
Data type |
Interpretation |
Comment |
0 |
data | Measurement Data | Float (R) | Bipolar Float | The measured data (current, voltage, ..) in Ampere, Volt, ... |
1 |
scale | Scale setting | Word (W) | id 269 (Keithley scale radio) |
0: Auto: Keithley auto scaling 1: Auto Slow: Only change down if reading < 0.001 of scale 2: Auto Up: only scale up 3: 2e-11: Fixed manual Scale 4: 2e-10: " ... |
2* | configure | Instrument configuration | Word (W) | Selecting between Current, Voltage, Resistance, and Charge measurement | |
3* |
enable | Bit (W) | Enable device. When disabled, no communication is made with the hardware | ||
4 |
reset |
Resets the device and the instrument |
(pulsed control bit) (W) |
Bit, checkbox, push bottom (no 572). |
Writing a one to this parameter will reset the device, the serial connection, and the instrument. This should not be necessary very often, and should properly be a restricted parameter. |
5 |
error |
Error number |
Word (R) |
Word. |
A zero indicated all is OK, and anything else that something is wrong. |
6 |
errStr |
Error String |
String (R) |
String. |
Text string with error. |
7* | trigMode | Control Bit (W) | Selecting Continues or Triggered measurement | ||
8* | trig | Push button (W) | Trigger one measurement | ||
9* | busy | bit (R) | Indicating measurement in progress | ||
10* | rate | Measurement integration time (Number of Power Line Cycles) | Word (W) | 0: slow, 1: medium, 3: fast, 4: custom | |
11* | NPLC | Number of Power Line Cycles | Double?? (W) | Works together with the rate parameter (for custom selections) | |
12* | averaging | Word (W) | 0: None, 1: Running, 2: Repeating | ||
13* | AvCount | Number of measurements to average | Word (W) | ||
|
|||||
|
* is indicating a new parameter compared with the old Keithley device
Keithley6514
Device configuration:
The following parameters are stored in the .config file at the front-end computer on which the device is loaded:
- COM-Port: The serial port number.
- Baud-rate: The baud-rate used to communicated with the controller (the default of device is 19200 - INSURE that the Keithley is configured for the same as the device - default of the Keithley is 9600).
Keithley6514 configuration:
The Keithley need to (manually) be configured as follows
- Set to serial (RS-232) communication
- Data and Stop Bits: 8 bit (default)
- Parity: None (default)
- Terminator: CR (default)
- Flow control: None (default)
The cable needs to be a straight through (DB9 female to DB9 male). Need only Tx, Rx, and GND.
The old Keithley6514 device
(CKeithley6514Device, Based on CSimpleDevice)
old Keithley6514
Overview:
230501: Device working in first very simple version.
old Keithley6514
Device parameters:
For address definition the device uses AddTypeId number 9 (Onedim addressing) which uses a0 to determine the parameter number.
parameter |
Suggested |
Parameter name |
Data type |
Interpretation |
Comment |
0 |
data | Current Data | Float | Bipolar Float | The measured current in Ampere |
1 |
|||||
2 | |||||
3 |
|||||
4 |
reset |
Resets the device and the instrument |
(pulsed control bit) |
Bit, checkbox, push bottom (no 572). |
Writing a one to this parameter will reset the device, the serial connection, and the instrument. This should not be necessary very often, and should properly be a restricted parameter. |
5 |
error |
Error number |
Word |
Word. |
A zero indicated all is OK, and anything else that something is wrong. |
6 |
errStr |
Error String |
String |
String. |
Text string with error. |
|
|||||
|
old Keithley6514
Device configuration:
The following parameters are stored in the .config file at the front-end computer on which the device is loaded:
- COM-Port: The serial port number.
- Baud-rate: The baud-rate used to communicated with the controller (the default of device is 19200 - INSURE that the Keithley is configured for the same as the device - default of the Keithley is 9600).
old Keithley6514 configuration:
The Keithley need to (manually) be configured as follows
- Set to serial (RS-232) communication
- Data and Stop Bits: 8 bit (default)
- Parity: None (default)
- Terminator: CR (default)
- Flow control: None (default)
The SMC_Scraper device
Overview:
This device will control a SMC Series Stepping Motor Controller from Thermionics Northwest, inc. which is the scrapers presently used at ASTRID. The present device controls only the simple scrapers without encoder read back. The scrapers are therefore calibrated by running the scrapers completely out and assigning a reference value for that position. This reference value can be changed at any time, though a ConSys Client.
Device parameters:
For address definition the device uses AddTypeId number 6 (Motor addressing) which uses a0 to determine which motor is addressed and a1 to give the parameter number.
Generel parameters (a0=0):
parameter |
Suggested |
Parameter name |
Data type |
Interpretation |
Comment |
0 |
reset |
Resets the controller |
Bit (control) |
Bit, checkbox |
Writing a one to this parameter will reset the controller. This should not be nessarary very often, and should properly be a restricted parameter. |
1 |
ok |
Overall status |
Bit (status) |
Bit, Concat. String (nr 522) |
A zero indicated all is OK, and a one that something is wrong. |
2 |
comm |
Communication status |
Bit (status) |
Bit, Concat. String (nr 522) |
A zero indicates that the communication is OK, and a one that the communication is not OK (i.e. probably the cable is not connected proper.) |
3 |
statStr |
Status String |
String |
String |
Gives the status of the device in words. |
Parameters for each motor (a0='motor nr'):
parameter |
Suggested SirName |
Parameter name |
Data type |
Interpretation |
Comment |
0 |
dac |
set position |
Float |
Bipolar Float (nr 140) |
Writing a value to this parameter initiates a movement of the scraper. |
1 |
adc |
Read back position |
Float (status) |
Bipolar Float (nr 140) |
Continuously read back of the position of the scraper (also during movement) |
2 |
refval |
Reference value |
Float (control) |
Bipolar Float (nr 140) |
Determines the value of the position at the reference point (i.e. when the scraper is completely out) |
3 |
refmov |
Reference movement |
Bit |
Bit, check box (nr 577) |
Initiates a calibration of the scraper. The scraper is moved completely in and the position is assigned the reference value. This procedure will give an uncertainty of up to one revolution (0.9 mm), because of the overrun of the thread. To achieve a better accuracy perform a manual calibration as described under setref. |
4 |
mov |
Moving |
Bit (status) |
Bit, Concat. String (nr 578) |
A one indicates that the scraper is moving, and a zero that the scraper is not moving. |
5 |
cal |
Calibration |
Bit |
Bit, Concat. String (nr 579) |
A one indicated that the scraper position is calibrated, and a zero indicates that the scraper is not calibrated. Note that is not possible to guarantee a calibration is valid, as the scraper can be moved manually and there is no way to detect this. |
6 |
setref |
Set reference position |
Bit (control) |
Pulse bit |
Sets the position to the reference position. Can be used after a manual fine trim of the reference position to get the best accuracy for the reference position. Fine trim is done by manually turning the scraper until the click. (Used a refmov first to get all the way in.) |
Device configuration:
The following parameters are stored in registry at the frontend computer on which the device is loaded:
- COM-Port: The serial port number.
- Baud-rate: The baud-rate used to communicated with the controller (the default is 1200 to avoid to high a dataload on the frontend computer).
- Number of motors: There can be up to 6 motors on a controller.
- For each motor the scraperMax movement.
The CSMCDevice
Overview:
This device class is a base class for handling SMC stepping motors. The class provides a common interface, and programming environment for device implementation. Do not use this device directly. Use child devices. As all child devices will provide the same interface structure, the exported parameters from the device, as well as setup, is described for this device.
Device parameters:
For address definition the device uses AddTypeId number 6 (Motor addressing) which uses a0 to determine which motor is addressed and a1 to give the parameter number.
Generel parameters (a0=0):
parameter |
Suggested |
Parameter name |
Data type |
Interpretation |
Comment |
0 |
status |
Overall status |
Word (status) |
Word |
Status of the controller. |
1 |
text |
Overall status |
String (status) |
String |
Status of the controller, but as a text. |
2 |
motors |
Number of detected motors |
Word (status) |
Word |
Number of motors detected by the controller |
Parameters for each motor (a0='motor nr'+1):
parameter |
Suggested SirName |
Parameter name |
Data type |
Interpretation |
Comment |
0 |
pos |
set position |
Float |
Unipolar Float (nr 156) |
Writing a value to this parameter initiates a movement of the step motor. The movement is in steps. The step position definition may wary from implementation to implementation. To have a well defined position use the reading and position parameters. |
1 |
ctrl |
Read back position |
Float (status) |
Unipolar Float (nr 156) |
Continuously read back of the position of the scraper (also during movement) |
2 |
reading |
Set position in mm |
Float (control) |
Unipolar Float (nr 157) |
Writing a value to this parameter initiates a movement of the step motor. The movement is in millimeters. The definition of this parameter is that a value of zero is the position where the motor is at its full length. The motor is then retracted as the value is increased. The calibration, and operation of this parameter is the same for all child devices of CSMCDevice. |
3 |
position |
Read back position in mm |
Float |
Unipolar Float (nr 157) |
Continuously read back of the position of the scraper (also during movement). |
4 |
calibrate |
Put in calibrate mode |
Bit (control) |
Bit, check box (nr 571) |
Checking this put the step motor into calibration mode. |
5 |
calibrated |
Is calibrated |
Bit |
Bit, check box (nr 571) |
Indicates whether the motor is calibrated. |
Device configuration:

The SMC devices use a common configuration document for all devices. The document contains information about the serial port, number of motors, motor resolution, and the length of each motor.
CSMCDevice2000
Overview:
The SMC 2000 device is a child device of the CSMCDevice. This device implement the commands needed for controlling the SMC 2000 controller box.
Last Modified 04 April 2024