|TCPmaker : Visual Tour Exploring and Customizing the Generated Code|
Let's focus on one particular TCPmaker Variable, D1, which is intended to carry a value from the PC to the PICDEM.net2 board, in order to turn a particular LED on or off.
Here is the declaration of D1 in file mtGen.c:
// Variable D1 - Diode D1 connected to RJ7
// Used by these controls in browser layout:
// D1 Class=Iv Id=i0 **In** **Out**
// Pb1 Class=Pb Id=pb1 --- Page: name=Index Class=Pg Id=index
int D1; // Data transfer variable as created in Visual Page Designer
unsigned char D1TxFlag; // Transmit flag for this variable: set True to send
TCPmaker has declared a variable named D1 in your C code for the PIC microcontroller: this is a variable of the same name that you created in TCPmaker's Visual Page Designer. TCPmaker has also declared a corresponding flag called D1TxFlag that you can use if you want to send this D1 variable back to the PC for any reason.
The comment header above the variable gives us information to remind us of the intended use of this variable.
The string "Diode D1 connected to RJ7" was the comment that we created for this variable when we created it in the Visual Page Designer. (It is a good idea to add a meaningful comment for every variable that you create, because this comment will be automatically reproduced in your generated code to remind you of what the variable is to be used for.)
When we say that D1 is used by Pushbutton Pb1, we mean that any time Pb1 is pressed or released on the PC browser screen, instructions in file run.xml tell our library run.swf to assign a new value to variable D1, and send that new value to your device.
|1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21|