TCPmaker : Visual Tour    How Variables and Controls Work Together  

Let's sum up what we've seen so far.  To send an integer data item from the PC to the micro device, here's what you need to actually do:

  • In the Visual Page Designer, create an Integer Variable to hold the data item. Give this variable a meaningful name and a unique ID.
  • Also in the Visual Page Designer, create a suitable Control (e.g. a Pushbutton) somewhere on your layout, and set the i property of this control by selecting the Integer Variable you created in the previous step (i.e., select the name of the variable from a dropdown list of all the Integer Variables that you have created thus far). This will associate the Variable with the Control.
  • Save your layout, and let TCPmaker generate your code.  The code generator will create an integer variable of this name in your micro source code, and generate an Event Handler for this Integer Variable, that will automatically be called any time the state of the Control is changed.
  • All you need to do is add a little code to that Event Handler to make use of the new value of the Integer Variable that was just sent to the device.

 

That's it!  

 
  

6 of 12
Copyright Notice and Author Information