- Linux MultiMedia Studio Computer Accessories User Manual
Communicating with a Controller
MN1278 05.2001
7
2.5 Interfacing with Mint
The Mint command line allows manual execution of Mint keywords. Using the Mint WorkBench, the Mint
command line can be used when testing, commissioning and debugging Mint programs.
There are several functions in the Mint Interface Library for direct access to the serial buffer:
setSerialChar, setSerialCharTimeout, setSerialStringTimeout, getSerialChar, getSerialCharTimeout and
getSerialStringTimeout.
These allow characters and strings to be passed to and from a Mint application. A Mint application may use the
serial buffer for program control, user information or debug information.
For example:
myNextMoveBX.setSerialStringTimeout ( “MA.0=100:GO.0\n”, 100).
2.5.1 Preventing Deadlock Situations
If Mint has a character to write to the serial port, it will wait indefinitely until there is a space in the transmit
buffer. This means that the serial buffer must be emptied by the host application for the Mint program to
proceed. There are several ways of doing this:
Call one of the read functions e.g. getSerialChar until the buffer is emptied.
Set the terminal mode to be overwrite or off. The terminal mode controls how the serial buffer is used. If the
mode is overwrite, then the oldest characters in the buffer are overwritten by the new characters. If the mode is
off, all characters are discarded as they are placed in the buffer. See the TERMINALMODE keyword in the Mint
v4 Programming Guide for further details.
The functions setTerminalmode (tmRS232, tmmOVERWRITE) will set the terminal mode on the RS232 port to
be overwrite. setTerminalmode (tmDPR, tmmOFF) will disable all serial communications on the pseudo serial
buffer on NextMove PC or PCI.
The terminal mode can also be set for NextMove PC and PCI when firmware is downloaded to the controller.
Specify TRUE for the bEchoOverwrite parameter of doUpdateFirmware / doUpdateFirmwareEx. This will set
the pseudo-serial communications into overwrite mode.
To download and upload and Mint program and configuration files to Mint, the functions doMintFileDownload
and doMintFileUpload are used. These are unaffected by the setting of terminalmode.