Commands

Introduction

Commands can be sent to the target board via UDP messages, or the HTTP GET command. All commands follow the HTTP GET syntax of name=value.

For example, to set Port pin A2, we can:
Send the following HTTP GET command to the target board:
http://10.1.0.1/?a2=1
Or we can send the following UDP message to the UDP Command Port:
a2=1

In this example the name part is "a2" and the value part is '1'.

UDP Commands

Any of the commands listed below can be executed on the target by sending them to UDP port 54123. This port is configurable, and can be changed.

For example, to set Port pin A2, we can send the following UDP message to the target board:
a2=1

Multiple commands can be send by seperating each command with a '&' character. For example, to set Port pin A2, and clear Port C0, we can send the following UDP message to the target board:
a2=1&c0=0

HTTP GET Commands

Any of the commands listed below can be executed on the target by using the HTTP GET command. To issue a HTTP GET command, simply append the command to the web page address, after a '?' character.

For example, to set Port pin A2, we can send the following HTTP GET command to the target board:
http://10.1.0.1/?a2=1

Multiple commands can be send by seperating each command with a '&' character. For example, to set Port pin A2, and clear Port C0, we can send the following HTTP GET command to the target board:
http://10.1.0.1/?a2=1&c0=0

For details, see CGI

Defined Commands

The following list of commands are implemented by the Modtronix SBC65EC Web Server in the "httpexec.c" file. This file can be modified by the user to add aditional commands:


Port Commands

The following syntax is used in the Port commands:

The following Port commands are implemented by the Modtronix SBC65EC Web Server.
Command SyntaxDescription
p=XXSet Port - set the given Port to the given hex value. The given hex value (XX part or command) must be in uppercase! For example:
"a=8A" will set Port A to 0x8A.
p[0-7]=[1,0]Set Port Pin - set or clear the given Port pin. For example:
"a0=0" will clear Port A0 (Port A, pin 0)
"f7=1" will set Port F7 (Port F, pin 7)
px[0-7]=[1,0]Inverted Set Port Pin - Set or clear the given Port pin. The value is inverted! For example:
"ax0=0" will set Port A0 (Port A, pin 0)
"fx7=1" will clear Port F7 (Port F, pin 7)
p[0-7]r=[1,0]Set Port Pin, Remember - - Same as "Set Port Pin" command, except that the settings are saved to the application configuration, and are remembered after power up.
p[0-7]p=[0-9]Pulse Port Pin, Positive - The given Port pin is set high and then low again. The value gives the 'pulse width' specifying for how many micro seconds the pin should be kept high. If 0, the pin is kept high for a minimum time, which is usually between 200ns to 400ns. For example:
"a0p=0" will set Port A0 high and after 200ns to 400ns low again
"f7p=9" will set Port F7 high and after 9us low again
p[0-7]n=[0-9]Pulse Port Pin, Negative - The given Port pin is set low and then high again. The value gives the 'pulse width' specifying for how many micro seconds the pin should be kept low. If 0, the pin is kept low for a minimum time, which is usually about 200ns to 400ns. For example:
"a0n=0" will set Port A0 low and after 200ns to 400ns high again
"f7n=5" will set Port F7 low and after 5us high again
pc[0-7]=[1,0]Port Pin Configuration - Configure given Port pin as input or output. '0' will configure pin to be an output, and '1' an input. The port direction configured with this command will NOT be remembered after the next power up, use the "Port Pin Configuration, Remember" command to achieve this! Example to use this command:
"ac0=0" will configure Port A0 (Port A, pin 0) to be an output.
"fc7=1" will configure Port F7 (Port F, pin 7) to be an input
pc[0-7]r=[1,0]Port Pin Configuration, Remember - Same as "Port Pin Configuration" command, except that the settings are saved to the application configuration, and are remembered after power up.

Examples:
Example GET commandDescription
f=01This example will set Port F to 0x01
c5=1This example will set Port C5
bx0=1This example will clear Port B0
An example of sending a GET command to a target board with an IP address of "10.1.0.1" is:
http://10.1.0.1/?f=01
This command can be sent by entering the line above in a standard web browser, or could be send by custom software.


Application Config Commands

The Application Config Command is used to modifying the Application Configuration bytes. To see what can be configured with this command, please have a look at the list of Application Configuration bytes.

The following Config commands are implemented by the Modtronix SBC65EC Web Server.
Command Syntax Description
kxx=[0-255] Set Config Byte to given decimal value - set the given config byte to the given decimal value. The 'xx' part gives the offset (in uppercase hex) of the config byte in the Application Configuration bytes structure. The value has to be a decimal number from 0 - 255.
Examples to use this command:

"k00=100" Will set the the "Application Configuration byte" at 0x00 (MSB of IP address) to 100

