public void initPublishSubscriber(final int periodMs){

		Thread thread = new Thread() {
			public void run() {
				PortReadingResult or;
				// check if the observer is still there
				// we have no more than 1 observer
				while(countObservers()>0){
					try {
						or = readData();
						while(or.getStatus() == OutputPortStatus.NO_DATA  
								|| or.getStatus() == OutputPortStatus.OLD_DATA){
							Thread.sleep(periodMs);
							or = readData();
						}
						// if a new data is availbale notify the observer
						setChanged();					
						notifyObservers(new OrocosPortEvent(port.getName(), or.getValue()));
						
					} catch(InterruptedException e){
						e.printStackTrace();
					} catch (WrongUseOfConnectionException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				}
			}
		};
		thread.start();
	}