NMX_DigitalOutputsGetState_1

<< Click to Display Table of Contents >>

Navigation:  NmxDLL Reference Guide > API (programming interface) > Static Measurement (Non-Realtime) >

NMX_DigitalOutputsGetState_1

This function allows reading the current state of all digital outputs from the device.

 

Definition


NMX_STATUS NMX_DigitalOutputsGetState_1(

 NMX_PHANDLE pHandle,

 unsigned char* pucOutputState,

 unsigned long ulSizeofOutputState);

 

Parameter


pHandle

Connection Handle.

pucOutputState

Pointer to the array, in which the digital output bytes shall be stored.
The data type of the array is "unsigned 8 Bit".
The array must be provided by your application.

ulSizeofOutputState

Size of pucOutputState in Bytes.

 

Typical function call (C example)


NMX_DigitalOutputsGetState_1(pHandle, aucOutputs, sizeof(aucOutputs));

 

.Net DLL specific implementation


NMX_MSTATUS DigitalOutputsGetState_1(

                 System::IntPtr pHandle,

                 array<System::Byte>^aucOutputState);

 

No Length/Sizeof-Parameter is required for the array aucOutputState, since this information automatically available in a .Net environment.

The array will not be resized within the function call for performance reasons. This means it should be large enough to store all the data.

Example: in a system with 32 digital outputs (= 4 outbut bytes), the array aucOutputState should have a minimum size of 4 array elements.

If the array is shorter, not all data will be available for your application. (The size is checked -> no risk for crash.)

 

Comments


The purpose of this function is getting the state of all digital outputs once after establishing a connection. It should not be called cyclically.

The state reflects the internal data inside the measurement system. It does not reflect the physical state of an output. Usually both are the same, but under fault conditions they may differ.