Package io.openems.edge.wago
Class Wago
- java.lang.Object
-
- All Implemented Interfaces:
ModbusComponent
,OpenemsComponent
,DigitalInput
,DigitalOutput
public class Wago extends AbstractOpenemsModbusComponent implements DigitalOutput, DigitalInput, ModbusComponent, OpenemsComponent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Wago.ThisChannelId
-
Nested classes/interfaces inherited from class io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
AbstractOpenemsModbusComponent.BitConverter, AbstractOpenemsModbusComponent.ChannelMapper<T extends AbstractModbusElement<?>>
-
Nested classes/interfaces inherited from interface io.openems.edge.io.api.DigitalInput
DigitalInput.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.io.api.DigitalOutput
DigitalOutput.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.bridge.modbus.api.ModbusComponent
ModbusComponent.ChannelId
-
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
-
Field Summary
Fields Modifier and Type Field Description protected org.osgi.service.cm.ConfigurationAdmin
cm
protected ModbusProtocol
protocol
-
Constructor Summary
Constructors Constructor Description Wago()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BooleanReadChannel
addChannel(FieldbusChannelId channelId)
protected CoilElement
createModbusCoilElement(ChannelId channelId, int address)
Creates a ModbusCoilElement
on the address and maps it to the given Channel-ID.protected void
createProtocolFromModules(java.util.List<FieldbusModule> modules)
Takes a list of FieldbusModules and adds Modbus tasks to the protocol.protected void
deactivate()
Handles @Deactivate of implementations.java.lang.String
debugLog()
Gets some output that is suitable for a continuous Debug log.protected ModbusProtocol
defineModbusProtocol()
Defines the Modbus protocol.BooleanReadChannel[]
digitalInputChannels()
Gets all Output Channels.BooleanWriteChannel[]
digitalOutputChannels()
Gets all Output Channels.protected java.util.List<FieldbusModule>
parseXml(org.w3c.dom.Document doc)
Parses the config xml file.protected static org.w3c.dom.Document
parseXmlToDocument(java.io.InputStream is)
protected void
setModbus(BridgeModbusTcp modbus)
-
Methods inherited from class io.openems.edge.bridge.modbus.api.AbstractOpenemsModbusComponent
activate, activate, activate, getBridgeModbus, getModbusProtocol, getUnitId, m, m, m, m, m, m, modified, modified, setModbus, unsetModbus
-
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logDebug, logError, logInfo, logWarn, removeChannel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.openems.edge.bridge.modbus.api.ModbusComponent
_setModbusCommunicationFailed, getModbusCommunicationFailed, getModbusCommunicationFailedChannel
-
Methods inherited from interface io.openems.edge.common.component.OpenemsComponent
_channel, _getChannelAs, alias, channel, channel, channels, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid
-
-
-
-
Field Detail
-
cm
protected org.osgi.service.cm.ConfigurationAdmin cm
-
protocol
protected ModbusProtocol protocol
-
-
Method Detail
-
setModbus
protected void setModbus(BridgeModbusTcp modbus)
-
parseXmlToDocument
protected static org.w3c.dom.Document parseXmlToDocument(java.io.InputStream is) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
- Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
-
parseXml
protected java.util.List<FieldbusModule> parseXml(org.w3c.dom.Document doc)
Parses the config xml file.- Parameters:
doc
- the XML document- Returns:
- a list of FieldbusModules
-
createProtocolFromModules
protected void createProtocolFromModules(java.util.List<FieldbusModule> modules) throws OpenemsException
Takes a list of FieldbusModules and adds Modbus tasks to the protocol.- Parameters:
modules
- lit ofFieldbusModule
s- Throws:
OpenemsException
- on error
-
createModbusCoilElement
protected CoilElement createModbusCoilElement(ChannelId channelId, int address)
Creates a ModbusCoilElement
on the address and maps it to the given Channel-ID.- Parameters:
channelId
- the Channel-IDaddress
- the modbus start address of the coil- Returns:
- the modbus
CoilElement
-
defineModbusProtocol
protected ModbusProtocol defineModbusProtocol() throws OpenemsException
Description copied from class:AbstractOpenemsModbusComponent
Defines the Modbus protocol.- Specified by:
defineModbusProtocol
in classAbstractOpenemsModbusComponent
- Returns:
- the ModbusProtocol
- Throws:
OpenemsException
- on error
-
deactivate
protected void deactivate()
Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractOpenemsModbusComponent
-
debugLog
public java.lang.String debugLog()
Description copied from interface:OpenemsComponent
Gets some output that is suitable for a continuous Debug log. Returns 'null' by default which causes no output.- Specified by:
debugLog
in interfaceOpenemsComponent
- Returns:
- the debug log output
-
digitalInputChannels
public BooleanReadChannel[] digitalInputChannels()
Description copied from interface:DigitalInput
Gets all Output Channels.- Specified by:
digitalInputChannels
in interfaceDigitalInput
- Returns:
- array of
BooleanReadChannel
-
digitalOutputChannels
public BooleanWriteChannel[] digitalOutputChannels()
Description copied from interface:DigitalOutput
Gets all Output Channels.- Specified by:
digitalOutputChannels
in interfaceDigitalOutput
- Returns:
- an array of Channels
-
addChannel
protected BooleanReadChannel addChannel(FieldbusChannelId channelId)
-
-