Tags

Introduction

Data can be requested from the target board via Tags. Tags can be: All Tags must have the format:
%nxx
Where the '%' character serves as a control code, 'n' represents the variable group, and "xx" represents a two-digit variable value ( in upper case hex format).
The variable value has a range of 00-FF (Which translates to 0-255 decimal), and must use upper case characters!
The variable group ('n' character) can be any alpha numeric character ('0-9', 'a-z', 'A-Z'), giving a total of 10+26+26 = 62 groups. Each group can have 256 variable values. This gives a total of 15872 possible variables.

An example tag is "%a02". This tag will be replaced by a '1' or '0' character representing the current value of Port A2. If this tag is placed on a Dynamic Web page, it will be shown on a Web Browser requesting that page as a '1' or '0'.

Dynamic Web Pages

Any of the Tags listed below can be placed on a CGI web page, and will be replaced by the requested data when sent to the HTTP Client (Web Browser for example).

For details, see Dynamic Web Pages

UDP Request Command

Any of the Tags listed below can be executed on the target by sending them to UDP port 54123. All UDP request commands must start with the % character, followed by the requested tag. The UDP port is configurable, and can be changed. The reply (requested data) will be returned to the UDP Socket that sent this Request Command.

For example, to request the value of port B2, returned as a 0 or 1 character (0=0V at input, 1=5V at input), send the following command string via UDP to port 54123:
%b02
The value of port B2 will be returned via UDP.
Another example could be to request the analog input value of Analog port 2, returned as a decimal value between 0 - 1023. To do this, send the following command string via UDP to port 54123:
%n12

Defined Tags

The following list of Tags are implemented by the Modtronix SBC65EC Web Server:


Port Tags

The variable groups a to j can be used to display the value of any input pin or port on the PIC. The lower 3 bits of the 8 bit variable value is used to specify the desired bit of the given port (port is given by variable group). The upper 5 bits are used to specify how the ports value should be displayed. The following variable groups are defined:
Variable GroupDescription
aPort A
bPort B
cPort C
dPort D
ePort E
fPort F
gPort G
hReserved for furture use
jReserved for furture use

The following variable values(in hex) are defined:
Variable ValueString returned by Server - displayed on web page
00 - 07'1' or '0' returned depending on PORT state
10 - 17"on" or "off" returned depending on PORT state
20 - 27"<!--" returned if port is configured as input
28 - 2f"-->" returned if port is configured as input
30 - 37"<!--" returned if port is configured as output
38 - 3f"-->" returned if port is configured as output
40 - 47"checked" returned if port is configured as output
48 - 4f"checked" returned if port is configured as input
50 - 57"0" returned if port is configured as output. "1" returned if port is configured as input.
For variable values where bit 3 is set (values from x8 to xf):
x8=port bit 0, x9=port bit 1, xa=port bit 2, xb=port bit 3
xc=port bit 4, xd=port bit 5, xe=port bit 6, xf=port bit 8
For example, variable value 48 will return "checked" if port bit 0 is configured as an input

Examples:
ExampleDescription
%a02Variable group = a, Variable value = 0x02. This example will display the value of port A2 as '1' or '0'. So, if port A2 is set, a '1' will be displayed on the web page in stead of '%a02'
%c17Variable group = c, Variable value = 0x17. This example will display the value of port C7 as 'on' or 'off'. So, if port C7 is clear for example, 'off' will be displayed on the web page in stead of '%c17'
%f22Variable group = f, Variable value = 0x22. Variable values 20 to 2F can be used to place HTML comments around HTML code if a port is configured as an input. For example, to only display an image if a Port pin RF1 is configured as an output, you could write:
%f21<img src="picture.jpg">%f29
%g52Variable group = g, Variable value = 0x52. This example will display '1' if port G2 is configured as an input, and '0' if port G2 is configured as an output.
%b45Variable group = b, Variable value = 0x45. This example will display 'checked' if port B5 is configured as an output.
%c4cVariable group = c, Variable value = 0x4c. This example will display 'checked' if port C5 is configured as an intput.