"k2A=16" Will set the "Application Configuration byte" at 0x2A (Port F direction) to 16 (0x0f). Address 0x2A contains the TRIS register for Port F. Setting a bit to 0 will configure the port as an output, and 1 as an input. In this example we set TRISF to 0x0f = binary 00001111. This will configure port F pins 0-3 as inputs, and pins 4-7 as outputs.

"k2F=16" Will set the "Application Configuration byte" at 0x2F (Port F default value) to 10 (0x0a). Address 0x2F contains the default value for Port F at power up. In this example we set it to 0x0a = binary 00001010. This will set the default value of port F pins 1 and 3 to 1 (5V), and pins 0, 2, 4, 5, 6, 7 to 0 (0V) at power up.

kxx=Hyy Set Config Byte to given hex value - set the given config byte to the given hex value. The 'xx' part gives the offset (in uppercase hex) of the config byte in the Application Configuration bytes structure. The value ('yy' part of command) has to be an uppercase hex value from 00 - FF.
Examples to use this command:

"k00=H1F" Will set the "Application Configuration byte" at 0x00 (MSB of IP address) to 0x1F

kxxmzz=Hyy Set Config Byte to given hex value, using mask - set the given config byte to the given hex value, using the given mask. The 'xx' part gives the offset (in uppercase hex) of the config byte in the Application Configuration bytes structure. The 'zz' part gives the mask (in uppercase hex) of the bits in the config byte to change. If the mask is 00, no bits are changed. If the mask is FF, all bits are set to the given value. The value ('yy' part of command) has to be an uppercase hex value from 00 - FF.
Examples to use this command:

"k05m04=HFF" Will set the third bit (bit position 2) of the "Application Configuration byte" at 0x05.

"k1Am80=H00" Will clear the eighth bit (bit position 7) of the "Application Configuration byte" at 0x1A.

kxxby=[0,1] Set or Clear bit in Config Byte - set or clear a bit in the given config byte to the given value. The 'xx' part gives the offset (in uppercase hex) of the config byte in the Application Configuration bytes structure. The 'y' part gives the position (value from '0' to '7') of the bit in the config byte to change. The value has to be a '0' or '1' character, indicating if the given bit is to be cleared or set.
Examples to use this command:

"k05b6=1" Will set the seventh bit (bit position 6) of the "Application Configuration byte" at 0x05.

"kA5b0=0" Will clear the first bit (bit position 0) of the "Application Configuration byte" at 0xA5.

Examples:
An example of sending a GET command to a target board with an IP address of "10.1.0.1" is:
http://10.1.0.1/?k1A=22
This command can be sent by entering the line above in a standard web browser, or could be send by custom software.
An example of sending a GET command to a target board with an NetBIOS address of "MXBOARD" is:
http://mxboard/?k1A=22
This command can be sent by entering the line above in a standard web browser, or could be send by custom software.


Bus Config Commands

The Bus Config Command is used to modifying the Bus Configuration bytes. To see what can be configured with this command, please have a look at the list of Bus Configuration bytes. This command has exactly the same systext as the Application Config Commands command, except that it starts with a 'u' in stead of a 'k' character.


General Commands

The General command has the following syntax: "lx=v"

The following General commands are implemented by the Modtronix SBC65EC Web Server.
Command Syntax Description
la=str New Username - assigns a new Username. The given "str" is the new username, and must be an alpha numeric string of 1 to 8 characters. For example:
"la=wombat" will set the new username to "wombat".
lb=str New Password - assigns a new Password. The given "str" is the new password, and must be an alpha numeric string of 1 to 8 characters. For example:
"lb=gumtree" will set the new username to "gumtree".
le=XX Enable Events. This command will enable/disable the given Event ports. The command value (XX part) is a two character, uppercase hex value indicating which ports are to be enabled. Each bit in the byte represents an Event Port. Bit 0 represents the UDP event port, bits 1 to 7 are reserved for future use.
Examples to use this command are:
"le=01" will enable the UDP event port, and disable all others.
"le=00" will disable all event ports.
lk=str Write Byte Array to LCD Display - write given bytes to the LCD display. A '_' escape character can be used to send hex values. The two bytes following the escape character gives the hex code. See LCD2S documentation for list of all commands, and their syntax. For example, the syntax for the LCD brighness command is "0x81, value", where value is the new brightness value in hex from 00-FF (decimal 0-255). To set the brighness to a hex value of A0 (160 decimal), the following command can be send:
"lk=_81_A0"
To instruct the LCD display to remember the brightness setting after the power is removed, the command above must be preceded by a "Remember Command" (0x8D). Commands are seperated by a '&' character. The syntax for sending a remember command, followed by the set brighness command shown above will be:
"lk=_8D&lk=_81_A0"

