|
|
ultimo aggiornamento 24 agosto 2010 |
SET COMANDI DISPONIBILI (FIRMWARE 1.4.3)
In questa tabella sono riassunti i comandi con la lori sintassi disponibile per il firmware nella versione 1.4.3. Altre informazioni più complete ed aggiornate possono essere trovate sul sito dell'autore http://www.schmalzhaus.com/UBW/
| Comando | Descrizione | Sequenza comandi seguita da <CR> | Esempio | Valore di ritorno |
| R | Reset | R | "R" | "OK" |
| C | Configura pin di I/O e analogici | C,<DirA>,<DirB>,<DirC>,<AnalogEnableCount> <DirA>,<DirB>,<DirC> = [0..255]; Output(0), Input(1) for each bit. <AnalogEnableCount>=[0..12]; Number of I\Os to enable for analog input. |
"C,4,245,52,0" | "OK" |
| O | Uscita porta digitale | O,<PortA>,<PortB>,<PortC> <PortX>=[0..255]; Output value to each port |
"O,0,255,22" | "OK" |
| I | Input from
digital ports Returns decimal values for PortA, PortB, and PortC separated by commas. |
I | "I" | "I,001,045,205" |
| V | Restituisce la versione del firmware | V | V" | "UBW FW D Version 1.4.3" |
| A | Analog
input request Returns decimal values for all enabled analog inputs separted by commas. |
A | "A" | "A,0145,1004,0000,0045" |
| T | Timed I\O
(digital and analog) Periodically returns “I” and “A” packets |
T,<Time>,<Mode> <Time>=[1..30000]; Time in units of ms. <Mode>=[0,1]; Digital “I” packets (0), Analog “A” packets (1) |
"T,100,0" | "OK" |
| PI | Pin Input
read Returns decimal value of Port AND’ed with 2^^<Pin> |
PI,<Port>,<Pin> <Port> = [A,B,C] <Pin>=[0..7] |
"PI,C,6" | "PI,<Value>" |
| PO | Pin Output
write Writes to bit <Pin> |
PO,<Port>,<Pin>,<Value> <Port> = [A,B,C] <Pin>=[0..7] <Value>=[0..255] |
"PO,A,3,0" | "OK" |
| PD | Pin Direction set | PD,<Port>,<Pin>,<Direction> <Port> = [A,B,C] <Pin>=[0..7] <Direction>=[0,1] ; Output(0), Input(1) |
"PD,A,3,0" | "OK" |
| MR | Legge una locazione di memoria | MR,<Address> <Address>=[0..4095]; RAM address |
"MR,3968" | "MR,28" |
| MW | Scrive in una locazione di memoria | MW,<Address>,<Value> <Address>=[0..4095]; RAM address <Value>=[0..255] |
"MW,3968,56" | "OK" |
| CU | Configure
UBW Setting parameter 1 to a value of 0 turns off the “OK” response. |
CU,<Parameter>,<Value> <Parameter>=[0..255]; <Value>=[0..255] |
"CU,1,0" | "OK" |
| RC | RC servo pulse output | RC,<Port>,<Pin>,<Value> <Port> = [A,B,C] <Pin>=[0..7] <Value>=[0..11890] |
"RC,B,3,5945" | "OK" |
| BO | Bulk digital Output** |
BO,<ASCII_HEX_Bytes> <ASCII_HEX_Bytes>=[00..FF]xN; Each byte in Hex is concatenated. |
"BO,55A721" | "OK" |
| BC | Bulk digital Configure** | BC,<Init>,<WaitMask>,<WaitDelay>,<StrobeMask>,<StrobeDelay> <Init>=[0..255]; <Init> is initial value written to PortA. <WaitMask>=[0..255]; “Busy” bit mask used if <WaitDelay> > 0. <WaitDelay>= [0..255]; Units of 400ns. <StrobeMask>=[0..255]; XOR’ed with <Init> for strobe signal. <StrobeDelay>=[0..255]; Units of 830ns. |
"BC,1,1,1,1,1" | "OK" |
| BS | Binary Send to parallel output** | BS,<ByteCount>,<BinaryStreamOfBytes> <ByteCount>=[1..56]; Number of bytes to be written <BinaryStreamOfBytes>= Sequence of 8 bit characters to be written |
"BS,3,#Ij" | "OK" |
Lista messaggi di errore:
"! 0" (non utilizzato)
"! 1" (non utilizzato)
"!2 Err: TX Buffer overrun"
Questo errore è generato se, per qualche ragione, il codice interno della
UBW tenta di inviare troppi dati al PC in una sola volta.
"!3 Err: RX Buffer overrun"
Questo errore è generato se, mentre il UBW sta ricevendo dati dal PC, il
buffer di ricezione interno è troppo pieno.
"!4 Err: Missing parameter(s)"
Il UBW invierà questo errore se si aspettava di trovare un altro parametro
nel comando, ma invece trovato un <CR> o <LF>.
"!5 Err: Need comma next, found: '<some_char>'"
Il UBW invierà questo errore se si aspettava di trovare una virgola, ma ha
trovato qualcos'altro. Il <some_char> sarà il carattere che ha trovato
al posto
della virgola.
"!6 Err: Invalid parameter value"
Questo errore significa che l'UBW ha trovato un parametro, ma il suo valore
era al di fuori del range accettabile.
"!7 Err: Extra parameter"
Questo errore indica che il UBW aspettato di vedere un <LF> o <CR>, ma invece
ha trovato una virgola in più o un parametro in
più.
"!8 Err: Unknown command '<command_chars>"
Questo errore indica che il nome o singolo comando non è stato
capito o non esiste. <command_chars> sarà uno o due byte che il UBW ricevuto
che non corrisponde ad alcun comando.
| Elenco revisioni | |
| 24/08/2010 | Emissione preliminare |