public class KeyenceG5001
extends org.lsst.ccs.drivers.ascii.Ascii
Ascii class are available in addition to the methods defined here.org.lsst.ccs.drivers.ascii.Ascii.DataBits, org.lsst.ccs.drivers.ascii.Ascii.FlowCtrl, org.lsst.ccs.drivers.ascii.Ascii.Option, org.lsst.ccs.drivers.ascii.Ascii.Parity, org.lsst.ccs.drivers.ascii.Ascii.StopBits, org.lsst.ccs.drivers.ascii.Ascii.Terminator| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BAUD |
static String |
DEFAULT_DEV |
| Constructor and Description |
|---|
KeyenceG5001()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
commmode()
Sets communications mode.
|
void |
genmode()
Sets general mode.
|
int |
getmeasmode(int ikey)
Gets the measurement mode for a sensor.
|
int |
getmindispunit(int ikey)
Gets minimum display units for a sensor.
|
int |
getnsamps()
Gets the number of samples to be averaged.
|
void |
laser(boolean laserstate)
Sets the KeyenceG5001 laser state by switching to general mode (lasers on) or comm mode (off).
|
void |
open(org.lsst.ccs.drivers.commons.DriverConstants.ConnType type,
String ident,
int baud,
int dChar)
Opens a connection to the device; device state is unchanged.
|
double[] |
readDistance()
Gets the KeyenceG5001 measurement for all heads.
|
double |
readDistance(int ikey)
Gets the KeyenceG5001 measurement for a head.
|
String |
readKey(String command)
Like
writeKey(java.lang.String) but returns the response stripped of the
the echoed command and comma at the beginning. |
void |
setmeasmode(int ikey,
int mode)
Sets the measurement mode for a sensor.
|
void |
setmindispunit(int dspu)
Sets minimum display units for both sensors.
|
void |
setmindispunit(int ikey,
int dspu)
Sets the minimum display units for a sensor, that is, the unit of measure and the precision
displayed for that unit.
|
void |
setnsamps(int cycle)
Sets the number of samples to be averaged (as implied by cycle time).
|
void |
writeKey(String command)
Writes a command, reads the response and checks whether it's an error response.
|
close, closeSilent, flush, getConnTimeout, getTimeout, isDropEcho, isOpen, makeDataCharacteristics, open, open, openFtdi, openFtdi, openFtdi, openNet, openNet, openSerial, openSerial, openSerial, read, read, readBytes, readBytes, setCommandTerm, setConnTimeout, setConnTimeout, setDefaultBaud, setDefaultParm, setDefaultPort, setMultidrop, setOptions, setResponseTerm, setTerminator, setTimeout, setTimeout, write, writeBytes, writeBytespublic static final int DEFAULT_BAUD
public static final String DEFAULT_DEV
public KeyenceG5001()
public void open(org.lsst.ccs.drivers.commons.DriverConstants.ConnType type,
String ident,
int baud,
int dChar)
throws org.lsst.ccs.drivers.commons.DriverException
open in class org.lsst.ccs.drivers.ascii.Asciitype - The enumerated type of connection to makeident - The device identifierbaud - The baud rate: use 0 for the default of 38400.dChar - The encoded data characteristics: always set to 0org.lsst.ccs.drivers.commons.DriverException - upon I/O error.public void laser(boolean laserstate)
throws org.lsst.ccs.drivers.commons.DriverException
laserstate - Whether laser is turned onorg.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public void commmode()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public void genmode()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public void setnsamps(int cycle)
throws org.lsst.ccs.drivers.commons.DriverException
cycle - Cycle time: 0: 2.55 us, 1: 5 us, 2: 10 us, 3: 20 us,
4: 50 us, 5: 100 us, 6:200 us, 7: 500 us, 8: 1000 usorg.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public int getnsamps()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public void setmeasmode(int ikey,
int mode)
throws org.lsst.ccs.drivers.commons.DriverException
ikey - The sensor numbermode - The mode: 0: Normal, 1: Translucent object, 2: Transparent object,
3: Transparent object 2, 4: Semi opaqueorg.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public int getmeasmode(int ikey)
throws org.lsst.ccs.drivers.commons.DriverException
ikey - The sensor numberorg.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public void setmindispunit(int ikey,
int dspu)
throws org.lsst.ccs.drivers.commons.DriverException
ikey - The sensor numberdspu - The units: 0: 0.01 mm, 1: 0.001 mm, 2: 0.0001 mm,
3: 0.00001 mm, 4: 0.1 um, 5: 0.01 um, 6: 0.001 umorg.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public int getmindispunit(int ikey)
throws org.lsst.ccs.drivers.commons.DriverException
ikey - The sensor numberorg.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.setmindispunit(int, int)public void setmindispunit(int dspu)
throws org.lsst.ccs.drivers.commons.DriverException
dspu - The display units.org.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.setmindispunit(int, int)public double readDistance(int ikey)
throws org.lsst.ccs.drivers.commons.DriverException
ikey - The head numberorg.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public double[] readDistance()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public void writeKey(String command) throws org.lsst.ccs.drivers.commons.DriverException
command - The command to write.org.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.public String readKey(String command) throws org.lsst.ccs.drivers.commons.DriverException
writeKey(java.lang.String) but returns the response stripped of the
the echoed command and comma at the beginning.command - The command to write.org.lsst.ccs.drivers.commons.DriverException - on I/O error or an error response from the device.Copyright © 2023 LSST. All rights reserved.