First page Back Continue Last page Graphics
Web Page Macro
- WORD cmdGetTag(GETTAG_INFO* pGetTagInfo)
- {
- -
- - Detects various predefined macro tags
- - followed by a 2 digit tag number
- -
- else if (tagGroup == VARGROUP_ANALOG)
- {
- - perform A/D measurement on input
- - corresponding to tag number
- - return that array element
- }
- }
- In websrv65_v310/src/cmd.c
- The Modtronix server can substitute various macros embedded within web pages with variables. It already has support for a macro to be replaced with an element of the AdcValues[array].
- REPLACE the entire conditional branch body
- {
- if (tagVal < ADC_CHANNELS)
- pGetTagInfo->ref = cmdGetWordVar(ref, pGetTagInfo->val, AdcValues[tagVal]);
- return 1; //One byte was written
- }
- In our system, all the AdcValues[array] are perpetually updated by ISR
- We don’t have to perform a measurement when an analog variable group tag is encountered
- … Simply return the array element pointed to by the tag number
- %n00
- macro to be replaced with AdcValues[0]
- %n04
- macro to be replaced with AdcValues[4]