Component: Scale (DSP)
Author | Matrix Ltd |
Version | 1.1 |
Category | DSP |
Contents
Scale component
Allows the values in a single buffer to be scaled uniformly. Functions include: Multiply, Divide, LeftShift, RightShift, Float Multiply, Float Divide
Detailed description
No detailed description exists yet for this component
Examples
Here is an example which demonstrates variable scaling based on an analogue input.
Here are the traces as seen on the data recorder window.
The RightShift macro is a very efficient means of performing a division but only for values which are a power of 2.
The LeftShift macro is a very efficient means of performing a multiplication but only for values which are a power of 2.
LeftShift(1) = Multiply by 2 / RightShift(1) = Divide by 2
LeftShift(2) = Multiply by 4 / RightShift(2) = Divide by 4
LeftShift(3) = Multiply by 8 / RightShift(3) = Divide by 8
LeftShift(4) = Multiply by 16 / RightShift(4) = Divide by 16
Downloadable macro reference
![]() |
SetScalerFloat |
Sets the Float scaler to be used when calling the calculate function. | |
[[File:]] - | Scaler |
![]() |
Return |
![]() |
SetScalerInteger |
Sets the Integer scaler to be used when calling the calculate function. | |
[[File:]] - | Scaler |
![]() |
Return |
![]() |
Calculate |
Performs the selected scaling on a value from the input buffer and passes to the output buffer. | |
![]() |
Return |
![]() |
CalculateArray |
Performs the selected scaling on an entire buffer. | |
![]() |
Return |
![]() |
ResetRecords |
Allows the peak and trough to be reset back to default values. | |
[[File:]] - | ResetPeak |
[[File:]] - | ResetTrough |
![]() |
Return |
![]() |
ReceiveString |
Gets a string from the receive buffer | |
![]() |
MaxChars |
![]() |
Timeout |
Time in milliseconds to wait for data | |
![]() |
Return |
![]() |
Initialise |
Initialises the UART component pins ready to send and receive data | |
![]() |
Return |
![]() |
Start |
Startup routine required by the hardware device. Automatically clears the display after initialising. | |
![]() |
Return |
![]() |
SetLEDState |
Sets the state of a single LED | |
![]() |
Port |
0 = PortA, 1 = PortB | |
![]() |
LED |
0 = LED0, 7 = LED7 | |
![]() |
State |
![]() |
Return |
![]() |
GetRxIdent |
Gets the Rx ID as a Integer Standard and Extended IDs. | |
![]() |
Buffer |
![]() |
Return |
![]() |
Initialise |
Must be called before any other CAN component macros to enable and initialise the CAN peripheral. | |
![]() |
Return |