Package gda.device
Interface DigitalIO
- All Superinterfaces:
Configurable,Device,Findable,gda.observable.IObservable
An interface for a distributed Digital I/O class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final inthigh state is assumed to be TTL high of >= 2.2Vstatic final intLow state is assumed to be TTL of 0-0.8V. -
Method Summary
Modifier and TypeMethodDescriptionintGet the current delay time after edge sync operationsintGet the current logic state for the specified channelintGet the current timeout for 2 line sync operationsvoidsetEdgeSyncDelayTime(int msecs) Set the required delay after edge sync operationsvoidsetNegative2LineSync(String inputChannelName, String outputChannelName) Carries out a 2 line handshake with an external device which obeys the protocol rules.voidsetNegativeEdgeSync(String channelName) Carries out a negative edge sync operation by intialising the state to high (just in case it's low from a previous operation), then setting a low state.voidsetPositive2LineSync(String inputChannelName, String outputChannelName) Carries out a 2 line handshake with an external device which obeys the protocol rules.voidsetPositiveEdgeSync(String channelName) Carries out a positive edge sync operation by intialising the state to low (just in case it's high from a previous operation), then setting a high state.voidSet the current logic state for the specified channelvoidsetTwoLineSyncTimeout(int msecs) Set the required timeout for 2 line sync operationsMethods inherited from interface gda.factory.Configurable
configure, isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Field Details
-
HIGH_STATE
static final int HIGH_STATEhigh state is assumed to be TTL high of >= 2.2V- See Also:
-
LOW_STATE
static final int LOW_STATELow state is assumed to be TTL of 0-0.8V.- See Also:
-
-
Method Details
-
getState
Get the current logic state for the specified channel- Parameters:
channelName- i/o channel name to read- Returns:
- current TTL line state
- Throws:
DeviceException
-
setState
Set the current logic state for the specified channel- Parameters:
channelName- i/o channel name to write tostate- TTL line state : 0=low and any other value=high- Throws:
DeviceException
-
setNegativeEdgeSync
Carries out a negative edge sync operation by intialising the state to high (just in case it's low from a previous operation), then setting a low state. Finally a return is made to the resting high state after a delay period accessed by the methods getEdgeSyncDelayTime() and setEdgeSyncDelayTime() in msecs. Thus it's possible to use this also as a negative level sync.- Parameters:
channelName- i/o channel name to write to- Throws:
DeviceException
-
setPositiveEdgeSync
Carries out a positive edge sync operation by intialising the state to low (just in case it's high from a previous operation), then setting a high state. Finally a return is made to the resting low state after a delay period accessed by the methods getEdgeSyncDelayTime() and setEdgeSyncDelayTime() in msecs. Thus it's possible to use this also as a positive level sync.- Parameters:
channelName- i/o channel name to write to- Throws:
DeviceException
-
setNegative2LineSync
Carries out a 2 line handshake with an external device which obeys the protocol rules. The handshake is safe as both devices wait for each other using a read input line and set a state on a write output line. Very useful for integrating decoupled subsystems. This device waits for the input line to go high indicating the external device is idle and can be triggered. Then the external device is triggered with a low output state. The input line then waits for a low state to show the external device has received the trigger and is busy. The input line then waits for a high state to show the external device has finished its actions and is idle again (i.e. back to the pre-trigger state again). A timeout can be specified by the methods get2LineSyncTimeout() and set2LineSyncTimeout() in msecs.- Parameters:
inputChannelName- i/o channel name to read input line stateoutputChannelName- i/o channel name to write output line state- Throws:
DeviceException
-
setPositive2LineSync
Carries out a 2 line handshake with an external device which obeys the protocol rules. The handshake is safe as both devices wait for each other using a read input line and set a state on a write output line. Very useful for integrating decoupled subsystems. This device waits for the input line to go low indicating the external device is idle and can be triggered. Then the external device is triggered with a high output state. The input line then waits for a high state to show the external device has received the trigger and is busy. The input line then waits for a low state to show the external device has finished its actions and is idle again (i.e. back to the pre-trigger state again). A timeout can be specified by the methods get2LineSyncTimeout() and set2LineSyncTimeout() in msecs.- Parameters:
inputChannelName- i/o channel name to read input line stateoutputChannelName- i/o channel name to write output line state- Throws:
DeviceException
-
getTwoLineSyncTimeout
Get the current timeout for 2 line sync operations- Returns:
- current 2 line sync timeout in msecs
- Throws:
DeviceException
-
setTwoLineSyncTimeout
Set the required timeout for 2 line sync operations- Parameters:
msecs- 2 line sync timeout in msecs- Throws:
DeviceException
-
getEdgeSyncDelayTime
Get the current delay time after edge sync operations- Returns:
- the current edge sync delay time in msecs
- Throws:
DeviceException
-
setEdgeSyncDelayTime
Set the required delay after edge sync operations- Parameters:
msecs- 2 line sync timeout in msecs- Throws:
DeviceException
-