Interpretes an unsigned BDM item as a signed value. The wSignBit parameter specifies the bit to interpret as sign bit. (This must be the most significant bit in the item, all bits to the left of the sign bit will be overwritten with the sign expansion).
Parameter
Description
lValue
Unsigned long value to convert into a signed value.
Returns
The sign converted value.
Example
The following example assigns -2 to a 9 bit long data item. It then prints the results after it posted the block to the system. The value is 510. To get the signed value we use the signed conversion function and specify bit 8 as sign bit (the MSB).