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 >>

 

 

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

 

 

 

 

At present, there are three types of transfer variables in a TCPmaker embedded PIC web server:

 

Integer Variables transfer data in either direction (to or from the PC), and this data remains in integer form on both sides. Like all of TCPmaker's transfer variable types, an Integer Variable has a name, a short ID, and a value.

Numeric Variables transfer also data in either direction, but the data is not in the same form on both the PIC and PC side.  The value of a Numeric variable is used in integer form in the PIC device (and sent in integer form over the Ethernet as well).  However, it is scaled and transformed to floating point form on the PC browser.  This lets you display variables in floating point format on the PC, without having to do floating point arithmetic (or even having to load the larger floating point libraries) in your PIC code.

String Variables are often used to display titles and headings on TCPmaker screen controls displayed on the browser.  Optionally, a String Variable can contain a standard C-style format string, to display your data in a format that you control.  This very powerful capability is done on the PC side: your PIC code does not need to do any formatting of the data with format statements, so your PIC code can stay small and simple.

 

Integer and Numeric variables are easily set up to send values, from TCPmaker screen controls on the PC browser, to the PIC device.  Once a variable and a screen control have been defined in the Visual Page Designer, all you need to do is associate a variable with a control, on the property page that is displayed when the control is selected.

 

For instance, suppose we have a pushbutton control called Pb1 in our layout, and we have already defined an Integer variable called D1, that we want to send to our PIC to light up LED1 on our board.  All we have to do is to select pushbutton Pb1 on our layout, and on its property page, we look for the i property, drop down the list of existing integer variables, and select variable D1.

 

Once we do that, any time we press the pushbutton Pb1 on our layout, variable D1 is given a value of 1 and sent to our PIC device.  (This value is also sent to any other screen controls in our layout that are also associated with variable D1, so they can update their display states as well.)

 

[image needed here, to show the sequence of how clicking Pb1 changes variable D1 & lights LED1]

 

In our PIC code, a simple event handle will be automatically called, so we can just assign the new value of D1 that was just received by the PIC, to the digital I/O pin connected to LED1.  This was a 1, so LED1 turns on.

 

When the pushbutton Pb1 is released and goes to its inactive state, the variable D1 is given a new value of 0.  This new value is then sent to the PIC device and to the other screen controls.  When the new value of 0 is assigned to the pin connected to LED1, the light turns off.

 

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

 

Read more about: Formatting 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

 

 

 

 

I started looking around on the web to see what the chip makers offer, and to see what other people do.

 

Ethernet Modules and Demo Boards

I did find various companies that sell little Ethernet boards or modules.  Many of these are OK for experimenting with, and some might be even be usable as they for some types one-off projects.  But for the most part, they are too expensive to add on to an existing product like ours.  For cost control and other reasons, we need to be able to add just the chips we need to a PC board of our own design.

Some of these companies provide a Basic interpreter in the processor on their board, making that device programmable in Basic.  I would imagine that could be good news or bad news, depending on the capabilities of that particular Basic interpreter.

 

Interactivity and Graphs

One thing that concerned me was that it was hard to find any pictures or demos of examples of what these devices display on a web browser, especially with any interactive controls being shown on the browser.  The examples that I did find tended to be pretty dreary looking. They were usually those drab looking radio buttons and text boxes that you see in HTML forms when you buy something online.  This implies that it could be hard or (maybe even impossible, in some of these products) to punch up the appearance of what the device displays on the browser, to give our device a competitive edge.

Graphs being served up by the embedded device and displayed on the browser were also hard to find.  When I did find any examples of a web based device that could show a graph, they always seemed to show really slow moving data, like graphs of temperature or humidity.  That tells me that many of these devices can't draw or update a graph very quickly.

 

What Microchip Offers

I see that Microchip has a free TCPIP Stack, so that's a help.  That means I can probably stay with the PIC microcontrollers that I'm already familiar with, though I don't know how much work it is gonna take to actually DO something with it.

 

 

A New Challenge: Now I Have To Control It Over the Web

 

Like I said, things had really been going great for me at my little company: they call me the "go-to guy" for USB projects because can do them so fast with HIDmaker FS.  I've really enjoyed getting respect for that.

Then, this morning, the boss came to me with a new requirement that threatened all that.

But oh, brother, what a challenge!  I've heard from my friends that making a device that you can control over the web, one that is really interactive and looks good on a web browser, is really hard and really time consuming. My heart sank, when I thought about all that web technology that I heard I was gonna have to learn, like all those Internet protocols, and all that HTML and Javascript and Ajax that I was gonna have to learn and then slog through.

I'm no web expert by any means, but I have tinkered around with simple web pages on my own,  enough to know that there are always surprises.  You try to put a block of text or a picture at some specific place on your page, and it doesn't always go where you tried to put it.  So you struggle for awhile to get it placed where you want it. If you're not very experienced with this stuff (like most engineers), you can struggle a long time, and the frustration mounts.

And that's just with static web pages, that aren't interactive. Adding the interactivity is a whole new level that I'll have to spend a lot of time getting familiar with.

This is not looking good.