|TCPmaker : Visual Tour Exploring and Customizing the Generated Code|
One of the things that TCPmaker does to help you is to provide commented out examples of code you might use in your project. In the mtEndOfMessage() handler for our PICDEM.net2 project, it provides comments like this:
// Transmitting Variables to PC browser:
// Here is how to send test values for all Tx variables.
// We don't recommend that you enable and run all of these lines at once.
// Rather, we suggest that you send only a few variables at a time, when
// it is meaningful to do so for your specific project. See the commented
// out code samples for one possible way to do things.
// Variable D1 - Diode D1 connected to RJ7
//D1 = 0; // Assign a value
//D1TxFlag = 1; // Tell mtServer to send
// Variable Pot1 - Pot1 connected to AN2 / RA2
//Pot1 = 0; // Assign a value
//Pot1TxFlag = 1; // Tell mtServer to send
... etc for the rest of the variables in your specific project.
These are only examples of what you might do. If you send all of your variables each time mtEndOfMessage() is called, you could send a lot of data and risk flooding your network with messages, so we urge you to act with intelligent restraint. It would be a good idea to only send a particular data Variable from your device when it is meaningful to do so (e.g. when it changes).
We will show presently a specific example of what we added for our PICDEM.net2 project.
|1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21|