Analog event monitoring is a little more involved than digital events. Analog events are based on event thresholds (also called an event definition), which are completely configurable by you. An event definition consists of a lo-mark and a hi-mark. These are two values which are configured within the ETH32 and allow the ETH32 to assign one of two values, low or high, to the event. When the analog reading is <= the lo-mark, the event will be considered low. When the analog reading is >= the hi-mark, the event will be considered high. When the reading is in between the two marks, the event keeps its previous state, allowing hysteresis to be built into the event. The ETH32 sends an event notification whenever the event state changes from low to high or from high to low.
The ETH32 allows a total of 16 analog event definitions to be in effect. These are organized into two banks, each having one analog event definition per logical channel (logical channels are described in the Analog Inputs section). This means that there are two analog event definitions per logical channel. Be aware that analog event definitions remain in effect on a logical channel even if you reassign the logical channel to obtain its reading from a different physical channel.
The lo-mark and hi-mark are specified as 8-bit numbers, while the analog readings are 10-bit numbers. The lo-mark and hi-mark specify the eight Most Significant Bits (MSB) of the analog reading. If you know the threshold you would like to set, represented as a 10-bit number, you can obtain the eight MSB's by doing an integer division by 4. There are no restrictions on the permissible values of the lo-mark and hi-mark other than that they must be 8-bit numbers (range 0-255) and that the lo-mark must be at least one less than the hi-mark.
The analog event definition banks are shared among all connections. However, the event notifications generated from the event definitions are enabled and disabled on a per-connection basis (just like digital events). Note that setting an analog event definition does not automatically enable receiving its event notifications - that must be done separately.
Task | C / C++ | .NET Languages | Visual Basic 6 |
---|---|---|---|
Set event definition | eth32_set_analog_eventdef | SetAnalogEventDef Method | SetAnalogEventDef Method |
Get event definition | eth32_get_analog_eventdef | GetAnalogEventDef Method | GetAnalogEventDef Method |
Enable event notification | eth32_enable_event | EnableEvent Method | EnableEvent Method |
Disable event notification | eth32_disable_event | DisableEvent Method | DisableEvent Method |