CoachLabII+ element

EJS Element for CoachLab II+, a multifunctional interface for computerized measurement and control.

Important notice: Currently, the element only works under the Windows operating system.

Usage

To add a CoachLabII+ element to your model, simply drag the icon element to the list of your model elements. In your model, call the element reset() method before any other method of the interface.

Before running the simulation, though, make sure that:

  1. the CoachLab II+ interface is connected to the computer on one if its USB ports,
  2. you have installed the CoachLab II+ driver (use the CD included in the CoachLab II+ box),
  3. you copy the DLL for your operating system anywhere in the java.library.path list of directories. (The DLLs can be found in the EJS bin/extension/DLLs directory.) Under windows, rename the rxtxSerialXX.dll (XX=32 for a 32 bits Windows, 64 for a 64 bits Windows) to just rxtxSerial.dll, and copy it, for instance, to C:\Windows\System32. The Mac OS X DLL is not working right now.

Configuration methods

Input methods

The following input methods require a channel (int in the range 1-4) and a sensor int value. The list of sensors currently supported is the following:
(Use the integer number or the constant with the prefix es.uhu.serial.coach.CoachLabIIPlus, as in es.uhu.ejs.serial.CoachLabIIPlus.SENSOR_THERMOCOUPLE_0135i_m20_M110C)

The list of input methods is:

Output methods

The following output methods require a channel parameter which must be one of A1,A2,B1,B2,C1,C2,D1,D2:

More info

A JavaDoc format description of the methods can be found at CoachLabII+.

Example of input

(Connect the temperature sensor to the input channel "1>" on the interface.)

coachLab.reset();
double temperature = coachLab.readValue(1,10); // 10 is the temperature sensor in the range -20 +110 ¼C
_println ("Temperature = "+temperature);
    

Example of output

(Connect the switch module (D063) to A1 and A2 on the interface.)

coachLab.reset();
coachLab.setOutputEnabled("A1",true);
coachLab.setOutputEnabled("A2",true);
coachLab.setSwitch("A1",true); // whatever is connected to the switch will power on