Analog Inputs Tags

The variable group n can be used to display the value of any Analog Input on the PIC.

The following variable values(in hex) are defined:
Variable ValueString returned by Server - displayed on web page
00 - 0A3 digit uppercase hex value, representing requested Analog Input Channel
10 - 1ADecimal value 0 - 255 or 0 - 1023, representing requested Analog Input Channel
20 - 2ADecimale value with 2 decimal places. This is the input voltage of the requested Analog Channel for 5V reference (default configuration is 5V reference).
30 - 3A"<!--" returned if the channels is configured for ADC
40 - 4A"-->" returned if the channels is configured for ADC
50 - 5A"<!--" returned if the channels is NOT configured for ADC
60 - 6A"-->" returned if the channels is NOT configured for ADC

Examples:
ExampleDescription
%n02Variable group = n, Variable value = 0x02. This example will display the value of Analog Input 2 in uppercase hex. For example, "A8" will be displayed on the web page in stead of '%n02' if Analog Input 2 has the value 0xA8.
%n1AVariable group = n, Variable value = 0xaA. This example will display the value of Analog input 10 in decimal. For example, "210" will be displayed on the web page in stead of '%n1A' if Analog Input 10 has the value 210.
%n32Variable group = n, Variable value = 0x32. Variable values 30-3A and 40-4A can be used to place HTML comments around HTML code if a Port pin is configured as an Analog Input. For example, to only display an image if a Analog Input 2 is configured as an Analog Input, you could write:
%n32<img src="picture.jpg">%n42


General Tags

The variable group l is used for displaying general information.

The following variable values(in hex) are defined.
Variable Value String returned by Server - displayed on web page
00 Deprecated - use the Username command in the Secure Tags group!
Displays the Username of the current user. For example "Guest" or "Admin". The current user will be "Guest" if the user has not logged in. This is a Secure Tag, and requires Authentication to be displayed!
01 Displays the TCP/IP stack version. For example "V2.04".
02 Displays the Application version. For example "V3.00".
03 Returns '1' if Authentication has been provided, else '0'.
04 Displays 'Yes' if the board has a bootloader, else 'No'
05 Displays our NetBIOS name
10 Displays first part of current IP address. For example, will be '5' if our IP is '10.1.0.5'.
11 Displays second part of current IP address.
12 Displays third part of current IP address.
13 Displays fourth part of current IP address. For example, will be '10' if our IP is '10.1.0.5'.
14 Displays first part of MAC address. For example, will be '5' if our MAC is '0.1.2.3.4.5'.
15 Displays second part of MAC address.
16 Displays third part of MAC address.
17 Displays fourth part of MAC address.
18 Displays fifth part of MAC address.
19 Displays sixth part of MAC address. For example, will be '200' if our MAC is '200.1.2.3.4.5'.
1A Displays first part of current Network MASK. For example, will be '255' if our mask is '0.0.0.255'.
1B Displays second part of current Network MASK.
1C Displays third part of current Network MASK.
1D Displays fourth part of current Network MASK. For example, will be '15' if our mask is '15.0.0.255'.
1E Displays first part of current Gateway address. For example, will be '5' if our Gateway Address is '10.1.0.5'.
1F Displays second part of current Gateway address.
20 Displays third part of current Gateway address.
21 Displays fourth part of current Gateway address. For example, will be '10' for '10.1.0.5'.
22 Displays I2C address of LCD Display 1. The default value for a Modtronix I2C LCD display is 80.
30 Read status byte of LCD display 1 (default address 0x80) if present. This tag has not been implemented yet!
31 Read status byte of LCD display 2 (default address 0x81) if present. This tag has not been implemented yet!
32 Read status byte of LCD display 3 (default address 0x82) if present. This tag has not been implemented yet!
33 Read status byte of LCD display 4 (default address 0x83) if present. This tag has not been implemented yet!
34 Read keypad data from LCD display 1 (default address 0x80) if present. This tag has not been implemented yet!
35 Read keypad data from LCD display 2 (default address 0x81) if present. This tag has not been implemented yet!
36 Read keypad data from LCD display 3 (default address 0x82) if present. This tag has not been implemented yet!
37 Read keypad data from LCD display 4 (default address 0x83) if present. This tag has not been implemented yet!
38 Read GPIO1, GPIO2 and GPIO3 Inputs from LCD display 1 (default address 0x80) if present. This tag has not been implemented yet!
39 Read GPIO1, GPIO2 and GPIO3 Inputs from LCD display 2 (default address 0x81) if present. This tag has not been implemented yet!
3A Read GPIO1, GPIO2 and GPIO3 Inputs from LCD display 3 (default address 0x82) if present. This tag has not been implemented yet!
3B Read GPIO1, GPIO2 and GPIO3 Inputs from LCD display 4 (default address 0x83) if present. This tag has not been implemented yet!
3C Reserved for future LCD tags
3D Reserved for future LCD tags
3E Reserved for future LCD tags
3F Reserved for future LCD tags
40 Status from UDP Event Port. Value 1=OK, 2=heartbeat

