AMX CAFE DUET V1.8 Instruction Manual page 65

Integrated development environment for netlinx duet (version 1.8)
Table of Contents

Advertisement

There are three versions of the switch method; each with a different
method signature. The appropriate method is called based on the
parameters sent.
For the purpose of this discussion, we'll continue with the simplest
form: one input to one output (as seen below).
public void switchInputToOutput (SwitchLevel sl,int
input,int output) {
// device specific code goes here.
}
1.
Communicate with the attached device, by utilizing the methods that are part of the
NetLinxDevice object (in our case: dvActual), such as:
public void switchInputToOutput (SwitchLevel sl,int
input,int output) {
// device specific code goes here.
dvActual.sendString("I am sending this string out the
com port")
}
Lastly, you should deal with the strings coming back from the device. Since
IDataListener
contains
information in
2.
Create a place to store the incoming information by going beneath your public class
declaration (public class AmxSwitcher extends Switcher implements iDataListener)
and creating a global variable like this:
public class AmxSwitcher extends Switcher implements
iDataListener {
NetLinxDevice dvActual;
StringBuffer incoming = new StringBuffer();
It is recommended to initialize the size of the StringBuffer at the
time of creation. For example: StringBuffer incoming = new
StringBuffer(10).This example initializes the initial capacity of
the String Buffer to a value of 10 characters.
Café Duet v1.8 - User's Guide
is implemented, and
dvActual.addDataListener(this)
handleDataEvent(Event arg0)
Creating a Sample Module
doAddNetLinxDeviceListeners()
, you will receive returned
.
59

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cafe duet

Table of Contents