User Tools

Site Tools


zalozeni:classes:connection

Connection

Connection je reprezentovano tridami ModBusTcpConnection (Eurotherm) a LabjackT7Connection (LabJack). Device a Connection spojuje teprve ConfigurationInitializer. Pro Connection zpravidla staci pouzit zminene tridy, ale nekdy je treba Device hned po pripojeni nakonfigurovat (napr. nastavit CIO2 kanal LabJacku na counter). V takovem pripade se zda byt nejjednodussi modifikovat LabjackT7Connection.

public class DokuwikiLabJackT7Connection extends LabjackT7Connection {
 
	public DokuwikiLabJackT7Connection(String labjackType, String connectionType, String addr, StringAddrDevice device) {
		super(labjackType, connectionType, addr, device);
	}
 
	@Override
	public void connect() throws ConnectException, Exception {
		super.connect();
 
		// configure LabJack counter, CIO2
		LJM.eWriteName(this.getHandle(), "DIO18_EF_ENABLE", 0);
		LJM.eWriteName(this.getHandle(), "DIO18_EF_INDEX", 7);
		LJM.eWriteName(this.getHandle(), "DIO18_EF_ENABLE", 1);
	}
 
}
zalozeni/classes/connection.txt · Last modified: 2016/07/22 11:42 by jlochman