ProSoft Technology MVI69-ADM User Manual

Page 53

Advertising
background image

MVI-ADM ♦ 'C' Programmable

Understanding the MVI-ADM API

'C' Programmable Application Development Module

Developer's Guide

ProSoft Technology, Inc.

Page 53 of 342

February 20, 2013

Data is transferred between the processor and the module using the block
identification codes of 1 to 666. The other block codes control the module from
the processors ladder logic. They are implemented when the ladder logic needs
to control the module. In order to use one of the blocks, the ladder logic inserts
the data and code in the output image of the module. The data should be set
before the code is placed in the block. This operation should be performed after
the receipt of a new write block from the module. Each set of codes is described
in the following topics.

Warm Boot Block (9998)
This block does not contain any data. When the processor places a value of
9998 in word 0 of the output image, the module will perform a warm-start. This
involves clearing the configuration and all program status data. Finally, the
program will load in the configuration information from the Flash ROM and begin
running. There is no positive response to this message other than the status data
being set to zero and the block polling starting over.

Cold Boot Block (9999)
This block does not contain any data. When the processor places a value of
9999 in word 0 of the output image, the module will perform a hardware restart.
This will cause the module to reboot and reload the program. There is no positive
response to this message other than the status data being set to zero and the
block polling starting over.

3.4.3 Serial Communications

The developer must provide the serial communication driver code. The serial API
has many useful functions to facilitate writing a driver. A sample communication
driver is included in the example programs.

3.4.4 Main_app.c

The application starts by opening the ADM API, initializing variables, structure
members and pointers to structures. Next, the database is created and initialized
to 0. The backplane driver is then opened and

startup()

is called. The function

startup(),

loads the module configuration, initializes the com. ports and finishes

by showing the application version information. Now the main loop is entered.
The processing that occurs in the loop cycles through the backplane transfer
logic, the com. driver, and the debug menu logic. If the application is quit by the
user,

shutdown()

is called. The function

shutdown()

closes the com. ports, closes

the backplane driver, closes the database and closes the ADM API.

Advertising