Professional Documents
Culture Documents
PC-based Communication
Controller
User's Manual
Copyright Notice
This document is copyrighted, 1997, by Advantech Co., Ltd. All rights are reserved.
Advantech Co., Ltd. reserves the right to make improvements to the products described in this
manual at any time without notice.
No part of this manual may be reproduced, copied, translated or transmitted in any form or by
any means without the prior written permission of Advantech Co., Ltd. Information provided in
this manual is intended to be accurate and reliable. However, Advantech Co., Ltd. assumes
no responsibility for its use, nor for any infringements upon the rights of third parties which may
result from its use.
Acknowledgments
Table of Contents
Page 2
ADAM-4500 Users Manual
The module is much like a compact computer, and includes an 80188 CPU, 256 KB Flash ROM,
256 KB SRAM, COM1, COM2, and a program download port. Its built-in ROM-DOS is an
MS-DOS equivalent operating system, which provides all of the basic functions of MS-DOS
except for BIOS. A user can run standard PC software and application programs, written in high
level languages such as C or C++, within the ROM-DOS environment. Moreover, the module
also provides free ROM memory for application downloading and free RAM memory for
application operation.
The ADAM-4500 has two communication ports to let the controller easily communicate with the
other devices in your application. The COM1 port can be configured as an RS-232 or an
RS-485 communication interface via the jumper setting. The COM2 port is dedicated as an
RS-485 port. This unique design makes the controller suitable for use in a variety of
applications.
The controller also includes a real-time clock and a watchdog timer function. The real-time clock
ensures time recording while events occur. The watchdog timer is designed to automatically
reset the microprocessor when the system fails. This feature greatly reduces the level of
maintenance required and makes the ADAM-4500 ideal for use in applications that require a
high level of system stability.
1.2 Features
Built-in boot ROM-DOS to run PC programs
Free ROM/RAM memory for user's applications
2-wire, multi-drop RS-485 networking
Communication speed up to 115.2 Kbps
RS-232/RS-485 modes (jumper selectable)
Automatic data flow control in RS-485 mode
Built-in real-time clock and watchdog timer
Easy mounting on a DIN-rail or panel
Program download cable and utility included
1.3 Specifications
System
CPU: 80188-40
Flash ROM: 256 KB (170 KB free memory for users)
Operating system: Boot ROM-DOS
SRAM: 256 KB ( 234 KB free memory for users)
Timer BIOS: Yes
Real-time clock: Yes
Watchdog timer: Yes
COM1: RS-232/RS-485
COM2: RS-485
Program download port (RS-232): Tx, Rx, GND
Page 3
ADAM-4500 Users Manual
RS-232 Interface
Signals: TxD, RxD, RTS, CTS, DTR, DSR, DCD, RI, GND
Mode: Asynchronous full duplex, point to point
Connector: DB-9 pin
Transmission speed: up to 115.2 Kbps
Max transmission distance: 50 feet (15.2 m)
RS-485 Interface
Signals: DATA+, DATA-
Mode: Half-duplex, multi-drop
Connector: Plug-in terminal block
Transmission speed: up to 115.2 Kbps
Max transmission distance: 1220 m (4000 feet)
Power
Unregulated +10 to +30 VDC
Protected against power reversal
Power consumption: 2.0 W
Mechanical
Case: ABS with captive mounting hardware
Plug-in screw terminal block:
Accepts 0.5 mm2 to 2.5 mm2, 1 - #12 or 2 - #14 to #22 AWG
Environment
Operating temperature: -10 to 70C (14 to 158F)
Storage temperature: -25 to 70C (-13 to 158F)
Humidity: 5 to 95 %, non-condensing
ADAM-4500
Page 4
ADAM-4500 Users Manual
Page 5
ADAM-4500 Users Manual
SRAM
RS232/485 COM#1
Tranceiver UART
16 Bit FLASH ROM
up
RS-485 COM#2
Tranceiver UART RTC
Programming
Port
Tranceiver
+5V
GND
WDT&Reset
+5V
GND
Power
+10V to 30Vdc
Converter
Page 6
ADAM-4500 Users Manual
Host computer
Any computer that is IBM PC/AT compatible which can run and write programs in an MS-DOS
environment, and provides an RS-232 communication port to allow users to download programs
into the ADAM-4500, can function as the host computer.
Power supply
For ease of use in industrial environments, the ADAM-4500 will accept industry standard +24
VDC unregulated power. The ADAM-4500 was designed to operate using any power supply
voltage between +10 and +30 VDC. Power ripples must be limited to 5 V peak to peak while the
voltage in all cases must be maintained between +10 and +30 VDC.
Utility software
A Driver CD-ROM containing menu-driven utility software is provided with ADAM-4500 to help
users to download programs to the ADAM-4500. The ADAM-4500 utility software is executed in
an MS-DOS or compatible environment.
Download cable
A customized download cable is included. A user can connect it between the COM port of a
host computer and the download port of the ADAM-4500 for downloading programs.
Before you power on the ADAM-4500, make sure you have a host computer, a power supply,
and the utility software and download cable.
Connect the power cable between the power supply and the ADAM-4500. Make sure the power
source is between +10 and +30 VDC.
We advise use of the following standard colors (as indicated on the ADAM-4500) for the power
cables:
Connect the download cable between the host computer and the ADAM-4500. A customized
Page 7
ADAM-4500 Users Manual
download cable is provided with the ADAM-4500, which includes a DB-9 pin connector for the
connection to the host computer, and three color-coded wires for connection to the ADAM-4500
terminal block. The following figure shows how to connect the ADAM-4500 to the host
computer.
(RS-232
White
PC)
Black
Host PC
Male DB-9 Female
DB-9
Together with the ADAM-4500 you will find a Driver CD-ROM containing a utility
ADAM4500.EXE file. This file is a menu-driven software utility provided for downloading user's
programs. It uses a screen simulating operation of the ADAM-4500 communication controller.
When the file is executed, the main screen appears, as shown in figure 2.2.
First, highlight the "COMport" option on the top bar and press <enter>. The status field (shown
below) will appear. Second, highlight the COM port you used to connect the ADAM-4500 to the
PC, then press <enter>. The Baudrate is set to a default value of 57600 bps and cannot be
Page 8
ADAM-4500 Users Manual
Highlight the "Terminal" option, then press <enter>. Power on the ADAM-4500. After 5 seconds,
the screen shown in figure 2.4 will appear. The ADAM-4500 system is successfully started up.
We designed the ADAM-4500 with ease-of-use in mind. It has three jumper settings. The
Page 9
ADAM-4500 Users Manual
following sections explain how to configure the module. You may want to refer to the figure
below for help in identifying card components.
Jumper JP1 lets you configure the COM1(3F8) port as an RS-232 or as an RS-485 interface for
different applications. Jumper settings are shown below:
Jumper JP2 lets you configure the watchdog timer in disable mode, reset mode or NMI
(Non-maskable interrupt) mode.
Jumper JP3 enables or disables the function of the reset pin, as shown below:
RS-232 Connection
The ADAM-4500 has a DB-9 pin connector as its RS-232 port connector. Since the connection
for an RS-232 interface is not standardized, different devices implement the RS-232 connection
in different ways. If you are having problems with a serial device, be sure to check the pin
assignments for the connector. The following table shows the pin assignments for the
ADAM-4500's RS-232 port.
Page 10
ADAM-4500 Users Manual
RS-485 Connection
The RS-485 standard supports half-duplex communication. This means that just two wires are
needed to both transmit and receive data. Handshaking signals (such as RTS, Request To
Send) are normally used to control the direction of the data flow. A special I/O circuit in the
ADAM-4500 automatically senses the direction of the data flow and switches the transmission
direction. No handshaking signals are necessary. This RS-485 control is completely transparent
to the user.
We recommend that shielded twisted-pair cables complying with the EIA RS-485 standard be
used in the network to reduce interference. Only one set of twisted-pair cables is required to
transmit both Data and RTS signals. We advise use of the following standard colors for the
communication cables.
DATA + Yellow
DATA - Green
Page 11
ADAM-4500 Users Manual
This chapter explains how to program applications and download programs into the
ADAM-4500 controller. Additionally, it points out limitations and concerns of which you should
be aware.
3.1 Programming
The operating system of ADAM-4500 is ROM-DOS, an MS-DOS equivalent system. It allows
users to run application programs written in assembly language as well as high level languages
such as C or C++. However, there are limitations when running application programs in the
ADAM-4500. In order to build successful applications, you should keep the following limitations
and concerns in mind.
The ADAM-4500 provides only two serial communication ports for connecting peripherals, so
the mini BIOS of ADAM-4500 only provides 10 function calls. Since the user's program can not
use other BIOS function calls, the ADAM-4500 may not work as intended. Additionally, certain
language compilers such as QBASIC directly call BIOS functions that are not executable in
ADAM-4500. The ADAM-4500 mini BIOS function calls are listed in the following table.
Page 12
ADAM-4500 Users Manual
Other Limitations
1. The ADAM-4500 does not support the standard PC function "8253". Therefore, the C
language function call "delay ( )" cannot be used in ADAM-4500 applications.
2. Certain critical files are always kept in flash ROM, such as the operating system files, BIOS,
and monitoring files. Aside from the storage space needed for these critical files, the
ADAM-4500 has an additional 170 KB of free ROM space for downloading user applications.
An additional free 234 KB of SRAM is provided for operation of applications.
The ADAM-4500 is equipped with a watchdog timer function that resets the CPU or generates
an interrupt if processing comes to a standstill for any reason. This feature increases system
reliability in industrial standalone and unmanned environments.
If you decide to use the watchdog timer, you must write a function call to enable it. When the
watchdog timer is enabled, it must be cleared by the application program at intervals of less
than 1.6 seconds. If it is not cleared at the required time intervals, it will activate and reset the
CPU, or generate an NMI (Non-maskable interrupt). You can use a function call in your
application program to clear the watchdog timer. At the end of your program, you need an
additional function call to disable the watchdog timer.
The following program shows how you might program the watchdog timer in C programs:
Example:
main ()
{
wdt_enable(); /* enable ADAM-4500 WDT function */
{ /* user's function block */
.
.
wdt_clear(); /* clear WDT timer */
.
.
Page 13
ADAM-4500 Users Manual
}
wdt_disable(); /* disable ADAM-4500 WDT function */
}
Interrupt Types
Three types of interrupts may occur in the ADAM-4500. The following table shows the types of
interrupts.
Memory Mapping
The following table shows the memory mapping of the ADAM-4500 controller.
A Driver CD-ROM containing the following files and directories is included with each
ADAM-4500.
. ALLFILE <DIR>
. EXAMPLE <DIR>
. LIBRARY <DIR>
. MANUAL <DIR>
. A1-DIS.HEX
. ADAM_A1.HEX
. ADAM_DEM.HEX
. ADAM4500.EXE
. ADAMMINI.BAT
. ADAMMINI.HEX
. DEMO-DIS.HEX
. HEXCAT.EXE
. ROMDISK.EXE
. ROM-DOS.HEX
Copy all the files and directories on the Driver CD-ROM to the host computer hard drive.
Page 14
ADAM-4500 Users Manual
Applications programs are downloaded from a host-PC to the flash ROM of the ADAM-4500
using the ADAM-4500 utility software. The ADAM-4500 utility software is first installed on a
host-PC. The directory ALLFILE will be included among the contents copied from the Driver
CD-ROM to the host-PC hard drive. The user must then load into ALLFILE the following
required files: The application program intended for installation in ADAM-4500;
COMMAND.COM; AUTOEXEC.BAT; and CONFIG.SYS. The user should make certain that
AUTOEXEC.BAT contains the name of the user's application program so that the application
will automatically begin executing whenever the ADAM-4500 is powered on. When downloading
to the ADAM-4500's flash ROM, the utility software first clears all non-permanent files from the
flash ROM, then installs all the files contained in directory ALLFILE into the flash ROM. It is
therefore critical that all the required files be available in directory ALLFILE when the utility
software tries to install ALLFILE's contents on the ADAM-4500's flash ROM.
With the ADAM-4500 utility software and the directory ALLFILE, loaded with its proper contents,
installed on the host-PC, you can execute the utility software. After the utility software has
begun executing, select the COMport of the host PC that has been connected to ADAM-4500.
Then select "Program" from the bar menu and press <enter> to begin downloading. The
screen shown in figure 3-2 will appear.
Follow the instructions shown on the screen. Power off the ADAM-4500 and then re-power on.
Then press any key within 7 seconds to burn the files contained in ALLFILE into the
ADAM-4500's flash ROM. After the files are successfully burned into the flash ROM, the screen
in Figure 3-3 will appear. Power off and power on the ADAM-4500 once again. The ADAM-4500
controller will automatically execute the application program.
Page 15
ADAM-4500 Users Manual
The ADAM-4500 provides 234 KB of free SRAM for use in program operation, and as working
memory space in the event you want to test your system control logic or simulate system
performance before downloading the execution code to the flash ROM. You can transfer files
from a host-PC to the ADAM-4500's SRAM (D drive). Execute the utility software, select
terminal mode, and press Alt-T. File transfer will begin and the screen shown in figure 3-4 will
appear.
Key in the specific directory and file names you want to transfer. Press <enter> to complete the
file transfer. You can check the files in D drive.
We recommend that users test new applications on their host PC before installing them in the
Page 16
ADAM-4500 Users Manual
ADAM-4500. However, the performance of the host PC may differ greatly from that of the
ADAM-4500. Therefore, users may find it desirable to install an application that has been
tested on the host PC into ADAM-4500's D drive for testing prior to burning it into the flash ROM.
It takes less time to alter and reinstall a program into the SRAM than into the flash ROM, so
using the SRAM during debugging on the ADAM-4500 may be more efficient.
Connect a host-PC to the I/O device network you want to control. Write the control logic for your
application on the host-PC and execute the application on the PC to verify that it works properly.
Replace the host-PC in the control network with the ADAM-4500 and reconnect the proper
power and communications cable in the network to the ADAM-4500. Connect the download
cable between the host-PC and the ADAM-4500.
Within the host computer, convert the application program into 80186 or 80188 compatible code.
Create an AUTOEXEC.BAT file for the application program and write the application program's
name in the AUTOEXEC.BAT file. Also create COMMAND.COM and CONFIG.SYS files for
the application program. Load the ADAM-4500 utility software into the host-PC. Load the
converted application program and the files AUTOEXEC.BAT, COMMAND.COM, and
CONFIG.SYS into directory ALLFILE. Execute the utility software to download the contents of
ALLFILE into the ADAM-4500 flash ROM.
After all the files in directory ALLFILE have been completely transferred to the flash ROM,
re-power on the ADAM-4500.
Page 17
ADAM-4500 Users Manual
The ADAM-4500 is packaged with a Driver CD-ROM that contains a directory called LIBRARY.
This directory contains a number of function calls that enable a user to efficiently write
applications for ADAM-4500. The library supports both Turbo C 2.0 and Microsoft C 6.0 version
programming languages.
Page 18
ADAM-4500 Users Manual
The function calls included in the directory LIBRARY are described in the following pages.
<ADAM4500.H>
comm_init
Syntax:
int comm_init(int buf_size)
Function description:
Initializes the communication port and interrupt routine before other function calls use the
communication port.
Parameter Description
int buf_size Sets the buffer size of every communication port for storage of
received data. The unit of size is bytes.
Return:
Returns a 1 if command succeeds. Returns a 0 if it fails.
comm_exit
Syntax:
int comm_exit()
Function Description:
If a user calls the comm_init function, the user must call this function to release the
communication port before the user's program terminates.
Return:
Returns a 1 if command succeeds. Return a 0 if it fails.
comm_open
Syntax:
int comm_open(unsigned char port, unsigned long baud, int parity, int data, int stop, int
cmd_type)
Function Description:
To open a communication port for user to send and receive data.
Parameter Description
unsigned char port Specifies communication port.
1: COM1 port
2: COM2 port
unsigned long baud Baud rate setting. The eight allowable baud rates are: 1200,
2400, 4800, 9600, 19200, 38400, 57600, and 115200. Sized in bps
(bits per second).
int data Data bits setting. There are four allowable data lengths: 8, 7,
Page 19
ADAM-4500 Users Manual
comm_send
Syntax:
int comm_send(unsigned char c, unsigned char port)
Function Description:
To send a character to a specified communication port.
Parameter Description
unsigned char c Represents character to be sent.
Return:
Returns a 1 if command succeeds. Returns a 0 if it fails.
comm_get_rec_datas
Syntax:
int comm_get_rec_datas(unsigned *length, unsigned char **data, unsigned char port)
Function Description :
The function is called to receive a single byte of data. The function call returns a success flag if
the communication port receives any data. The function call returns a failed flag if the buffer of
the communication port is empty. The length of the data packet received (in bytes) is stored in
parameter "length". The contents of the data packet received are stored in parameter "data".
Parameter Description
unsigned *length Returns the length of the received data
unsigned char **data Returns the received data contents. User must first allocate a
data buffer ( Use comm_int function call ). Before exiting
program, user must free this buffer ( Use comm_exit function
Page 20
ADAM-4500 Users Manual
call ).
Return:
Returns a 1 if command succeeds. Returns a 0 if it fails.
comm_get_rec_str
Syntax:
int comm_get_rec_str(unsigned char **data, unsigned char port)
Function Description:
This function call is employed to received string data. The function call returns a success flag if
the communication port receives string data ( terminal character is 0x0d) . The function call
returns a fail flag if the buffer of the communication port is empty.
Parameter Description
unsigned char **data Returns the received string contents. User must first allocate a
data buffer (Use comm_int function call). Before exiting
program, user must free this buffer (Use comm_exit function
call).
Return:
Returns a 1 if command succeeds. Returns a 0 if it fails.
led_init
Syntax:
void led_init()
Function Description:
This function must be called to initialize the ADAM-4500's LED before a user's program can
control the LED.
led
Syntax:
void led(int type)
Function Description:
LED ON/OFF control
Page 21
ADAM-4500 Users Manual
Parameter Description
int type 0: LED OFF
1: LED ON
wdt_enable
Syntax:
wdt_enable()
Function Description:
This function enables the watchdog timer function. After a user calls this function, the user must
call the wdt_clear() function to refresh the watchdog timer; otherwise the CPU resets, or a
non-maskable interrupt is generated.
wdt_clear
Syntax:
wdt_clear()
Function Description:
This function refreshes the watchdog timer, thereby avoiding the resetting of the CPU or the
generation of a non-maskable interrupt.
wdt_disable
Syntax:
wdt_disable()
Function Description:
This function disables the watchdog timer function.
<5510DRV.H>
ADAMdelay
Syntax:
void ADAMdelay(unsigned short msec)
Description:
Delays program operation by a specified number of milliseconds.
Parameter Description
msec From 0 to 65535.
Return value:
None.
Page 22
ADAM-4500 Users Manual
Example:
void main(void)
{
/* codes placed here by user */
ADAMdelay(1000); /* delay 1 sec. */
/* codes placed here by user */
}
Remarks:
None.
Get_NVRAM_Size
Syntax:
unsigned char Get_NVRAM_Size(void)
Description:
Gets the battery backup RAM size. The unit is sectors, each sector is 4
KB in size. Maximum size is 60 KB theoretically.
Parameter Description
None.
Return value:
sector Number of sectors NV RAM size is set to, from
1 to 15.
Example:
void main()
{
unsigned char sector;
sector = Get_NVRAM_Size();
}
Remarks:
None.
GetRTCtime
Syntax:
unsigned char GetRTCtime(unsigned char Time)
Description:
Reads Real-Time Clock chip timer. A user can activate a program on
the date desired.
Parameter Description
Time RTC_sec the second
RTC_min the minute
RTC_hour the hour
RTC_day the day
RTC_week day of the week
RTC_month the month
RTC_year the year
RTC_century the century
Return value:
Page 23
ADAM-4500 Users Manual
Example:
void main(void)
{
printf(\n Century = %d,
GetRTCtime(RTC_century) );
printf(\n Year = %d, GetRTCtime(RTC_year) );
printf(\n month = %d, GetRTCtime(RTC_month) );
printf(\n weekday = %d, GetRTCtime(RTC_week) );
printf(\n day = %d, GetRTCtime(RTC_day) );
printf(\n hour = %d, GetRTCtime(RTC_hour) );
printf(\n min = %d, GetRTCtime(RTC_min) );
printf(\n sec = %d, GetRTCtime(RTC_sec) );
}
Remarks:
None.
Get_SysMem
Syntax:
unsigned char Get_SysMem(unsigned char which_byte)
Description:
Reads a byte from security SRAM.
Parameter Description
which_byte From 0 to 112, user-determined.
Return value:
The value in a byte of security SRAM.
Example:
unsigned char SlotValue[4];
void main(void)
{
int I;
/* recover last value */
for(I=0;I < 4;I++)
SlotValue[I] = Get_SysMem(I);
}
Remarks:
None.
read_backup_ram
Syntax:
unsigned char read_backup_ram(unsigned int index)
Description:
Reads the value in backup RAM at index address, 60 KB total backup
RAM, index = 0 61439; absolute addresses from 0x30000 0x3EFFF.
Parameter Description
index From 0 to 61439, 60 KB in total.
Page 24
ADAM-4500 Users Manual
Return value:
The single-byte value in backup RAM at address index.
Example:
void main(void)
{
unsigned char data;
data = read_backup_ram(500);
/* put your codes here */
}
Remarks:
None.
read_mem
Syntax:
unsigned char read_mem (int memory_segment , unsigned int i)
Description:
Reads far memory data, 256 KB Flash memory, from 0x80000L to
0xBFFFFL, where (the Absolute Address) = (SEG*16 + OFFSET). For
example, (0x800FFL) = (0x8000*16 + 0x00FF).
Parameter Description
memory_segment User-determined address taken from the range
0x8000 to 0xBFFF.
i Offset for use in location of memory taken from
the range 0x0000 to 0xFFFF.
Return value:
The value in memory storage at the indicated address.
Example:
void main(void)
{
unsigned char data;
data = read_mem(0x8000, 0x0000);
/* put your codes here */
}
Remarks:
None.
Release_All
Syntax:
void Release_All()
Description:
Releases all timer resources of the ADAM-5510 system.
Parameter Description
None.
Return value:
None.
Page 25
ADAM-4500 Users Manual
Remarks:
None.
Example:
void main()
{
int idx;
/* Initializes the timer built into the 80188
microprocessor */
Timer_Init();
/* Sets time interval of the timer to
1 second. */
idx=Timer_Set(1000);
/* Checks whether the timer has timed out */
while(tmArriveCnt[idx]==0)
{
/* user can attend to other tasks...*/
}
/* Resets the current timer to its initial
state. */
Timer_Reset(idx);
/* Releases all timer resources */
Release_All()
}
Set_NVRAM_Size
Syntax:
void Set_NVRAM_Size(unsigned char sector)
Description:
Sets the battery backup RAM size. The unit is sectors, each sector is 4
Kbytes in size. Maximum size is 60 KB theoretically.
Parameter Description
sector NV RAM size in 4 KB sectors, from 1 to 15
sectors.
Return value:
None.
Example:
void main()
{
Set_NVRAM_Size(31); /* sets NVRAM size to 15
KB*/
}
Remarks:
Maximum size is 60 KB theoretically. Actual size available depends on
the user's programming.
SetRTCtime
Syntax:
void SetRTCtime(unsigned char Time, unsigned char data)
Page 26
ADAM-4500 Users Manual
Description:
Sets date and time of the real-time clock.
Parameter Description
Time RTC_sec the second
RTC_min the minute
RTC_hour the hour
RTC_day the day
RTC_week day of the week
RTC_month the month
RTC_year the year
RTC_century the century
data New contents.
Return value:
None.
Example:
void main()
{
unsigned char sec=0, min=0, hour=12;
/* set current time 12:00:00. */
SetRTCtime(RTC_sec,sec);
SetRTCtime(RTC_min,min);
SetRTCtime(RTC_hour,hour);
}
Remarks:
None.
Set_SysMem
Syntax:
void Set_SysMem(unsigned char which_byte, unsigned char data)
Description:
Writes a byte to security SRAM. Security SRAM supports 113 bytes
for user storage of important information.
Parameter Description
which_byte From 0 to 112, user determined.
data Value to be saved.
Return value:
None.
Example:
unsigned char data[4] = {1,2,3,4};
void main(void)
{
int I;
/* save current value */
for(I=10;I < 14;I++)
Set_SysMem(I, data[I-10]);
}
Remarks:
None.
Page 27
ADAM-4500 Users Manual
Timer_Init()
Syntax:
int Timer_Init()
Description:
Initializes the timer built into the 80188 microprocessor. The return
value 0 means the initialization of the time was successful. The
return value 1 means the timer had already been initialized.
Parameter Description
None.
Return value:
0: Initialization was successful.
1: The timer had already been initialized.
Remarks:
None.
Timer_Reset
Syntax:
void Timer_Reset(int idx)
Description:
Resets the timer identified by the integer idx to its initial state.
Parameter Description
idx Timer index.
Return value:
None.
Remarks:
None.
Timer_Set
Syntax:
int Timer_Set(unsigned int msec)
Description:
Requests a timer function from the microprocessor and then sets the
time interval of the function. Timer intervals are set in 5 millisecond
increments. The function return value is an integer representing the ID
of the timer function when it is successful. A return value -1 means
the request failed. Programmers should consider whether an assigned
timer has timed-out when programming for timer functions. The value
of the variable tmArriveCnt[idx] can be checked to verify timer status.
A value of 0 indicates that the timer is still counting. Values other than
0 mean the timer has timed-out.
Parameter Description
msec Time interval set, max. value is 65536.
Return value:
Page 28
ADAM-4500 Users Manual
-1 Function failure.
Remarks:
Timer function calls in the ADAM-5510 are emulated as timer functions
in a PLC. Applications using timer functions will run less
efficiently the more timer functions are running simultaneously in a
program. Please refer to Example 9 on the utility diskettes for details.
Description:
Clear watchdog timer.
Disable watchdog timer.
Enable watchdog timer.
Parameter Description
None.
Return value:
None.
Example:
void main(void)
{
int I;
WDT_enable();
For(I=0;I < 10;I++)
{
ADAMdelay(1000);
WDT_clear();
}
WDT_disable();
}
Remarks:
None.
write_backup_RAM
Syntax:
void write_backup_RAM(unsigned int index, BYTE data)
Description:
Writes a byte to battery backup memory.
Parameter Description
index An index for data in the battery backup RAM,
Page 29
ADAM-4500 Users Manual
Return value:
None.
Example:
void main()
{
unsigned char data=0x55;
/* Writes the data 0x55 into battery backup memory,
index 10 */
write_backup_RAM(10,data);
}
Remarks:
None.
Page 30
ADAM-4500 Users Manual
This appendix gives a short description of each of the ADAM-4500's registers. For more
information please refer to the data book for the STARTECH 16C550 UART chip.
All registers are one byte in length. Bit 0 is the least significant bit, and bit 7 is the most
significant bit. The address of each register is specified as an offset from the port base address
(BASE), COM1 is 3F8h and COM2 is 2F8h.
BASE+0 Receiver buffer register when DLAB=0 and the operation is a read.
BASE+0 Transmitter holding register when DLAB=0 and the operation is a write.
BASE+0 Divisor latch bits 0 - 7 when DLAB=1
BASE+1 Divisor latch bits 8-15 when DLAB=1.
The two bytes BASE+0 and BASE+1 together form a 16-bit number, the divisor, which
determines the baud rate. Set the divisor as follows:
Page 31
ADAM-4500 Users Manual
Page 32
ADAM-4500 Users Manual
Page 33
ADAM-4500 Users Manual
Wichtige Sicherheishinweise
1. Bitte lesen sie Sich diese Hinweise sorgfltig durch.
2. Heben Sie diese Anleitung fr den spteren Gebrauch auf.
3. Vor jedem Reinigen ist das Gert vom Stromnetz zu trennen. Verwenden Sie Keine
Flssig-oder Aerosolreiniger. Am besten dient ein angefeuchtetes Tuch zur Reinigung.
4. Die NetzanschluBsteckdose soll nahe dem Gert angebracht und leicht zugnglich
sein.
5. Das Gert ist vor Feuchtigkeit zu schtzen.
6. Bei der Aufstellung des Gertes ist auf sicheren Stand zu achten. Ein Kippen oder
Fallen knnte Verletzungen hervorrufen.
7. Die Belftungsffnungen dienen zur Luftzirkulation die das Gert vor berhitzung
schtzt. Sorgen Sie dafr, daB diese ffnungen nicht abgedeckt werden.
8. Beachten Sie beim AnschluB an das Stromnetz die AnschluBwerte.
9. Verlegen Sie die NetzanschluBleitung so, daB niemand darber fallen kann. Es sollte
auch nichts auf der Leitung abgestellt werden.
10. Alle Hinweise und Warnungen die sich am Gerten befinden sind zu beachten.
11. Wird das Gert ber einen lngeren Zeitraum nicht benutzt, sollten Sie es vom
Stromnetz trennen. Somit wird im Falle einer berspannung eine Beschdigung vermieden.
12. Durch die Lftungsffnungen drfen niemals Gegenstnde oder Flssigkeiten in das
Gert gelangen. Dies knnte einen Brand bzw. elektrischen Schlag auslsen.
13. ffnen Sie niemals das Gert. Das Gert darf aus Grnden der elektrischen Sicherheit
nur von authorisiertem Servicepersonal geffnet werden.
14. Wenn folgende Situationen auftreten ist das Gert vom Stromnetz zu trennen und von
einer qualifizierten Servicestelle zu berprfen:
a - Netzkabel oder Netzstecker sind beschdigt.
b - Flssigkeit ist in das Gert eingedrungen.
c - Das Gert war Feuchtigkeit ausgesetzt.
d - Wenn das Gert nicht der Bedienungsanleitung entsprechend funktioni ert
oder Sie mit Hilfe dieser Anleitung keine Verbesserung erzielen.
e - Das Gert ist gefallen und/oder das Gehuse ist beschdigt.
f - Wenn das Gert deutliche Anzeichen eines Defektes aufweist.
Der arbeitsplatzbezogene Schalldruckpegel nach DIN 45 635 Teil 1000 betrgt 70dB(A)
oder weiger.
Page 34