ProSoft Technology MVI69-ADM User Manual
Page 58

Understanding the MVI-ADM API
MVI-ADM ♦ 'C' Programmable
Developer's Guide
'C' Programmable Application Development Module
Page 58 of 342
ProSoft Technology, Inc.
February 20, 2013
Software
The following is a code sample designed to illustrate the steps required to
transmit in RS-485. Depending on the application, it may be necessary to handle
other processes during this transmit sequence and to not block. This is simplified
to demonstrate the steps required.
int length = 10;
// send 10 characters
int CharsLeft;
BYTE buffer[10];
// Set RTS on
MVIsp_SetRTS(COM2, ON);
// Optional delay here (depends on application)
// Transmit message
MVIsp_PutData(COM2, buffer, &length, TIMEOUT_ASAP);
// Check to see that message is done
MVIsp_GetCountUnsent(COM2, &CharsLeft);
// Keep checking until all characters sent
while(CharsLeft)
{
MVIsp_GetCountUnsent(COM2, &CharsLeft);
}
// Optional delay here (depends on application)
// Set RTS off
MVIsp_SetRTS(COM2, OFF);
3.4.8 Using Compact Flash Disks
In order to use Compact Flash disks, you must enable Compact Flash in BIOS
Setup. Once enabled, the Compact Flash Disk should appear as a DOS C: drive.
Use standard 'C' file access functions to read and write to the Compact Flash
disk.