Examples:
ExampleDescription
%l00Variable group = l, Variable value = 00. This example will display the name of the user currently logged in. If the username of the user currently logged in is "Admin", then "Admin" will be displayed on the web page in stead of '%l00'
%l10.%l11.%l12.%l13Variable group = l, Variable value = 10 to 13. This example will display our IP address.


Configuration Tags

The variable group k is used for displaying the contents of the Application Configuration bytes. The values are displayed in decimal! The variable value (in uppercase hex) is used to specify the offset of the configuration byte to display. All of these Tags are Secure Tags, and will only parsed if Authentication has been provided! If no Authentication has been provided, they will return 0. The "Authentication" tag in the "General Tags" group can be used to determine if Authentication has been provided.

Examples:
ExampleDescription
%k00.%k01.%k02.%k03This example will display the currently configured IP address. If the IP address is "10.1.0.1", then "10.1.0.1" will be displayed on the web page in stead of "%k00.%k01.%k02.%k03".
%k0A.%k0B.%k0C.%k0DThis example will display the currently configured network MASK. If the MASK is "255.0.0.0", then "255.0.0.0" will be displayed on the web page in stead of "%k0A.%k0B.%k0C.%k0D".


Bus Configuration Tags

The variable group u is used for displaying the contents of the Bus Configuration bytes. The values are displayed in decimal! The variable value (in uppercase hex) is used to specify the offset of the configuration byte to display. All of these Tags are Secure Tags, and will only parsed if Authentication has been provided! If no Authentication has been provided, they will return 0. The "Authentication" tag in the "General Tags" group can be used to determine if Authentication has been provided.

Examples:
ExampleDescription
%u01This tag will be replaced with the receive buffer size of Serial Bus 1.


PWM Tags

The variable group w can be used to display the current settings of the PWM ouputs.

The following variable values(in hex) will display the current value of a PWM channel.

The SBC65EC has 4 PWM channels, so the second character can have a value from 1-4.

Variable ValueString returned by Server - displayed on web page
01 - 04PWM Channel's value as a 3 digit uppercase hex value
11 - 14Decimal value 0 - 255 (for 8-bit mode) or 0 - 1023 (for 10-bit mode)
31 - 34"<!--" returned if the PWM output is enabled
41 - 44"-->" returned if the PWM output is enabled
51 - 54"<!--" returned if the PWM output is disabled
61 - 64"-->" returned if the PWM output is disabled

The following additional variable values are defined for the PWM channels.
Variable ValueString returned by Server - displayed on web page
F0Display the set frequency value. The frequency is given by a constant value between 0 to 3.
For 8-bit mode, the following values are defined: 0 and 1=9.766kHz, 2=39.062kHz, 3=156.25kHz
For 10-bit mode, the following values are defined: 0=2.441kHz, 1=9.766kHz, 2 and 3=39.062kHz
F4Displays the set mode. A '8' indicates we are currently configured for 8-bit mode. A 'a' indicates we are currently configured for 10-bit mode.
F8Displays the enabled PWM channels. An uppercase hex value is returned that indicates what channels are enabled. Each bit in the hex value represents a PWM channel.

