- Linux MultiMedia Studio Computer Accessories User Manual
Mint v4 PC Programming Guide
6
MN1278 05.2001
/* COMMS location uses */
#define CONTROL_LOCATION 1
#define PARAM_1 2
/* Flags for control location */
#define COMPLETED 0.0
#define SPECIAL_ROUTINE1 1.0
/* Create a handle to the controller */
CNextMovePC myNextMove ( NODE0, nmADDRESS );
/* Define variables */
float fErrorCode;
float fOutput = 1.0;
float fControl = SPECIAL_ROUTINE1;
/* Write to comms location */
myNextMove.setComms (NODE0, PARAM_1, &fOutput );
/* Write to comms location */
myNextMove.setComms (NODE0, CONTROL_LOCATION, &fControl );
/* Handshake to Mint program to wait for completion of function */
do {
myNextMove.getComms (NODE0, CONTROL_LOCATION, &fControl );
} while ( COMPLETED != fControl );
/* Read the data returned */
myNextMove.getComms (NODE0, PARAM_1, &fErrorCode );
Mint for NextMove:
REM COMMS location uses
DEFINE control = COMMS (1)
DEFINE param1 = COMMS (2)
REM Flags for control location
DEFINE completed = 0
DEFINE special_routine1 = 1
REM I/O
DEFINE open_gripper = OUT0 = 1
DEFINE gripper_fully_open = IN6 = 1
DEFINE gripper_error = IN7
WHILE 1
IF control = special_routine1 DO
OUT1 = param1 : REM Use param supplied by top end
open_gripper
PAUSE gripper_fully_open: REM Wait for an event
param1 = gripper_error: REM Data to pass back to host
control = completed : REM synchronise with host
ENDIF
ENDW