IM Profile

com.siemens.icm.io
Class LimitPulseCounter

java.lang.Object
  extended bycom.siemens.icm.io.LimitPulseCounter

public class LimitPulseCounter
extends Object

This class supports the access and configuration to the limit pulse counter of the general purpose IO driver (GPIO).
The pulse counter is designed to measure signals from 0 to 1000 pulses per second. The pulse counter will be configured in GPIO10 pin. If the GPIO10 line is already configured in a GPIO port of input or output pins, any attempt to activate the pulse counter will be rejected. Vice versa, if the pulse counter is opened the GPIO10 line cannot be configured in a GPIO port. The usage of all GPIO ports is restricted to the same interface where the GPIO driver was opened. The paralel access of the GPIO driver by Java and another interface (i.e. AT commnad interface) is not supported.
When the module starts up, all GPIO pins are set to high-impedance state after initializing. Therefore, it is recommended to connect pull-up or pull-down resistors to all GPIO pins you want to use as output. This is necessary to keep these pins from floating or driving any external devices before all settings are done by the input port constructor and after release the input port again.


Constructor Summary
LimitPulseCounter(int limit)
          Creates a new instance of a GPIO limit pulse counter.
 
Method Summary
 void addListener(LimitPulseCounterListener listener)
          Registers listeners to receive value changes at an input port.
 void clearListener()
          Removes all listener objects which have been previously added to this input port.
 int getLimit()
          Gets the given limit of the GPIO limit pulse counter.
 void release()
          Releases the GPIO limit pulse counter.
 void removeListener(LimitPulseCounterListener listener)
          Removes a listener object which has been previously added from the internal list table of listener objects.
 void stop()
          Stops the GPIO limit pulse counter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimitPulseCounter

public LimitPulseCounter(int limit)
                  throws IOException
Creates a new instance of a GPIO limit pulse counter. The limit counter starts counting immediately.

Parameters:
limit - number of pulses to be counted.
Throws:
IOException - if creating the GPIO pulse counter instance failes
Method Detail

release

public void release()
             throws IOException
Releases the GPIO limit pulse counter.

Throws:
IOException - if releasing the GPIO pulse counter instance failes

stop

public void stop()
          throws IOException
Stops the GPIO limit pulse counter.

Throws:
IOException - if stopping the GPIO pulse counter instance failes

getLimit

public int getLimit()
             throws IOException
Gets the given limit of the GPIO limit pulse counter.

Throws:
IOException - if getting value failed

addListener

public void addListener(LimitPulseCounterListener listener)
Registers listeners to receive value changes at an input port. A maximum of 10 listeners can be added. The listener object is an implementation of InPortListener interface. Registered listener instances are stored in an internal table but are not guaranteed to be called in the order they has been registered.

Parameters:
listener - The InPortListener object to be registered.
See Also:
InPortListener, removeListener(com.siemens.icm.io.LimitPulseCounterListener), clearListener()

removeListener

public void removeListener(LimitPulseCounterListener listener)
Removes a listener object which has been previously added from the internal list table of listener objects. After it has been removed from the list it won't be called in case of changes at the input port. If it hasn't been registered before the list will remain unchanged.

Parameters:
listener - The InPortListener object to be removed from the list.
See Also:
InPortListener, addListener(com.siemens.icm.io.LimitPulseCounterListener), clearListener()

clearListener

public void clearListener()
Removes all listener objects which have been previously added to this input port. After all objects have been removed from the list no listener will be called in case of changes at the input port. If no listener has been registered before the list will remain unchanged.

See Also:
InPortListener, addListener(com.siemens.icm.io.LimitPulseCounterListener), removeListener(com.siemens.icm.io.LimitPulseCounterListener)

IM Profile

Submit a comment or suggestion Version 2.0 of IM Profile Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.