Examples:
ExampleDescription
%w02Variable group = w, Variable value = 0x03. This example will return the current set value of PWM channel 2. The value is represented as a 3 character long uppercase hex value.
%w14Variable group = w, Variable value = 0x14. This example will return the current set value of PWM channel 2. The value is represented as a decimal string.
%wf8Variable group = w, Variable value = 0xf8. This example will return a two byte hex value. Each bit in the byte represents a PWM channel, and indicates if it is enabled or not. For example, if only PWM channel 1 is enabled, it will return 01. If only PWM channel 3 is enabled it will return 04 (binary 00000100). If PWM channel 2 and 4 are enabled, it will return 0A (binary 00001001).


Secure Tags

The variable group s is used for displaying secure information. All of these Tags are Secure Tags, and will only parsed if Authentication has been provided! If no Authentication has been provided, they will return 0. The "Authentication" tag in the "General Tags" group can be used to determine if Authentication has been provided.

The following variable values(in hex) are defined.
Variable Value String returned by Server - displayed on web page
00 Displays the Username of the current user. For example "Guest" or "Admin". The current user will be "Guest" if the user has not provided Authentication.
01 Displays the Password of the current user.


Expansion Board Tags

The variable group x can be used to display the current settings of the Expansion Board.

The following variable values(in hex) will display the state of the expansion board's relays (if it has any).
Variable ValueString returned by Server - displayed on web page
00 - 07'1' or '0' returned depending on state of relay. 00 returns state of relay 1, 01 relay 2, ..., and 07 relay 8.
10 - 17"on" or "off" returned depending on state of relay. 10 returns state of relay 1, 11 relay 2, ..., and 17 relay 8.

The following variable values(in hex) will display the state of the expansion board's opto couple inputs (if it has any).
Variable ValueString returned by Server - displayed on web page
20 - 27'1' or '0' returned depending on state of Opto Coupled input. 20 returns state of opto 1, 21 opto input 2, ..., and 27 opto input 8.
30 - 37"on" or "off" returned depending on state of Opto Coupled input. 30 returns state of opto 1, 31 opto input 2, ..., and 37 opto input 8.

The following variable values(in hex) will display the state of the expansion board's inputs (if it has any). These tags are only currently implemented in Events.
Variable ValueString returned by Server - displayed on web page
40 - 4f'1' or '0' returned depending on state of Input. 40 returns state of input 1, 41 opto input 2, ..., and 4f input 16.

Examples:
ExampleDescription
%x02Variable group = x, Variable value = 0x02. This example will return the current state of relay 3. A '1' is returned if relay is active, and '0' if the relay of off.
%x31Variable group = x, Variable value = 0x31. This example will return the current state of opto coupler input 2. "on" is returned if it is currently on, and 'off' if it is off.


General Tags

The variable group l is used for displaying general information.