To include a '_' character, two '_' characters must be send after each other.
ll=str Write String to LCD Display - writes the given string to the LCD display. A '_' escape character can be used to include one of the following LCD string escape sequences:
_n = Go to beginning of next line.
_f = Clear display and go to beginning of first line.
_r = Go to beginning of first line
_b = Cursor left
_t = Cursor Right For example:

Clear display, go to the beginning of the first line and write "Hello":
"ll=_fHello"

Clear display, write "Hello" on first line, and "world" on second line:
"ll=_fHello_nworld"

To include a '_' character, two '_' characters must be send after each other.
ln=str New NetBIOS name - assigns a new NetBIOS name. The given "str" is the new name, and must be an alpha numeric string of 1 to 15 characters. For example:
"lb=CROC1" will set the new username to "CROC1".

Examples:
The following example will log in an user with username="admin" and password="pw" to a target with an IP address of "10.1.0.1":
http://10.1.0.1/?lu=admin&lp=pw
This command can be sent by entering the line above in a standard web browser, or could be send by custom software.


Short Commands

Short commands do not have any command operands. They always have the following syntax: "m=v"

The following Short commands are implemented by the Modtronix SBC65EC Web Server.
Command Syntax Description
m=r Reset Board - reset's the board. This command can be used to remotely reset the board. This can be used to update the firmware via the network bootloader for example.
m=o Log Out - log out the current user. This command is only used for the HTTP Get Method!
m=l Log In - For Web Server, this command will request the user to log in.

Examples:
The following example will reset a target with an IP address of "10.1.0.1":
http://10.1.0.1/?m=r
This command can be sent by entering the line above in a standard web browser, or could be send by custom software.


Serial Communication Commands

The following Serial Communication commands are implemented by the Modtronix SBC65EC Web Server. To be added in future version !


PWM Commands

The following PWM (Pulse Width Modulator) commands are implemented by the Modtronix SBC65EC Web Server. These commands are used to enable and set the frequency and values of the PWM channels.

Command Syntax Description
w[1-4]=[0-1023] Set PWM Value. This command will set the value (Duty Cycle) of the given PWM channel. The possible values must be in the range 0-255 for 8-bit mode, and 0-1023 for 10-bit mode. A value of 0 will give a duty cycle of 0% (output off), where a maximum value will give a duty cycle of 100% (permanently on).
Examples to use this command:
"w1=128" will set the duty cycle of PWM channel 1 to 50% when in 8-bit mode
"w3=256" will set the duty cycle of PWM channel 3 to 25% when in 10-bit mode
w[1-4]r=[0-1023] Set PWM Value, Remember. Same as the Set PWM Value command, except that the settings are saved to the application configuration, and are remembered after power up.
wf=[0-3] Set PWM Frequency. This command will set the PWM frequency. The available frequencies depends on the PWM mode (8-bit or 10-bit) used. 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
wfr=[0-3] Set PWM Frequency, Remember. Same as the Set PWM Frequency command, except that the settings are saved to the application configuration, and are remembered after power up.
we=XX Enable PWM Channels. This command will enable/disable the given PWM channels. The command value (XX part) is a two character, uppercase hex value indicating which channels are to be enabled. Each bit in the byte represents a PWM channel. Bit 0 represents PWM channel 1, bit 1 PWM channel 2, ...., and bit 7 PWM channel 8. The SBC65EC has 4 PWM channels (C1, C2, G0 and G3), so only the fist 4 bits are used.

Examples to use this command are:
"we=00" will disable all channels
"we=1F" will enable PWM channels 1 to 5, and disable all the rest (if any)
"we=14" will enable PWM channel 3 and 5, and disable all the rest (if any)

wer=XX Enable PWM Channels,Remember. Same as the Enable PWM Channels command, except that the settings are saved to the application configuration, and are remembered after power up.
wm=[8,a] Set PWM Mode. This command will set the PWM mode. When the value is '8', the mode is set to 8-bit mode. When the value is 'a', the mode is set to 10-bit mode.
wmr=[8,a] Set PWM Mode, Remember. Same as the Set PWM Mode command, except that the settings are saved to the application configuration, and are remembered after power up.

Examples:
The following example will enable PWM channels 1 and 2 (bit 0 and 1 = hex 0x03) of a target with a NetBIOS address of "MXBOARD":
http://MXBOARD/?we=03
This command can be sent by entering the line above in a standard web browser, or could be send by custom software.


Expansion Board Commands

