Notifications

<< Click to Display Table of Contents >>

Navigation:  NmxDLL Reference Guide > API (programming interface) >

Notifications

Using notifications, the application can be informed about different events. The use of notifications is recommended, but not required.

The following notifications are available:

Category

Notification

Hex Value

Description

Min. DLL version

Connecting / Disconnecting

NMXNOTIFY_DISCONNECTED

0x00000002

The connection to the device (measurement system) has been closed.
Prior to this event the function NMX_DeviceClose_1 has been called.

V1.0.0.0

NMXNOTIFY_FAILURE_DATA_EXCHANGE

0x00000003

Permanent failure during data exchange (e.g. timeout).
A typical reason is a broken network connection.

V1.0.0.0

NMXNOTIFY_RECONNECTED

0x00000004

The connection has been re-established automatically.
Prior to this event, the event NMXNOTIFY_FAILURE_DATA_EXCHANGE occurs.

V1.0.0.0

Static measurement (Non-Realtime)

NMXNOTIFY_NEW_STATIC32

0x00000010

The static data inside the DLL has been updated.

V1.0.0.0

Sampling (Realtime Measurement)

NMXNOTIFY_SAMPLING_NEW_DATA

0x00000020

New sampled data is available.

V1.0.0.0

NMXNOTIFY_SAMPLING_FINISHED

0x00000021

Sampling is finished. Not all data may have arrived at the PC yet.

V1.0.0.0

NMXNOTIFY_SAMPLING_ALL_DATA_RECEIVED

0x00000022

Sampling is finished and all data has arrived at the PC.

V1.0.0.0

NMXNOTIFY_SAMPLING_ERROR

0x00000028

An error occurred during sampling.

V1.0.0.0

NMXNOTIFY_SAMPLING_BUFFER_OVERFLOW

0x00000029

Overflow of the DLL-internal buffer for sampled data. Your application has not readout the data in time.

Increase readout frequency or increase buffer size.

V1.0.0.0

NMXNOTIFY_SAMPLING_TIMEOUT

0x0000002A

A timeout occurred during sampling. This is a general error (multiple root causes).

V1.0.0.0

 

There are two technical ways for receiving notifications:

Windows Messages, see NMX_RegisterMessage_1, or

Callback Functions, see NMX_RegisterCallback_1.

If technically possible in your application, Messages are recommended. Use Callbacks, if it is difficult or impossible to read the Windows message queue.

 

Inside the NMX DLL, notifications are send/called from a separate thread. An advantage of this is, that the communication thread is not interrupted, if message or callback handling takes too much time.

Nevertheless it is very important that the notification itself and reading, processing and displaying data is handled in a separate threads. The following approach is suggested:

In case a notification occurs, set a global flag.

Check this flag cyclically in the same thread, which handles the DLL function calls. This cyclic check can for example be implemented into a 30ms timer-event of the GUI.

 

Further comments:

All notifications are automatically removed, when a connection is closed. You will have to re-register them after establishing a new connection.

It is possible to combine multiple notifications to the same Windows Message or Callback. Register each of the Notifications, which shall be combined, using the same Windows Message or Callback Function.

If you have multiple connections, the notifications must be registered for each connection separately.