You are here: Elements > Frame Recognizers > Frame Recognizers Included with Protocol Analyzer

Frame Recognizers Included with Protocol Analyzer

Frame Recognizers are not exactly methods, but they are necessary components for some decoders. The protocol analyzer includes some standard frame recognizers that may serve your needs. To invoke a frame recognizer for a protocol, put the following statement in the Reference section of your decoder (the section after the decoder ID and before the DECODE keyword):

RECOGNIZER (Recognizer Name)

Following are some recognizers included with the protocol analyzer and how they determine the beginning and end of frames.

Recognizer Names
Name Description
HalfDuplex Assumes a frame is everything in a stream or channel until a byte comes in from another stream
ParityError When a parity error is detected, end the previous frame and begin the next.
TimeGap Determines framing by comparing the timestamp of the current byte to the previous byte. This recognizer takes a parameter representing the gap between frames. The parameter is expressed in milliseconds. For example, (TimeGap 3) means a gap of greater than 3 milliseconds between bytes will end the previous frame and begin the next.
SignalChange Framing is controlled by a control signal. This method takes two parameters: an integer representing the control signal used for side A, and an integer representing the control signal used for side B. The Frame Recognizer only looks at the signal states for data bytes, not at signal change events that happen independent of receiving a data byte. Hence, a signal change marking the end of a frame, that occurs independent of a data byte, will be missed by the recognizer.

In the Signal Change recognizer, which signal to look for and whether to look for it going on or off is encoded in 16 bits. The highest bit determines whether to look for the signal going on or off. 1=on, 0=off. The bits for the signals are:

RTS 0x01
CTS 0x02
DSR 0x04
DTR 0x08
CD 0x10
RI 0x20

You can set the recognizer to look for more than one signal, though all signals to watch for must go either on or off. In other words, you can't look for RTS going high and CTS going low as the start of a frame.

For example, to start a frame when RTS goes on and end it when CTS and DSR go off, use the following:

RECOGNIZER (SignalChange 0x80010006 0x80010006

1000 (SOF when the following goes high)
0001 (RTS is the only signal to pay attention to)
0000 (EOF when the following goes low)
0110 (pay attention to CTS and DSR).

You have to give the number twice because the first number is for channel A and the second for channel B, where the channels are often DTE and DCE in an asynchronous circuit..