The following Expansion Board commands are implemented by the Modtronix SBC65EC Web Server. These commands are used to configure and control a possible expansion board that could be plugged into the daughter board connector of the SBC65EC.
Command Syntax Description
xr1=[0,1] Set Relay 1 of Expansion board - 0 will turn relay off, 1 will turn it on. Only executed if expansion board has such a relay.
xr2=[0,1] Set Relay 2 of Expansion board - 0 will turn relay off, 1 will turn it on. Only executed if expansion board has such a relay.
xr3=[0,1] Set Relay 3 of Expansion board - 0 will turn relay off, 1 will turn it on. Only executed if expansion board has such a relay.
xr4=[0,1] Set Relay 4 of Expansion board - 0 will turn relay off, 1 will turn it on. Only executed if expansion board has such a relay.
xr5=[0,1] Set Relay 5 of Expansion board - 0 will turn relay off, 1 will turn it on. Only executed if expansion board has such a relay.
xo1=[0,1] Set Digital Output 1 - 0 will turn output off (set to 0V for most boards), 1 will turn it on (set to 5V for most boards). Only executed if expansion board has such an output, and it is enabled.
xo2=[0,1] Set Digital Output 2 - 0 will turn output off (set to 0V for most boards), 1 will turn it on (set to 5V for most boards). Only executed if expansion board has such an output, and it is enabled.
xo3=[0,1] Set Digital Output 3 - 0 will turn output off (set to 0V for most boards), 1 will turn it on (set to 5V for most boards). Only executed if expansion board has such an output, and it is enabled.
xo4=[0,1] Set Digital Output 4 - 0 will turn output off (set to 0V for most boards), 1 will turn it on (set to 5V for most boards). Only executed if expansion board has such an output, and it is enabled.
xo5=[0,1] Set Digital Output 5 - 0 will turn output off (set to 0V for most boards), 1 will turn it on (set to 5V for most boards). Only executed if expansion board has such an output, and it is enabled.
xo6=[0,1] Set Digital Output 6 - 0 will turn output off (set to 0V for most boards), 1 will turn it on (set to 5V for most boards). Only executed if expansion board has such an output, and it is enabled.
xo7=[0,1] Set Digital Output 7 - 0 will turn output off (set to 0V for most boards), 1 will turn it on (set to 5V for most boards). Only executed if expansion board has such an output, and it is enabled.
xo8=[0,1] Set Digital Output 8 - 0 will turn output off (set to 0V for most boards), 1 will turn it on (set to 5V for most boards). Only executed if expansion board has such an output, and it is enabled.

Examples:
Example GET commandDescription
xr1=1This example will set enable relay 1
xr3=0This example will set disable relay 3
xo2=1This example will set digital output 2
An example of sending a GET command to a target board with an IP address of "10.1.0.1" is:
http://10.1.0.1/?xr3=0
This command can be sent by entering the line above in a standard web browser, or could be send by custom software.


General Commands

The General command has the following syntax: "lx=v"

The following General commands are implemented by the Modtronix SBC65EC Web Server.
Command Syntax Description
la=str New Username - assigns a new Username. The given "str" is the new username, and must be an alpha numeric string of 1 to 8 characters. For example:
"la=wombat" will set the new username to "wombat".
lb=str New Password - assigns a new Password. The given "str" is the new password, and must be an alpha numeric string of 1 to 8 characters. For example:
"lb=gumtree" will set the new username to "gumtree".
lk=str Write Byte Array to LCD Display - write given bytes to the LCD display. A '_' escape character can be used to send hex values. The two bytes following the escape character gives the hex code. See LCD2S documentation for list of all commands, and their syntax. For example, the syntax for the LCD brighness command is "0x81, value", where value is the new brightness value in hex from 00-FF (decimal 0-255). To set the brighness to a hex value of A0 (160 decimal), the following command can be send:
"lk=_81_A0"
To instruct the LCD display to remember the brightness setting after the power is removed, the command above must be preceded by a "Remember Command" (0x8D). Commands are seperated by a '&' character. The syntax for sending a remember command, followed by the set brighness command shown above will be:
"lk=_8D&lk=_81_A0"

To include a '_' character, two '_' characters must be send after each other.
ll=str Write String to LCD Display - writes the given string to the LCD display. A '_' escape character can be used to include one of the following LCD string escape sequences:
_n = Go to beginning of next line.
_f = Clear display and go to beginning of first line.
_r = Go to beginning of first line
_b = Cursor left
_t = Cursor Right For example:

Clear display, go to the beginning of the first line and write "Hello":
"ll=_fHello"

Clear display, write "Hello" on first line, and "world" on second line:
"ll=_fHello_nworld"

To include a '_' character, two '_' characters must be send after each other.
ln=str New NetBIOS name - assigns a new NetBIOS name. The given "str" is the new name, and must be an alpha numeric string of 1 to 15 characters. For example:
"lb=CROC1" will set the new username to "CROC1".

Examples:
The following example will log in an user with username="admin" and password="pw" to a target with an IP address of "10.1.0.1":
http://10.1.0.1/?lu=admin&lp=pw
This command can be sent by entering the line above in a standard web browser, or could be send by custom software.


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