NMX_ChannelSetConfig_1

<< Click to Display Table of Contents >>

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

NMX_ChannelSetConfig_1

This function allows changing a channels parameters during operation. The parameters depend on the measurement channel type. It is used for selected measurement channels, e.g. for incremental encoders.

 

Definition


NMX_STATUS NMX_ChannelSetConfig_1(

 NMX_PHANDLE pHandle,

 unsigned long ulChannelNo,

 char* pcStringTx, unsigned long ulSizeofTxString,

 char* pcStringRx, unsigned long ulMaxSizeofRxString, unsigned long* pulSizeofRxString);

 

Parameter


pHandle

Connection Handle.

ulChannelNo

Number of the measurement channel.
The first channel has the number 0.
Having a device with 8 measurement channels, these are numbered 0..7.

pcStringTx

ASCII-encoded string, which shall be send to the device.

ulSizeofTxString

Size of pcStringTx in characters/bytes.

pcStringRx

Buffer for the response-string, which is received from the device.

ulMaxSizeofRxString

Size of the buffer pcStringRx in characters/bytes.

pulSizeofRxString

Length of the response-string, which has been received from the devices.

 

Typical function call (C example)


char acStrTx[] = "#1VSS;1#";

NMX_ChannelSetConfig_1(pHandleNmx, 2, acStrTx, strlen(acStrTx), acStrRx, sizeof(acStrRx), &ulRxSize);

 

Strings, which can be sent to incremental en-/decoder channels


#{Configuration type};{Store}#

Configuration type

„1VSS“ to change an incremental channel type to 1Vpp.

„TTL“ to change an incremental channel type to TTL / RS422 with 1x-decoding (1 increment = 1 digit).

„TTL4X“ to change an incremental channel type to TTL / RS422 with 4x-decoding (1 increment = 4 digits).

Store

0“: The change remains active until the next system restart. Afterwards the old configuration becomes active again.

1“: The change applies permanently.

 

Response string from the measurement system / measurement channel for incremental encoder


#0#        Success

#-2#        Position parameter in string invalid

#-3#        Position parameter in string invalid

#-99#        General syntax error of the request string

 

Response string from the Irinos-System / measurement channel does not support this opcode


#-98#

 

.Net DLL specific implementation


NMX_MSTATUS ChannelSetConfig_1(System::IntPtr pHandle, System::UInt32 ulChannelNo, System::String ^%strExchange);

 

Since strExchange is a managed string, no additional string length information must be provided in the function call.

The string strExchange is send to the device.
On success, the received string will be returned via the same parameter strExchange.

Make sure to use only ASCII-characters. The conversion from unicode to ASCII is made within the wrapper DLL.

 

Comments for incremental measurement channels


After configuration, the position of the incremental input channel is reset.

By reconfiguring an incremental input channel after start of the application software, it does not matter how a measurement channel is pre-configured. This allows a quick replacement of a measurement Box without manual reconfiguration of the "new" Box.