jamod at SF

net.wimpi.modbus
Class ModbusCoupler

java.lang.Object
  extended bynet.wimpi.modbus.ModbusCoupler

public class ModbusCoupler
extends java.lang.Object

Class implemented following a Singleton pattern, to couple the slave side with a master side or with a device.

At the moment it only provides a reference to the OO model of the process image.

Version:
1.2rc1 (09/11/2004)
Author:
Dieter Wimberger

Method Summary
 ProcessImage getProcessImage()
          Returns a reference to the ProcessImage of this ModbusCoupler.
 ProcessImageFactory getProcessImageFactory()
          Returns the actual ProcessImageFactory instance.
static ModbusCoupler getReference()
          Returns a reference to the singleton instance.
 int getUnitID()
          Returns the identifier of this unit.
 boolean isMaster()
          Tests if this instance is a master device.
 boolean isSlave()
          Tests if this instance is not a master device.
 void setMaster(boolean master)
          Sets this instance to be or not to be a master device.
 void setProcessImage(ProcessImage procimg)
          Sets the reference to the ProcessImage of this ModbusCoupler.
 void setProcessImageFactory(ProcessImageFactory factory)
          Sets the ProcessImageFactory instance.
 void setUnitID(int id)
          Sets the identifier of this unit, which is needed to be determined in a serial network.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProcessImageFactory

public ProcessImageFactory getProcessImageFactory()
Returns the actual ProcessImageFactory instance.

Returns:
a ProcessImageFactory instance.

setProcessImageFactory

public void setProcessImageFactory(ProcessImageFactory factory)
Sets the ProcessImageFactory instance.

Parameters:
factory - the instance to be used for creating process image instances.

getProcessImage

public ProcessImage getProcessImage()
Returns a reference to the ProcessImage of this ModbusCoupler.

Returns:
the ProcessImage.

setProcessImage

public void setProcessImage(ProcessImage procimg)
Sets the reference to the ProcessImage of this ModbusCoupler.

Parameters:
procimg - the ProcessImage to be set.

getUnitID

public int getUnitID()
Returns the identifier of this unit. This identifier is required to be set for serial protocol slave implementations.

Returns:
the unit identifier as int.

setUnitID

public void setUnitID(int id)
Sets the identifier of this unit, which is needed to be determined in a serial network.

Parameters:
id - the new unit identifier as int.

isMaster

public boolean isMaster()
Tests if this instance is a master device.

Returns:
true if master, false otherwise.

isSlave

public boolean isSlave()
Tests if this instance is not a master device.

Returns:
true if slave, false otherwise.

setMaster

public void setMaster(boolean master)
Sets this instance to be or not to be a master device.

Parameters:
master - true if master device, false otherwise.

getReference

public static final ModbusCoupler getReference()
Returns a reference to the singleton instance.

Returns:
the ModbusCoupler instance reference.

jamod at SF

Copyright © 2002-2004 jamod development team.