Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 514 of 909
LEN1
Length of Character Count in Communications Port 1
APPLICATION: Communications control
DESCRIPTION: Number of characters in channel 1 receive buffer
EXECUTION: Immediate
CONDITIONAL TO: Communications channel 1 must be open in data mode-
LIMITATIONS: Maximum buffer length is 31 characters
READ/REPORT: RLEN1
WRITE: Read only
LANGUAGE ACCESS: Formulas and conditional testing
UNITS: Number of available characters
RANGE OF VALUES: 0 to 31
TYPICAL VALUES: 0 to 31
DEFAULT VALUE: 0
FIRMWARE VERSION: 5.0.x, 5.16.x or 5.32.x series only
COMBITRONIC: N/A
DETAILED DESCRIPTION:
The LEN1 command checks the receive buffer of serial communications channel 1 and returns
the number of characters that are waiting to be processed. Testing the value of LEN1 is a good
way to see if there is a character waiting for retrieval with GETCHR1 command (see the
following example).
NOTE: M-style motors do not have the second communications port (COM 1)
needed to support the LEN1 and GETCHR1 commands.
EXAMPLE:
i=0
IF LEN1>0 'Any data received?
GOSUB5 'If so, process data
ENDIF
END
C5
ab[i]=GETCHR1 'Read and store in data
'Process incoming data
i=i+1 'Maintain reference index
RETURN
From the above example, "i" will be equal to LEN1.
Part 2: Commands: LEN1