int MSXE173x__MFEndatInitAndEnableLatchPositionValues ( xsd__unsignedLong  ulmFModuleIndex,
xsd__unsignedLong  ulChannelIndex,
xsd__unsignedLong  ulLatchSource,
xsd__unsignedLong  ulTriggerEdgeCount,
xsd__unsignedLong  ulDataFormat,
xsd__unsignedLong  ulOption01,
xsd__unsignedLong  ulOption02,
xsd__unsignedLong  ulOption03,
xsd__unsignedLong  ulOption04,
struct MSXE173x__Response Response 
)

Before calling this function, you must call the MSXE173x__MFEndatInitSensor function.
When the selected trigger occurs, the position value of the selected EnDat channel will be measured and send through the dataserver.
If you chose additional data using the function MSXE173x__MFEndatSelectAdditionalData and if your selected ulDataFormat enables it, you will also receive the value of the selected additional data.
Note: using a synchro timer (and activating the synchro trigger as latch source) enables to get postion of the EnDat sensor at a defined rate.

Parameters:
[in] ulConnectorIndex Index of the EnDat connector (0 to 3). See on the MSX-E system.
[in] ulChannelIndex Index of the channel. Set to 0
[in] ulLatchSource Mask of bits, that defines the trigger source.
Bit 0: Hardware trigger If you select the hardware trigger, you must also choose the edge detection (Bit 2 and 3). Of course, you can choose both.

  • 1 activated
  • 0 not used

Bit 1 : Synchro trigger

  • 1 activated
  • 0 not used

Bit 2 : Trigger rising edge (only if hardware trigger is selected)

  • 1 activated
  • 0 not used

Bit 3 : Trigger falling edge (only if hardware trigger is selected)

  • 1 activated
  • 0 not used
ulLatchSource = 2 (0b10)        -> the latch source is the synchro trigger
ulLatchSource = 5 (0b101)       -> the latch source is a rising edge of the hardware trigger
ulLatchSource = 13 (0b1101) -> the latch source is a rising or a falling edge of the hardware trigger
[in] ulTriggerEdgeCount Number of edges required to detect an hardware trigger (only if hardware trigger is selected)
[in] ulDataFormat Mask of bits, that defines the format of data that will be sent by the data server.
It is a combination of bits. You can set all the bits to 1 if you want all the informations 0b11111 = 31.
You can also, for example, only wants the timestamp and the digital I/Os state ( 0b11 = 3).
You can also choose, for example, to get the additional data 2 ( 0b1000 = 8 ).
Bit 0: Timestamp

  • 0 Not sent
  • 1 timestamp sent by the dataserver

Bit 1: Digital I/Os state

  • 0 Not sent
  • 1 digital I/Os state sent by the data server

Bit 2: Additional data 1

  • 0 Not sent
  • 1 Additional data 1 sent by the data server

Bit 3: Additional data 2

  • 0 Not sent
  • 1 Additional data 2 sent by the data server

Bit 4: Format of the value

  • 0 Raw value (as sent by the sensor)
  • 1 Standardised value. The format of the frame will then depends on the model of the sensor. See system documentation.


If ulDataFormat is set to 0, the frame send by the dataserver will have the following definition

 unsigned long eventsrc;                // High 16 bits (MSB): Channel concerned (0 to 3)
                                                                // Low 16 bits (LSB): Bit mask representing the source of the event
                                                                //      Bit 0: Hardware trigger
                                                                //      Bit 1: Synchro trigger
                                                                //      Bit 2: Compare
 unsigned long positionlow;     // Low bits of the position
 unsigned long positionhigh;    // High bits of the position
 unsigned long error;                   // Status of the communication. Same value as the value returned by the function MSXE173x__MFEndatGetErrorSources

If you set ulDataFormat to 1 (send timestamp), then the frame send by the dataserver will be changed. At the end of the "basic" frame, we add the timestamp.

 unsigned long ts;                      // Second part of the timestamp
 unsigned long tus;                     // Microsecond part of the timestamp

If you set ulDataFormat to 2 = 0b10 (send digital I/Os state), then the frame send by the dataserver will be changed. At the end of the "basic" frame, we add the state of the digital I/Os.

 unsigned long digiostate;      // State of the digital I/Os. Bit mask that encodes all digital I/Os.
                                                                // 0b0                                  : All I/Os are set to low
                                                                // 0b100                                : I/O 2 is set to high, all others are set to 0
                                                                // 0b1111111111111111   : All I/Os are set to high

If you set ulDataFormat to 4 = 0b100 (send additional data 1), then the frame send by the dataserver will be changed. At the end of the "basic" frame, we add the value of the first additional data.

 unsigned long ad1value;
 \encode
 If you set ulDataFormat to 8 = 0b1000 (send additional data 2), then the frame send by the dataserver will be changed. At the end of the "basic" frame, we add the value of the second additional data. \n
 \code
 unsigned long ad2value;
 \encode
 If you set the bits 0, 1, 2 and 3 to 1, the format of the frame will then be: \n
 \code
 unsigned long eventsrc;                // High 16 bits (MSB): Channel concerned (0 to 3)
                                                                // Low 16 bits (LSB): Bit mask representing the source of the event
                                                                //      Bit 0: Hardware trigger
                                                                //      Bit 1: Synchro trigger
                                                                //      Bit 2: Compare
 unsigned long positionlow;     // Low bits of the position
 unsigned long positionhigh;    // High bits of the position
 unsigned long error;                   // Status of the communication. Same value as the value returned by the function MSXE173x__MFEndatGetErrorSources
 unsigned long ts;                      // Second part of the timestamp
 unsigned long tus;                     // Microsecond part of the timestamp
 unsigned long digiostate;      // State of the digital I/Os. Bit mask that encodes all digital I/Os.
                                                                // 0b0                                  : All I/Os are set to low
                                                                // 0b100                                : I/O 2 is set to high, all others are set to 0
                                                                // 0b1111111111111111   : All I/Os are set to high
 unsigned long ad1value;
 unsigned long ad2value;

The bit 4 of the ulDataFormat is more complex. The format of the frame that is sent by the dataserver will depend on the model of the sensor used. See the system documentation for more information, or the "Acquisition" menu of the web site.

[in] ulOption01 Reserved. Set to 0
[in] ulOption02 Reserved. Set to 0
[in] ulOption03 Reserved. Set to 0
[in] ulOption04 Reserved. Set to 0
[out] Response 
iReturnValue

  • 0 The remote function performed OK
  • -1 System error occurred
  • -2 The PLD is not working
  • -3 The ulConnectorIndex parameter is wrong
  • -4 The ulChannelIndex parameter is wrong
  • -5 The component is not programmed as EnDat
  • -6 The driver is in a wrong state (must be INITIALISED)
  • -7 The ulLatchSource parameter is wrong
  • -8 The ulDataFormat parameter is wrong
  • -9 Error while getting sensor properties
  • -10 The multiturn part size of the sensor is 0
  • -11 The singleturn part size of the sensor is 0
  • -12 The step per revolution properties of the sensor is 0
  • -41 Transmission error. Please call MSXE173x__MFEndatGetErrorSources to get more information
  • -100 Internal system error occurred. See value of syserrno

syserrno system-error code (the value of the libc "errno" code)

Return values:
0 SOAP_OK
Others See SOAP error