The following variable values(in hex) are defined.
Variable Value String returned by Server - displayed on web page
00 Deprecated - use the Username command in the Secure Tags group!
Displays the Username of the current user. For example "Guest" or "Admin". The current user will be "Guest" if the user has not logged in. This is a Secure Tag, and requires Authentication to be displayed!
01 Displays the TCP/IP stack version. For example "V2.04".
02 Displays the Application version. For example "V3.00".
03 Returns '1' if Authentication has been provided, else '0'.
04 Displays 'Yes' if the board has a bootloader, else 'No'
05 Displays our NetBIOS name
10 Displays first part of current IP address. For example, will be '5' if our IP is '10.1.0.5'.
11 Displays second part of current IP address.
12 Displays third part of current IP address.
13 Displays fourth part of current IP address. For example, will be '10' if our IP is '10.1.0.5'.
14 Displays first part of MAC address. For example, will be '5' if our MAC is '0.1.2.3.4.5'.
15 Displays second part of MAC address.
16 Displays third part of MAC address.
17 Displays fourth part of MAC address.
18 Displays fifth part of MAC address.
19 Displays sixth part of MAC address. For example, will be '200' if our MAC is '200.1.2.3.4.5'.
1A Displays first part of current Network MASK. For example, will be '255' if our mask is '0.0.0.255'.
1B Displays second part of current Network MASK.
1C Displays third part of current Network MASK.
1D Displays fourth part of current Network MASK. For example, will be '15' if our mask is '15.0.0.255'.
1E Displays first part of current Gateway address. For example, will be '5' if our Gateway Address is '10.1.0.5'.
1F Displays second part of current Gateway address.
20 Displays third part of current Gateway address.
21 Displays fourth part of current Gateway address. For example, will be '10' for '10.1.0.5'.
22 Displays I2C address of LCD Display 1. The default value for a Modtronix I2C LCD display is 80.
30 Read status byte of LCD display 1 (default address 0x80) if present. This tag has not been implemented yet!
31 Read status byte of LCD display 2 (default address 0x81) if present. This tag has not been implemented yet!
32 Read status byte of LCD display 3 (default address 0x82) if present. This tag has not been implemented yet!
33 Read status byte of LCD display 4 (default address 0x83) if present. This tag has not been implemented yet!
34 Read keypad data from LCD display 1 (default address 0x80) if present. This tag has not been implemented yet!
35 Read keypad data from LCD display 2 (default address 0x81) if present. This tag has not been implemented yet!
36 Read keypad data from LCD display 3 (default address 0x82) if present. This tag has not been implemented yet!
37 Read keypad data from LCD display 4 (default address 0x83) if present. This tag has not been implemented yet!
38 Read GPIO1, GPIO2 and GPIO3 Inputs from LCD display 1 (default address 0x80) if present. This tag has not been implemented yet!
39 Read GPIO1, GPIO2 and GPIO3 Inputs from LCD display 2 (default address 0x81) if present. This tag has not been implemented yet!
3A Read GPIO1, GPIO2 and GPIO3 Inputs from LCD display 3 (default address 0x82) if present. This tag has not been implemented yet!
3B Read GPIO1, GPIO2 and GPIO3 Inputs from LCD display 4 (default address 0x83) if present. This tag has not been implemented yet!
3C Reserved for future LCD tags
3D Reserved for future LCD tags
3E Reserved for future LCD tags
3F Reserved for future LCD tags

Examples:
ExampleDescription
%l00Variable group = l, Variable value = 00. This example will display the name of the user currently logged in. If the username of the user currently logged in is "Admin", then "Admin" will be displayed on the web page in stead of '%l00'
%l10.%l11.%l12.%l13Variable group = l, Variable value = 10 to 13. This example will display our IP address.


Expansion Board Tags

The variable group x can be used to display the current settings of the Expansion Board.

The following variable values(in hex) will display the state of the expansion board's relays (if it has any).
Variable ValueString returned by Server - displayed on web page
00 - 07'1' or '0' returned depending on state of relay. 00 returns state of relay 1, 01 relay 2, ..., and 07 relay 8.
10 - 17"on" or "off" returned depending on state of relay. 10 returns state of relay 1, 11 relay 2, ..., and 17 relay 8.

The following variable values(in hex) will display the state of the expansion board's opto couple inputs (if it has any).
Variable ValueString returned by Server - displayed on web page
20 - 27'1' or '0' returned depending on state of Opto Coupled input. 20 returns state of opto 1, 21 opto input 2, ..., and 27 opto input 8.
30 - 37"on" or "off" returned depending on state of Opto Coupled input. 30 returns state of opto 1, 31 opto input 2, ..., and 37 opto input 8.

Examples:
ExampleDescription
%x02Variable group = x, Variable value = 0x02. This example will return the current state of relay 3. A '1' is returned if relay is active, and '0' if the relay of off.
%x31Variable group = x, Variable value = 0x31. This example will return the current state of opto coupler input 2. "on" is returned if it is currently on, and 'off' if it is off.


Generated on Wed Feb 3 12:45:36 2010 for SBC65EC Web Server by  doxygen 1.5.8