public class TestPD4N extends Object
| Constructor and Description |
|---|
TestPD4N()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
String |
decodeLastError()
Read decoded error type(s)
|
boolean |
isChecksumUsed()
Is checksum being used?
|
void |
loadMotionRecord(int recordNumber)
Load current record from controller's EEPROM
|
void |
move()
Start motor and move (according to current record)
|
void |
open(String ident)
Opens connection to a device.
|
void |
open(String ident,
int baudRate)
Open connection to a device with specified baud rate.
|
String |
readAll()
Read all settings and data from motor controller.
|
int |
readEncoder()
Read motor encoder position
|
String |
readFlags()
Read status (ready and position -error), error flag, limit switches
|
String |
readGeneral(NanotecPD4N.CmndGeneral quantity)
Generic read command for general quantities
|
String |
readMotion(NanotecPD4N.CmndMotion quantity)
Generic read command for motion-record quantities
|
String |
readMotionRecord()
Read all motion-record settings from motor controller
Loops over all read commands and returns them in a table format.
|
String |
readTemperature()
Read motor controller temperature, converting raw reading to degrees C
|
String |
readTempRepeat(int nRepeat)
Repeat read of motor controller temperature n times
|
void |
resetError()
Reset error flags
|
void |
saveMotionRecord(int recordNumber)
Save current motion record to controller's EEPROM
|
void |
setBaudRate(org.lsst.ccs.drivers.nanotec.NanotecPD4N.DataRate value)
Select baud rate, 110 to 1115200 (default)
For emergency use: "open" must be called with value set in
controller, then this command can change rate to desired value.
|
void |
setDebug(boolean enable)
Enable/disable debug printout from driver
|
void |
setGeneral(NanotecPD4N.CmndGeneral param,
int value)
Generic set command for a general parameter
|
void |
setLimitSwitchBehavior(boolean choice)
Set motor behavior upon reaching an external limit switch
|
void |
setMotion(NanotecPD4N.CmndMotion param,
int value)
Generic set command for a parameter in motion-record
|
String |
showLimitSwitchBehavior()
Show behavior of motor upon reaching a limit switch
|
void |
stop()
Stop motor (if currently moving), using current brake ramp value
|
void |
stopQ()
Stop motor (if currently moving), using quickstop ramp
|
String |
timestamp()
Determines current time
|
void |
useChecksum(boolean setting)
Turn on/of usage of CRC checksum
|
@Command(name="timestamp",
description="Prints current time")
public String timestamp()
@Command(name="open",
description="Open connection to device")
public void open(@Argument(name="ident",description="Identification")
String ident)
throws org.lsst.ccs.drivers.commons.DriverException
String - ident Identification (serial port name)org.lsst.ccs.drivers.commons.DriverException@Command(name="open",
description="Open connection with specified baud rate")
public void open(@Argument(name="ident",description="Identification")
String ident,
@Argument(name="baudRate",description="must match NanotecPD4N.DataRate enumeration")
int baudRate)
throws org.lsst.ccs.drivers.commons.DriverException
String - ident Identification (serial port name)int - baudRate Must match NanotecPD4N.DataRate enumerationorg.lsst.ccs.drivers.commons.DriverException@Command(name="readAll",
description="Read all controller settings and data")
public String readAll()
@Command(name="isChecksumUsed",
description="<true|false> if checksum is <in use | not in use>")
public boolean isChecksumUsed()
@Command(name="readMotionRecord",
description="Read all motion-record settings")
public String readMotionRecord()
@Command(name="readGeneral",
description="Read specified general quantity")
public String readGeneral(@Argument(name="enum quantity",description="name of general quantity")
NanotecPD4N.CmndGeneral quantity)
throws org.lsst.ccs.drivers.commons.DriverException
CmndGeneral - Enumerated command nameorg.lsst.ccs.drivers.commons.DriverException@Command(name="setGeneral",
description="set a general parameter")
public void setGeneral(@Argument(name="enum quantity",description="CmndGeneral instance")
NanotecPD4N.CmndGeneral param,
@Argument(name="value",description="value to be set")
int value)
throws org.lsst.ccs.drivers.commons.DriverException
CmndGeneral - Enumerated command nameint - value to be setorg.lsst.ccs.drivers.commons.DriverException@Command(name="setLimitSwitchBehavior",
description="select behavior when motor reaches limit switch")
public void setLimitSwitchBehavior(@Argument(name="boolean choice",description="<true|false> for <free backward motion|stop>")
boolean choice)
throws org.lsst.ccs.drivers.commons.DriverException
boolean - org.lsst.ccs.drivers.commons.DriverException@Command(name="showLimitSwitchBehavior",
description="show motor behavior upon reaching a limit switch")
public String showLimitSwitchBehavior()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="readEncoder",
description="Read motor encoder position")
public int readEncoder()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="readTemperature",
description="Read motor temperature in degrees C")
public String readTemperature()
throws org.lsst.ccs.drivers.commons.DriverException
Driver - Exceptionorg.lsst.ccs.drivers.commons.DriverException@Command(name="readTempRepeat",
description="Read motor T multiple times")
public String readTempRepeat(@Argument(name="repeats",description="number of times")
int nRepeat)
throws org.lsst.ccs.drivers.commons.DriverException
Number - of times to repeat readingorg.lsst.ccs.drivers.commons.DriverException@Command(name="readFlags",
description="Read useful status flags and error flag")
public String readFlags()
throws org.lsst.ccs.drivers.commons.DriverException
Driver - Exceptionorg.lsst.ccs.drivers.commons.DriverException@Command(name="decodeLastError",
description="Decode last error types")
public String decodeLastError()
throws org.lsst.ccs.drivers.commons.DriverException
Driver - Exceptionorg.lsst.ccs.drivers.commons.DriverException@Command(name="resetError",
description="Reset controller error flags")
public void resetError()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="readMotion",
description="Read specified motion quantity")
public String readMotion(@Argument(name="enum quantity",description="name of motion quantity")
NanotecPD4N.CmndMotion quantity)
throws org.lsst.ccs.drivers.commons.DriverException
CmndMotion - Enumerated command nameorg.lsst.ccs.drivers.commons.DriverException@Command(name="setMotion",
description="set a motion-record parameter")
public void setMotion(@Argument(name="enum quantity",description="CmndMotion instance")
NanotecPD4N.CmndMotion param,
@Argument(name="value",description="value to be set")
int value)
throws org.lsst.ccs.drivers.commons.DriverException
CmndMotion - Enumerated command nameint - value to be setorg.lsst.ccs.drivers.commons.DriverException@Command(name="saveMotionRecord",
description="save current motion record")
public void saveMotionRecord(@Argument(name="recordNumber",description="location in EEPROM (1 to 32)")
int recordNumber)
throws org.lsst.ccs.drivers.commons.DriverException
int - recordNumber (memory location, 1 to 32)org.lsst.ccs.drivers.commons.DriverException@Command(name="loadMotionRecord",
description="load motion record from EEPROM")
public void loadMotionRecord(@Argument(name="recordNumber",description="location in EEPROM (1 to 32)")
int recordNumber)
throws org.lsst.ccs.drivers.commons.DriverException
int - recordNumber (memory location, 1 to 32)org.lsst.ccs.drivers.commons.DriverException@Command(name="move",
description="Start motor and move")
public void move()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="stop",
description="stop motor, using current brake ramp")
public void stop()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="stopQuick",
description="stop motor, using quickstop ramp")
public void stopQ()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException@Command(name="setBaudRate",
description="Select baud rate")
public void setBaudRate(@Argument(name="<DataRate>",description="enumerated value, BAUD_110 to BAUD_115200 (default)")
org.lsst.ccs.drivers.nanotec.NanotecPD4N.DataRate value)
throws org.lsst.ccs.drivers.commons.DriverException
DataRate - Enumerated valueorg.lsst.ccs.drivers.commons.DriverException@Command(name="useChecksum",
description="set usage of CRC checksum")
public void useChecksum(@Argument(name="boolean setting",description="<true|false> to <use | not use>")
boolean setting)
throws org.lsst.ccs.drivers.commons.DriverException
boolean - org.lsst.ccs.drivers.commons.DriverException@Command(name="setDebug",
description="enable/disable debug printout")
public void setDebug(@Argument(name="enable",description="setting")
boolean enable)
boolean - value to setCopyright © 2023 LSST. All rights reserved.