-
- All Implemented Interfaces:
-
se.cpacsystems.communication.MachineData
public class MachineDataHydraFileCfgAdapter implements MachineData
-
-
Constructor Summary
Constructors Constructor Description MachineDataHydraFileCfgAdapter(CanManager canManager)
-
Method Summary
Modifier and Type Method Description MachineSignalreadSignal(int signalId)Returns a signal in a MachineData object. booleanwriteSignal(int signalId, double value)Writes signal as defined in the GSL specification. Array<byte>readRawSignal(int signalId)Returns a raw signal in a byte[]. booleanwriteRawSignal(int signalId, Array<byte> value)Writes signal as defined in the GSL specification. GflHandlerregisterFrame(CanBus canBus, int frameId, boolean extended, byte maxQueueSize)Register the intent to receive can messages with the specified address.Throws SecurityException if caller don't holdsse.cpacsystems.permission. booleanwriteFrame(CanBus canBus, int frameId, boolean extended, Array<byte> data)Write a can messages on the specified can-bus with the specified address.Throws SecurityException if caller don't holdsse.cpacsystems.permission. -
-
Method Detail
-
readSignal
@NonNull() MachineSignal readSignal(int signalId)
Returns a signal in a MachineData object. The signal must be defined in the GSL interface.The signal value in the MachineData object is scaled according to the GLS specification.
This method always returns immediately, whether or not the signal has been received.
- Parameters:
signalId- the signal to read
-
writeSignal
boolean writeSignal(int signalId, double value)
Writes signal as defined in the GSL specification.
The GSL interface specifies the signal attributes such as bit length, factor and offset.The attributes are used to convert the signal to the CAN bus representation.
Special case: Signal with a bitLength=64 is used to write complete CAN frame, where nofactor nor offset is applied to the data, i.e. the signal/frame is written as provided.
- Parameters:
signalId- the signal idvalue- the signal data to write
-
readRawSignal
@NonNull() Array<byte> readRawSignal(int signalId)
Returns a raw signal in a byte[]. The signal must be defined in the GSL interface.No processing is done. The signal data is returned as received in the correspondingcan frame.
This method always returns immediately, whether or not the signal has been received.If no current data is available an empty (size 0) array is returned.
- Parameters:
signalId- the signal to read
-
writeRawSignal
boolean writeRawSignal(int signalId, Array<byte> value)
Writes signal as defined in the GSL specification.
The GSL interface specifies the signal.
Where is no factor nor offset applied to the data, i.e. the corresponding bits in thesignal/frame is written as provided.
- Parameters:
signalId- the signal idvalue- the signal data to write
-
registerFrame
GflHandler registerFrame(CanBus canBus, int frameId, boolean extended, byte maxQueueSize)
Register the intent to receive can messages with the specified address.Throws SecurityException if caller don't holdsse.cpacsystems.permission.READ_MACHINE_SIGNAL
- Parameters:
canBus- The bus (CAN4,CAN5,CAN6) to receive messages onframeId- The address of messages to receiveextended- True for extended addressing and false for standardmaxQueueSize- The maximum number of messages to save
-
writeFrame
boolean writeFrame(CanBus canBus, int frameId, boolean extended, Array<byte> data)
Write a can messages on the specified can-bus with the specified address.Throws SecurityException if caller don't holdsse.cpacsystems.permission.WRITE_MACHINE_SIGNAL
- Parameters:
canBus- The bus (CAN4,CAN5,CAN6) to receive messages onframeId- The address of messages to receiveextended- True for extended addressing and false for standarddata- Data to transmit
-
-
-
-