Analog sensor example – Echelon Mini EVK User Manual
Page 66
nvoSwitch.state = button ? 1 : 0;
}
}
// Call IsiTick() every 250 milliseconds
mtimer repeating isiTimer = 250;
when(timer_expires(isiTimer)) {
IsiTickS();
}
// Override IsiGetAssembly() with a version that connects to
// automatic connections offering a digital actuator
unsigned IsiGetAssembly(const IsiCsmoData * pCsmo, boolean Auto) {
if (Auto && // Automatic Connection
pCsmo->Profile == 4 && // SFPTopenLoopActuator
pCsmo->Direction == isiDirectionInput &&
pCsmo->Width == 1) {
return nvoSwitch::global_index;
}
return ISI_NO_INDEX;
}
Analog Sensor Example
The following example application adds ISI support to the previous analog sensor
example. The network variable output may be manually connected to a space
comfort controller. The ISI code is highlighted in bold.
#pragma enable_io_pullups
#pragma enable_sd_nv_names
#pragma num_alias_table_entries 2
#include
#include
// Define the device interface
network output SNVT_temp_p nvoTemperature;
fblock SFPTopenLoopSensor {
nvoTemperature implements nvoValue;
} fbSwitch external_name("Temperature");
// Configure the I/O pins
IO_7 touch ioThermometer;
// Variable to keep track of the state of the ISI engine
IsiEvent isiState;
// Start the ISI engine
when(reset) {
IsiStartS(isiFlagNone);
}
// Process ISI Messages
when(msg_arrives) {
if (IsiApproveMsg()) {
(void)IsiProcessMsgS();
}
}
#define DS18S20_SKIP_ROM 0xCCu
60
Mini EVK User’s Guide