Specifications

B&K Components Device Interface Protocol (BKC-DIP) Specification
Version 2.01.00
Updated 01/24/07
Page 11 of 54
It is then realized that the user has misspelled. With a V1.0 BKC-DIP parser, simply retyping the
command would correct the issue as the parser would be reset upon receiving the openning “(“.
However, that is not the case with the V2.0 parser, as the parser is currently in a state of
accumulating characters for the string <“Pit> (the < and > characters added for clarity). The
parser will not interpret the “(“ character as part of the BKC-DIP syntax, but merely more of the
string <”Pit(>.
Additional Intelligence require in Host Parser
When developing a BKC-DIP V2.0 parser additional intelligence must be incorporated so BKC-
DIP syntax is not interpreted when appearing in double quoted strings. The following is pseudo
code for the state machine for such a parser:
BeginCommandState
If the character = ‘(‘
Reset state (i.e. checksum calculation
Next state = GetReceiveIDState
GetReceiveIDState
Add the character to the checksum calculation
If the character = ‘,’ or ‘:’
Indicates last character of ReceiveID
If the character = ‘:’
Next state = GetTagState
Else
Next state = FillCommandBufferState
Else
Add the character to the ReceiveID
GetTagState
Add the character to the checksum calculation
If the character = ‘,’
Indicates last character of the tag
Next state = FillCommandBufferState
Else
Add character to the tag
FillCommandBufferState
Add the character to the checksum calculation
If the character = ‘“’
Next state = QuotedStringState
Add character to command buffer
Convert the character to upper case
If the character = ‘;’
Indicates checksum possibly coming
Next state = ChecksumState
Else if the character = ‘(‘
Next state = BeginCommandState
Add character to command buffer
QuotedStringState