www.rkjava.de

de.rkjava.serial.rk512
Interface S7Model

All Superinterfaces:
de.rkjava.serial.util.S7Model
All Known Implementing Classes:
DefaultS7Model

public interface S7Model
extends de.rkjava.serial.util.S7Model

When DefaultS7Model is not complete for your whishes, you can implement this interface by your self

Author:
Gerd Limbeck, www.rkjava.de

Method Summary
 void addS7DataListener(S7DataListener listener)
          Adds a S7DataListener
 int getAmmountBytes()
          Returns the ammount of the databytes
 byte[] getBytes()
          Returns the databytes
 int getCpuNo()
          Returns the Cpu-No
 int getDbNo()
          Returns the Number of the datablock
 int getFirstByteNo()
          Returns the Number of the first databyte in the datablock
 void removeS7DataListener(S7DataListener listener)
          Removes a S7DataListener
 void setBytes(byte[] data)
          Sets new databytes
Attention: It must be valid: data.length = getAmmountbytes()
 void setNewStructure(int cpuNo, int dbNo, int firstByteNo, int ammountBytes, byte[] data)
          Sets a new structure together with new databytes.
 
Methods inherited from interface de.rkjava.serial.util.S7Model
addS7DataListener, removeS7DataListener
 

Method Detail

addS7DataListener

public void addS7DataListener(S7DataListener listener)
Adds a S7DataListener

Parameters:
listener - a S7DataListener

removeS7DataListener

public void removeS7DataListener(S7DataListener listener)
Removes a S7DataListener

Parameters:
listener - a S7DataListener

getCpuNo

public int getCpuNo()
Returns the Cpu-No

Specified by:
getCpuNo in interface de.rkjava.serial.util.S7Model
Returns:
Cpu-No

getDbNo

public int getDbNo()
Returns the Number of the datablock

Specified by:
getDbNo in interface de.rkjava.serial.util.S7Model
Returns:
number of the datablock

getFirstByteNo

public int getFirstByteNo()
Returns the Number of the first databyte in the datablock

Specified by:
getFirstByteNo in interface de.rkjava.serial.util.S7Model
Returns:
number of the first databyte

getAmmountBytes

public int getAmmountBytes()
Returns the ammount of the databytes

Specified by:
getAmmountBytes in interface de.rkjava.serial.util.S7Model
Returns:
ammount of the databytes

getBytes

public byte[] getBytes()
Returns the databytes

Specified by:
getBytes in interface de.rkjava.serial.util.S7Model
Returns:
databytes

setNewStructure

public void setNewStructure(int cpuNo,
                            int dbNo,
                            int firstByteNo,
                            int ammountBytes,
                            byte[] data)
Sets a new structure together with new databytes.
Every registered S7DataListener will be informed via s7StructureChanged()

Specified by:
setNewStructure in interface de.rkjava.serial.util.S7Model
Parameters:
cpuNo - new CPU-No
dbNo - new Number of the datablock
firstByteNo - new Number of the first databyte
ammountBytes - new ammount of the databytes
data - new databytes
See Also:
S7DataListener.s7StructureChanged(EventObject)

setBytes

public void setBytes(byte[] data)
Sets new databytes
Attention: It must be valid: data.length = getAmmountbytes()

Specified by:
setBytes in interface de.rkjava.serial.util.S7Model
Parameters:
data - new databytes

www.rkjava.de