String variables can contain standard format strings that you can use to control how your data is displayed.

 

Suppose you want to read a pot on your board, and the two end terminals of the pot are connected to ground (0.0 V) and the 3.3V supply.  You create a numeric transfer variable in TCPmaker , called Pot1.  The chip has a 10-bit ADC, so it returns raw values in the range of 0..1024.  You set the scaling parameters for variable Pot1 as follows:

 

mn = 0,   mx = 1023

pn = 0.0,  px = 3.30

 

You create a String Variable called Sv1 to display the value of Pot1.  You set the f property of the string variable to be:

 

%5.3f Volts

 

and you set the argument list property of the string variable to be

 

Pot1.

 

Then, in the Visual Page Designer , you simply associate the string variable Sv1 with one or more controls in your layout.

 

After you generate your code, you add some PIC code to read the ADC channel that is connected to the wiper of the pot, and simply place the raw ADC result into variable Pot1 and set the flag to send Pot1 to the PC browser. That's the only coding you have to do.

 

When you run your device and turn the pot all the way up, so that your PIC code reads the full scale value 1023 from the ADC, it sends that to the PC in variable Pot1.  The PC browser will then  show the formatted string

 

3.300 Volts

 

on any screen control that uses your string variable Sv1.

 

When you turn the pot down to half of full scale, the PC browser will automatically change its display to show

 

1.650 Volts.

 

That's all you have to do!

 

 

 

Learn more about: TCPmaker's Transfer Variables >>

 

Learn more about: Scaling your data with no code >>

 

Next: TCPmaker's Screen Controls >>

 

 

Being able to use beautiful 3-D looking screen controls like buttons, sliders, gauges, and graphs, makes TCPmaker a joy to use.

 

There is no easier or faster way on the planet than TCPmaker, to make embedded web servers that look great, are highly interactive, and work in a wide variety of PIC microcontrollers. Gets your project up and running fast!

 

Get Instant Access Now at Our Store :

TCPmaker Pro -- Only $379.95

Add2Cart_layers

Give Me Access Now!

PayPal Acceptance Mark