BASIC commands
PROGRAMMING MANUAL 70
Revision 1.0
3.2.67 COS
/i
3.2.68 CRC16
/i
Example MOVEABSSP(x,y)
IF CHANGE_DIR_LAST>RAISE_ANGLE THEN
WAIT UNTIL CORNER_STATE>0
GOSUB raise
CORNER_STATE=3
WA(10)
WAIT UNTIL VP_SPEED AXIS(2)=0
GOSUB lower
CORNER_STATE=0
ENDIF
See also CORNER_MODE, RAISE_ANGLE, FHSPEED
Type Mathematical function
Syntax COS(expression)
Description The COS function returns the cosine of the expression. Input values are in
radians and may have any value. The result value will be in the range from -1
to 1.
Arguments • expression
Any valid BASIC expression.
Example >> PRINT COS(0)
1.0000
See also N/A
Type System command
Syntax mode=0: CRC16(mode, poly)
mode=1: CRC16(mode, data_source, start, end, reg)
Description Calculates the 16 bit CRC of data stored in contiguous Table Memory or VR
Memory locations.
Arguments • mode
Specifies the mode of the command.
0 = Initialises the command with the Polynomial
1 = Returns the CRC. Will return 0 if Initialise has not been run
• poly
Polynomial used as seed for CRC check range 0-65535 (or 0-$FFFF)
• data_source
Defines where the data is loaded
0 = TABLE memory
1 = VR memory
• start
Start location of first byte
• end
End location of last byte
• reg
Initial CRC value. Normally $0 - $FFFF
Example Using TABLE memory:
poly = $90d9
reginit = $ffff
CRC16(0, poly) 'Initialise internal CRC table memory
TABLE(0,1,2,3,4,5,6,7,8) ‘Load data into table memory location 0-7
calc_crc = CRC16(1,0,0,7,reginit) 'Source Data=TABLE(0..7)
Example Using VR memory:
poly = $90d9
reginit = $ffff
CRC16(0, poly) 'Initialise internal CRC table memory
‘Load 6 bytes into VR memory location 0-5
FOR i=0 TO 5
VR(i)=i+1
NEXT i
calc_crc = CRC16(1,1,0,5,reginit) 'Source Data=VR(0)..VR(5)
See also N/A