How To Scale Your TCPmaker Dedicated Web Server Data With No Code
Here's a trick that can save you time, and will also save program memory on your PIC dedicated web server.
The value stored in a numeric variables gets transformed from the integer value that the PIC sees to a floating point value that is used and displayed on the PC web browser. This transformed is defined by 4 properties of the particular numeric variable:
- The parameters mx and mn are the maximum and minimum values that this Numeric variable is expected to have on the micro side.
- The parameters px and pn are the maximum and minimum of the range of corresponding values that will be displayed on the PC browser.
These define a linear transformation, that looks like this:
[image popup of the linear transformation graph]
You can use these parameters to scale your data without having to write a single line of code. For instance, if your hardware has one of those temperature sensors that output a voltage that is a linear function of temperature, just define a numeric variable called Temperature, set up its scaling properties mn, mx, pn, & px appropriately, and send the raw value from the ADC to the PC. What will be displayed on the PC browser will be the scaled temperature values.
Learn more about: TCPmaker's Transfer Variables >>
Read more about: Formatting your data with no code >>
Next: TCPmaker's Screen Controls >>