UpdateValues [LJM User's Guide]
Converts read values in a Modbus Feedback response packet.
Syntax
LJM_ERROR_RETURN LJM_UpdateValues(
unsigned char * aMBFBResponse,
const int * aTypes,
const int * aWrites,
const int * aNumValues,
int NumFrames,
double * aValues)
Parameters
Note that some of these parameters may be used directly from LJM_AddressesToMBFB and/or LJM_MBFBComm.
aMBFBResponse [in]
A valid Feedback response. May be used directly from LJM_MBFBComm
.
aTypes [in]
An array of size NumFrames
containing the data type of each value sent/received for each frame. May be used directly from LJM_AddressesToMBFB
.
Types - UINT16
(0
), UINT32
(1
), INT32
(2
), FLOAT32
(3
)
aWrites [in]
An array of size NumFrames
containing the desired type of access for each frame, which is either read (0
) or write (1
). May be used directly from LJM_AddressesToMBFB
.
aNumValues [in]
An array of size NumFrames
that contains the number of consecutive values for each frame. Use 1 for a single (non-consecutive) value. May be used directly from LJM_AddressesToMBFB
.
NumFrames [in]
The number of frames. May be used from LJM_AddressesToMBFB
after dereferencing.
aValues [out]
An array that contains all the values for all the frames, so its size should be the sum of all elements in the aNumValues
array. Each read value is converted to its corresponding frame type defined in aTypes
.
Returns
LJM errorcodes or 0
for no error.
Remarks
The Type Conversion functions may also be used to read bytes to types.
Examples
Please see the Low-level Feedback Functions overview page for an example.