Isa celeron m half-sized sbc with vga/lcd/lvds/10/100 ethernet/usb2.0 and ssd (6 pages)
Summary of Contents for Advantech ADAM-5511
Page 3
This document is copyrighted, 2000, by Advantech Co., Ltd. All rights are reserved. Advantech Co., Ltd., reserves the right to make improve- ments 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.
Page 4
Our dealers are well trained and ready to give you the support you need to get the most from your Advantech products. In fact, most problems reported are minor and are able to be easily solved over the phone.
Page 5
Because of Advantech’s high quality-control standards and rigorous testing, most of our customers never need to use our repair service. If an Advantech product ever does prove defective, it will be repaired or replaced at no charge during the warranty period. For out-of-warranty repairs, you will be billed according to the cost of replacement materi- als, service time and freight.
Page 6
4. Carefully pack the defective product, a completely filled-out Repair and Replacement Order Card and a photocopy of dated proof of purchase (such as your sales receipt) in a shippable container. A product returned without dated proof of purchase is not eligible for warranty service.
Page 20
Welcome to the Advantech ADAM-5511 user’s guide. This chapter was written to provide users with a fast and easy installation guide and with the basic operating skills necessary to use the ADAM-5511’s core capabilities. This Quick Start chapter contains the following sections: •...
Page 21
3. One core clamp for power supply connection. 4. One ADAM-5511 Windows Utility CD. 5. Power supply for ADAM-5511 (+10 to +30 VDC unregulated) 6. One cross-over DB-9 cable 7. One straight through DB-9 cable At least one I/O module is needed to use the system. A variety of I/O...
Page 22
Refer to Table 0-2 for the ADAM-4000 modules that can be used for ADAM-5511 Remote I/O function. • Open the ADAM-5511 package and make sure that the following items are present: • One ADAM-5511 main unit with two blank slot covers.
Page 23
One straight through DB-9 cable for COM3 use 1. Make sure that everything described in Section 0.1 is ready. 2. Set all the DIP switches off on ADAM-5511 back plant. See Figure 0-1. 3. Connect the ADAM-5511 power cable between the power supply and the ADAM-5511 screw terminals (+Vs and GND).
Page 24
1. Insert ADAM-5511 Utility CD into the CD drive (e.g. D:) of the host 2. Find out the installation program from this path D:\ADAM4K5K\Windows Utility\Setup, then execute it. When the installation is completed, there will be an Advantech folder created automatically in drive C:\Program Files.
Page 25
Note: Before setup ADAM-5511 system, user need to config- ure the I/O module first, and ADAM-4000/5000 Utility Software provides a graphical user interface for config- uring and calibrating Advantech ADAM-4000/5000 Modules. 4. Module Configuration: Sets the input/output range, baud rate, data format, checksum status.
Page 26
5. Module Calibration (ADAM 4011, 4011D, 4012, 4014D, 4016, 4017, 4018, 4018M, 5013, 5017, 5017H, 5018): Zero Calibration: (1). Apply power to the module and let it warm up for about 30 minutes. (2). Make sure that the module is correctly installed and is properly configured for the input range you want to calibrate.
Page 27
CJC Calibration: (1). Prepare a voltage source which is accurate to the mV level. (2). Run the zero calibration and span calibration function. (3). Use a temperature emulation device (such as Micro-10) to send a temperature signal to the ADAM module and then compare this signal with the reading from the ADAM module.
Page 28
4~20 mA: ADAM 4021, ADAM 5024 0~10 V: ADAM 4016 After completing the I/O modules configuration, user can setup ADAM-5511 as a data acquisition & control system or a programmable stand-alone controller. Connect the download cable between the host computer and the...
Page 29
There are two kind of connecting methods for system linkage. One is connected via RS-232 DB9 cross over cable to COM1 of ADAM-5511, and the other one is connected via ADAM-4520 to COM2 of ADAM-5511. 5. Refer these tables below to adjust the DIP switches in ADAM- 5511.
Page 30
19200 38400 115200 1. Insert ADAM-5511 Utility CD into the CD drive (e.g. D:) of the host 2. Find out the executive program from this path D:\ADAM- 5511\Windows Utility\ADAM5511.EXE, then execute it. (ADAM- 5511.EXE also can be saved in the specific path in your hard disk.) 3.
Page 31
4. Select the specific COM port, then setting the baud rate and time out parameter.
Page 32
5. Click the “Search device” icon on tool bar to detect all devices on network The current status on network will show on the display.
Page 33
6. Click the “Download” icon on tool bar to select the pro- gram you want to download. Note: When you download the program into ADAM-5511, you have to make sure that the memory capacity will not exceed 128K byte.
Page 34
“Run” icon. By carefully walking through all the installation and operating instruc- tions described above, you should have experienced most of the usual procedures for using ADAM-5511. For further sophisticated utilization or programming skills, please refer to following chapters.
Page 36
The ADAM-5511 is a compact PC in its own right and includes an 80188 CPU and a built-in ROM-DOS operating system. It can be used in the say way one uses an x86 PC at the office. The ADAM-5511 can be controlled by programs written in C language.
Page 37
A complete set of C language I/O subroutines are included in the ADAM-5511’s function library to reduce programming effort. Users can easily call on these subroutines to execute the ADAM-5511’s I/O functions while programming in Borland C 3.0 languages. For a detailed description, refer to Chapter 6 Function Library.
Page 38
Utility Setting: Selectable Cable Connection ADAM-5511 Setting •Port Number •RS-232---> Cross Over Cable •ID Address •Baud Rate •RS-485---> 4520 Setting •Baud Rate •Time Out •Baud Rate •Data Length...
Page 40
ROM-DOS environment. Built-in ROM and Flash disk for programming The ADAM-5511 has a built-in flash ROM, SRAM and flash disk. The system provides 400 KB of free flash disk to allow users to download programs. There are also 12 KB of free SRAM with battery backup to provide the memory needed for temporary variable storage in user’s...
Page 41
Electrical noise can enter a system in many different ways. It may enter through an I/O module, a power supply connection or the communica- tion ground connection. The ADAM-5511 system provides isolation for I/O modules (3000 V ), communication connections (2500 V and communication power connections (3000 V ).
Page 42
• I/O capacity: 4 modules (limitation: only one ADAM-5024 is allowed in one ADAM-5511 main unit) • CPU power consumption: 1.0 W • LED Status display: Power, CPU, Communication, Battery • Signals: TxD, RxD, GND • Mode: Asynchronous full duplex, point to point •...
Page 43
• Input/Output: 3000 V DC • Communication: 2500 V DC (COM2 only) • Unregulated +10 to +30 V DC • Protected against power reversal • Power consumption: 2.0 W • Case: KJW with captive mounting hardware • Plug-in screw terminal block: Accepts 0.5 mm 2 to 2.5 mm 2, or 1 - #12 or 2 - #14 to #22 AWG wires.
Page 44
Dimensions The following diagrams show the dimensions of the system unit and an I/O unit. All dimensions are in millimeters. Battery Opto-Coupled SRAM Isolation COM2 RS-485 COMM, UART Transceiver 80188-40 (16 Bit µp) Local RS-232 Counter COMM, UART Transceiver COM1 WDT &...
Page 46
This chapter explains how to install an ADAM-5511 stand-alone controller. A quick hookup scheme is provided that lets you easily configure your system before implementing your application to it. When inserting modules into the system, align the PC board of the module with the grooves on the top and bottom of the system.
Page 47
8-channel analog input module. Its input channel numbering is 0 through 7. The ADAM-5511 system can be installed on a panel or on a DIN rail. Panel mounting Mount the system on the panel horizontally to provide proper ventila- tion.
Page 48
This section tells you how to set the jumpers and DIP switches to configure your ADAM-5511 system. It gives the system default configuration and your options for each jumper and dip switch. There...
Page 49
RTS (Request to Send), normally control the direction of the data flow. A special I/O circuit in the ADAM-5511 senses the data flow direction and automatically switches the transmission direction, making handshaking signals unnecessary. Jumper JP3 gives users the option of configuring the COM2 port for automatic control ler RTS control.
Page 50
Watchdog timer setting Jumper JP2 on the CPU card lets you configure the watchdog timer to disable mode, reset mode or NMI (Non-maskable interrupt) mode. Jumper settings are shown below:...
Page 51
Network address/baud rate setting There is a set of DIP switch terminals on the right side of the ADAM- 5511 back plane. Set the network address using DIP switches 1~5. Valid settings range from 0 to 255. Node ID: Set DIP switch 6 on when you need to use COM1.
Page 52
O units, communication port connections and programming port connection. Power supply wiring Although the ADAM-5511 systems are designed for a standard industrial unregulated 24 V power supply, they accept any power unit that supplies within the range of +10 to +30 V .
Page 53
I/O modules wiring The system uses a plug-in screw terminal block for the interface between I/O modules and field devices. The following information must be considered when connecting electrical devices to I/O mod- ules. 1. The terminal block accepts wires from 0.5 mm to 2.5 mm. 2.
Page 54
Port connection The ADAM-5511 has three communications ports. These ports allow you to program, configure, monitor, and integrate ADAM-4000 modules as remote I/O. COM1: This is an RS-232 interface and only uses TX, RX, and GND signals. The pin assignment of the cross over cable is as follows:...
Page 55
COM2: The COM2 port is dedicated as an RS-485 interface. Screw terminals DATA- and DATA+ are used for making the COM2 RS-485 connections. Users have to prepare an ADAM-4520 RS232/485 converter for the linkage with PC. COM3: This is a spare RS-232 port for advanced users which require more than two ports in the system.
Page 56
There are four LEDs on the ADAM-5511 front panel. The LED’s indicate ADAM-5511’s operating status, as explained below: (1) PWR: power indicator. This LED is on when the ADAM-5511 is powered on. (2) RUN: program execution indicator. This LED is regularly blinks whenever the ADAM-5511 is executing a program.
Page 58
Analog input modules use an A/D converter to convert sensor voltage, current, thermocouple or RTD signals into digital data. The digital data is then translated into engineering units. When prompted by the host computer, the data is sent through a standard RS-485 interface.
Page 61
1. Apply power to the module and let it warm up for about 30 minutes. 2. Make sure that the module is correctly installed and is properly configured for the input range you want to calibrate. You can use the ADAM utility software to help in this. 3.
Page 62
Note: If the above procedure is ineffective, the user must first issue an RTD Self Calibration command $aaSi2 to the module and then complete steps 4 and 5 after self calibration is complete.
Page 63
The ADAM-5017 is a 16-bit, 8-channel analog differential input module that provides programmable input ranges on all channels. It accepts millivolt inputs (±150mV, ±500mV), voltage inputs (±1V, ±5V and ±10V) and current input (±20 mA, requires 125 ohms resistor). The module provides data to the host computer in engineering units (mV, V or mA).
Page 64
Ω Note: To keep measurement accuracy please short the channels that are not in use.
Page 66
The ADAM-5017H is a 12-bit plus sign bit, 8-channel analog differen- tial input module that provides programmable input ranges on each channel. It accepts millivolt inputs (± 500 mV, 0-500 mV), voltage inputs (±1 V, 0-1 V, ±2.5 V, 0-2.5 V, ±5 V, 0-5 V, ±10 V and 0-10 V) and current inputs (0-20 mA and 4-20 mA;...
Page 68
Note: To maintain measurement accuracy please short channels not in use.
Page 70
µ µ µ µ µ µ µ µ µ µ 5.3 µΑ 5.3 µΑ The ADAM-5018 is a 16-bit, 7-channel thermocouple input module that features programmable input ranges on all channels. It accepts millivolt inputs (±15 mV, ±50 mV, ±100 mV, ±500 mV), voltage inputs (±1 V, ±2.5 V), current input (±20 mA, requires 125 ohms resistor) and thermocouple input (J, K, T, R, S, E, B).
Page 72
µ The ADAM-5024 is a 4-channel analog output module. It receives its digital input through the RS-485 interface of the ADAM-5510 system module from the host computer. The format of the data is engineering units. It then uses the D/A converter controlled by the system module to convert the digital data into output signals.
Page 73
You can specify slew rates and start up currents through the configu- ration software. The analog output can also be configured as current or voltage through the software utility. The module protects your equipment from ground loops and power surges by providing opto- isolation of the D/A output and transformer based isolation up to 500 The slew rate is defined as the slope indicated the ascending or descending rate per second of the analog output from the present to...
Page 75
Analog input/output modules are calibrated when you receive them. However, calibration is sometimes required. No screwdriver is neces- sary because calibration is done in software with calibration parame- ters stored in the ADAM-5000 analog I/O module‘s onboard EEPROM. The ADAM-5510 system comes with the ADAM utility software that supports calibration of analog input and analog output.
Page 76
4. Execute the Zero Calibration command (also called the Offset Calibration command). This is also done with the ADAM utility software. (See the “Zero Calibration” option in the Calibration sub- menu of the ADAM utility software.) 5. Execute the Span Calibration command. This can be done with the ADAM utility software.
Page 77
6. Only for ADAM-5018: Execute the CJC (cold junction sensor) Calibration command. This can be done with the ADAM utility software. (See the “CJC Calibration” option in the Calibration submenu of the ADAM utility software.) * Note: Zero calibration and span calibration must be com- pleted before CJC calibration.
Page 78
Module Input Range Input Range Span Calibration Code (Hex) Voltage ±15 mV +15 mV 5018 ±50 mV +50 mV ±100 mV +100 mV ±500 mV +500 mV ±1 mV +1 V ±2.5 V +2.5 V ±20 mV +20 mA (1) J thermocouple +50 mV 0 to 1370°...
Page 79
(1) Note: You can substitute 2.5 V for 20 mA if you remove the current conversion resistor for that channel. Howev- er, the calibration accuracy will be limited to 0.1% due to the resistor's tolerance.
Page 80
The output current of analog output modules can be calibrated by using a low calibration value and a high calibration value. The analog output modules can be configured for one of two ranges: 0-20 mA and 4-20 mA. Since the low limit of the 0-20 mA range (0 mA) is internally an absolute reference (no power or immeasurably small power), just two levels are needed for calibration: 4 mA and 20 mA.
Page 81
5. Check the actual output value at the modules terminals. If this does not equal 4 mA, use the "Trim" option in the "Calibrate"sub- menu to change the actual output. Trim the module until the mA meter indicates exactly 4 mA, or in case of a voltage meter with shunt resistor, the meter indicates exactly 1 V.
Page 84
The ADAM-5051 provides sixteen digital input channels. The ADAM- 5510 can use the module’s digital inputs to determine the state of limit or safety switches or to receive remote digital signals.
Page 86
The ADAM-5052 provides eight fully independent isolated channels. All have 5000 V isolation to prevent ground loop effects and to prevent damage from power surges on the input lines.
Page 87
Ω The ADAM-5056 features sixteen digital output channels. The digital outputs are open-collector transistor switches that you can control from the ADAM-5510. You also can use the switches to control solid-state relays.
Page 88
+ Vss R2 limit current to 100 mA Open Collector - Vss Power Ground Power Ground There are 16-point digital input and 16-point digital output modules in the ADAM-5000 series. The addition of these solid state digital I/O devices allows these modules to control or monitor the interfaces between high power DC or AC lines and TTL logic signals.
Page 89
The ADAM-5060 relay output module is a low-cost alternative to SSR modules. It provides 6 relay channels, two of Form A and four of Form Form A (NO) Form C...
Page 90
Ω The ADAM-5068 relay output module provides 8 relay channels of Form A. Switches can be used to control the solid-state relays.
Page 92
ADAM-5080 is a 4-channel counter/frequency module designed to be implemented within the following Advantech ADAM-5000 series main units: ADAM-5000/485 (with firmware Version A2.3 or above) ADAM-5510 (with library Version V1.00 or above) ADAM-5510/P31 (with I/O driver Version V1.00 or above) Please make sure that the ADAM-5080 counter/frequency module is properly inserted into the compatible main units.
Page 93
selected, it means the Alarm status will be "latched" whenever the alarm being triggered. Once the alarm status being "latched," it will thereafter stay in that triggered state. Users will have to issue a "Clear Alarm Status" command to return the "latched" alarm status back to normal.
Page 94
Users can select Bi-direction, Up/Down Counter or Frequency option as shown in Figure 4. Note: All four channels of ADAM-5080 will operate simulta- neously in the mode you have selected. i.e. If you switch the ADAM-5080 to Counter Mode, all four channels will operate in Counter Mode.
Page 95
The Up/Down Counter Function offers two types of counting: Up Couting (increasingly) and Down Counting (decreasingly). Up Counting : when C0A+ and C0A- sense any input signals, the counter counts up. Down Counting : when C0B+ and C0B- sense any input signals, the counter counts down.
Page 96
Up Counting : when the input signal is within logic level "1", the counter value increases. Down Counting : when the input signal is within logic level "0", the counter value decreases. Note: If users select TTL mode and don't connect C0B+ C0B-, the counter value will increase.
Page 97
According to your application purposes, you can run the utility program to set different limit values for High/Low Alarm. In oder to utilize the alarm function, users have to set a high-alarm limit value and/or a low alarm limit value, and a initial value to fulfill the requirements for a basic alarm setting.
Page 99
Overflow value is the number of times the counter value exceeds the Max/Min values you specified. When the counter value exceeds Maximum value, the overflow value increases; When the counter value goes under Minimum value, the overflow value decreases. Besides, when the counter value runs beyond the range of Max/Min value, it will continue counting from the initial value.
Page 100
If users want to use Digital Output function, ADAM utility is available for setting specifically which module, channel or slot to receive the alarm signals. 1: High Alarm State--Set Alarm state to "Latch" or "Disable". 2: High Alarm Limt--Set Alarm limit from 0 to 4,294,967,295. 3: High Alarm Output Mode--Enable or Disable D.O.
Page 101
According to your need, you can select either TTL or Isolated Input Level by setting the configuration for the jumpers. Select the proper jumper settings for either TTL or Isolated Input according to Figure 4-47. Please note that you must configure all six jumpers to the correct configuration for proper function.
Page 103
The ADAM-5090 is a 4-port RS-232 communication module to be implemented with the following Advantech ADAM-5000 series main units: ADAM-5510 (with library Version V1.10 or above) ADAM-5511 (with library Version V1.10 or above) The ADAM-5090 is equipped with four RS-232 ports, which makes it especially suitable for bi-direction communication.
Page 104
With the ADAM-5090 you can implement dual communication channels between your PC and the ADAM system. Even when one of the two communication channels is down, your system can still function through the alternative communication channel. This dual communication channels can be implemented by application software. 4 RS232 ADAM-5090 Port1...
Page 105
PIN Name RJ-48 /DCD /DTR /DSR /RTS /CTS RI or +5V Function Provides communication ports for the ADAM-5510 to integrate other devices with communication function into your system Electrical Interface 4 ports (RS-232) Communication Rates 4800, 9600, 19200, 38400, 115200bps FIFO 128 bytes/per UART (Tx/Rx) Indicator...
Page 106
The ADAM-5090 module provides four RS-232 ports for communica- tion with target devices. The ports are numbered 1 through 4. For programming, the definition of port number depends on the slot number and port number. For example, the second port on the ADAM- 5090 in slot 1 is defined to port 12 (refer to table 6.1).
Page 107
There are two LEDs for each port on the front panel of the ADAM- 5090 to display specific communication status: a. Green LED (RX): Data Receiving Status; the LED indicator is on when the port is receiving data. b. Orange LED (TX): Data Transmitting Status; the LED indicator is on when the port is transmitting data.
Page 108
port_set_format(1,8,0,1); //Set port speed. Here we set communication speed of port 1 as 115200 bps. //(L is necessary) port_set_speed(1,115200L); //Enable Port FIFO. Here we enable 128 byte FIFO for port1. port_enable_fifo(1); //After these above settings are enabled, you can apply any other function library to implement your program.
Page 109
character=port_rx(1); //check whether FIFO is empty or not, if empty, send a character if(port_tx_empty(1)); port_tx(1, character)
Page 112
C or C++. However, there are limitations when running application programs in the ADAM-5511. In order to build successful applications, you should keep the following limitations and concerns in mind.
Page 114
For example, if you were to develop your application program in Borland C, you would compile the program as indicated in the screen below. 1. The ADAM-5511 does not support the standard PC function “8253”. Therefore, the C language, function call “delay ( )” cannot be used in ADAM-5511 applications.
Page 115
This section explains how to configure I/O module before applied into ADAM-5511 system. 1. Open the ADAM-5511 package and make sure that the following items are present: (1) One ADAM-5511 main unit with two blank slot covers. (2) One ADAM-5511 user’s manual.
Page 116
3. Connect the ADAM-5511 power cable between the power supply and the ADAM-5511 screw terminals (+Vs and GND). Please make sure that the power source is between +10 to +30 VDC . 4. Connect the straight through cable between the host computer and the ADAM-5511 COM3 for I/O modules configuration.
Page 117
ADAM-4000/5000 Windows Utility as ADAM-4000 and ADAM-5000 I/O module configuration tool. Installing procedure are as follows: 1. Insert ADAM-5511 Utility CD into the CD drive (e.g. D:) of the host 2. Find out the installation program from this path D:\ADAM4K5K\Windows Utility\Setup, then execute it. When the installation is completed, there will be an Advantech folder created automatically in drive C:\Program Files.
Page 118
Select the specific module, then sets the input/output range, baud rate, data format, checksum status. Note: Baud rate and Checksum can only be changed in the INIT* state. Changed settings only take effect after a module is rebooted. Address: Represents the address of the module. Range is from 0 to 255.
Page 119
(Support ADAM 4011, 4011D, 4012, 4014D, 4016, 4017, 4018, 4018M, 5013, 5017, 5017H, 5018 modules): Zero Calibration: (1). Apply power to the module and let it warm up for about 30 minutes. (2). Make sure that the module is correctly installed and is properly configured for the input range you want to calibrate.
Page 120
Span Calibration: (1). Click the Execute button. CJC Calibration: (1). Prepare a voltage source which is accurate to the mV level. (2). Run the zero calibration and span calibration function. (3). Use a temperature emulation device (such as Micro-10) to send a temperature signal to the ADAM module and then compare this signal with the reading from the ADAM module.
Page 121
Analog Input Resistance Calibration: Modules: ADAM 4013 Analog Output Calibration: 4~20 mA: ADAM 4021, ADAM 5024 0~10 V: ADAM 4016...
Page 122
The ADAM-5511 Windows Utility offers a graphical interface that helps you configure the ADAM-5511 stand-alone controller. This Windows Utility makes it very convenient to monitor your Data Acquisition and Control system. The following guidelines will give you some brief instructions on how to use the utility.
Page 123
Reset: Restart ADAM-5511 and re-execute the original program. Download: Transfer the selected program from PC to ADAM-5511. Delete: Delete the selected program from ADAM-5511. Refresh: Refresh the directory of ADAM-5511. ADAM-5511 Utility will auto-detect the com port in your PC when you start it up.
Page 124
Select the specific com port, then setting the baud rate and time out parameter. Baud rate: The communication speed (baud rate) can be configured from 9600 bps to 115.2 Kbps. Timeout: Timeout means the time limit for waiting a response after the system has issued a command.
Page 125
When you use the Search command, it will search for any connected modules on network and display their data. There are three ways to search for: 1. Click the Toolbar button: 2. Double click the left mouse button:...
Page 126
3. Click the tool menu and choose the Scan device command: The detected modules on network will show on the display.
Page 127
Windows Utility provides user a friendly environment. As you click the selected ADAM-5511, it will detect all module inserted on board. Select the specific module, the status will appeal without any configu- ration.
Page 128
Note: The range of AI/O module may be different by its resolution. For 12 bits resolution module, it scaled as 0~4095; for 16 bits resolution module, it scaled as 0~65535. In addition, Windows Utility provides a powerful tool for user to read easily in engineer unit.
Page 129
In addition to data monitoring, this utility allows user to force both digital and analog output without any programming. Digital output Force ON/OFF: Select a digital output module and double click the specific point. Execute force on/off command via write coil function block...
Page 130
Analog output Force value: Select an analog output module and double click the specific point. Execute force output value command via write coil function block...
Page 131
Before you download any program to ADAM-5511, please stop each program, then follow these steps... Step 1. Click the download icon and select the specific program in your Step 2. Wait for the file transfer from PC to ADAM-5511.
Page 132
Step 3. Select the specific program, then click the “Run” icon. ADAM-5511 has expansion ability by integrating ADAM-4000 module as remote and distributed I/O. However, there are some steps you need to follow. Step 1. Configure ADAM-4000 Module (Refer to chapter 5.2) Step 2.
Page 133
dress 8 for ADAM-4021, address 9 for ADAM-4050, address 10 for ADAM-4052, address 11 for ADAM- 4053, address 12 for ADAM-4060, and address 13 for ADAM-4080. #include <5511drv.h> void main() unsigned char BitData, rddata, ex11, ex12, ex13, ex14, ex17, ex18, ex21, ex50, ex52, ex53, ex60, ex80;...
Page 137
Step 3. System Organization and Program Download Set up the system as figure 5-27 When remote I/O function applied in the application, there must be two ADAM-4520 in addition. One for PC monitoring and one for remote I/O network.
Page 138
Run ADAM-5511 Windows Utility and download the executive program with remote I/O function. Run the executive program, then click the specific 5511 again for search ADAM-4000 module.
Page 139
ADAM-5511 Utility will not detect ADAM-4000 module automatically before download the program with remote I/O and restart ADAM-5511. ADAM-5511 designed as a standard Modbus product and could be integrated with HMI via simple method. Here is an integration example for ADAM-5511 and Fix 6.0 HMI software.
Page 140
Step 2. I/O Module Address Setting Before integrating ADAM I/O Module into the database of HMI software, please refer the table as below to map ADAM-4000/5000 I/O address. Analog type of ADAM-5000 I/O module: Slot Position Address 40001-40008 40009-40016 40017-40024 40025-40032 For example, if there is a ADAM-5024 (4-channel AO Module) in slot 2, the address of this module should be 40017~40020.
Page 141
Analog type of ADAM-4000 I/O module: Node Number Address 41001-41008 41009-41016 41017-41024 41025-41032 41249-41256 Digital type of ADAM-4000 I/O module: Node Number Address 01001-01016 01017-01032 01033-01048 01049-01060 01497-01512 Note: There is a limitation when you apply ADAM-4000 as remote I/O. The maximum of any mixed ADAM-4000 module is 32 nodes.
Page 142
Step 3. Database Development This is the last step to link ADAM-5511 and HMI software. Just fill the table to develop the database for ADAM-5511. HMI software will create a database table automatically. After completed the database development, it can be applied to...
Page 144
User-designed ADAM-5511 application programs make use of ADAM-5511 library functions. To make the most efficient use of ADAM-5511’s memory space, the ADAM-5511 function library has been separated into five smaller libraries. Therefore, a user can link only those libraries needed to run his application, and only those libraries will be included in the compiled executable.
Page 151
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. Example: void main(void) // codes placed here by user //delay 1 sec. ADAMdelay(1000); //codes placed here by user Remarks: None.
WDT_clear, WDT_disable, WDT_enable Syntax: void WDT_clear(void) void WDT_disable(void) void WDT_enable(void) Description: Clear watchdog timer Disable watchdog timer Enable watchdog timer Note: When the watchdog timer is enabled, it will have to be cleared at least once every 1.5 seconds. The watchdog timer default value is “disable”.
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.
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.
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 Return value: The single-byte value in backup RAM at address index.
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, from 0 to 61439; 60 KB battery backup SRAM in total. data A byte of data that the programmer wants to write to battery-protected SRAM.
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...
SetRTCtime Syntax: void SetRTCtime(unsigned char Time, unsigned char data) 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...
Get_NodeID Syntax: unsigned char Get_NodeID(void) Description: Gets the DIP switch number of the ADAM-5511 controller. Parameter Description None. Return value: The DIP switch number of the ADAM-5511 controller. Example: unsigned char SystemNodeNumber; void main() SystemNodeNumber = Get_NodeID(); If(SystemNodeNumber == 0x15)
Page 163
printf(“\nNode number Error!”); Remarks: None.
Get_BoardID(int Board) Description: Gets the type identification of the I/O module in a controller slot. Parameter Description Int Board The slot number of an ADAM-5511, from 0 to 3. Return value: The return values are: Example: unsigned char IOModuleName;...
Page 165
printf(“\nThe IO Board is NOT ADAM5051”); printf(“\nPlease Check your system setup”); Remarks: None.
Remarks: The program stop command is come from the “stop program” function icon of ADAM-5511 Windows Utility. User have to add this library in the end of each program, thus the “stop program” function icon will take effect.
Read_User_RAM Syntax: unsigned int read_user_ram(unsigned int index) Description: Read value from user RAM Parameter Description Index The index of Modbus memory address 0~511 mapping to Modbus address 42001~42512 Return value: The value in the specific address. Example: void main() //Read address 42002 read_user_ram(1);...
Page 168
Write_User_RAM Syntax: void write_user_ram(unsigned int index, unsigned int data) Description: Write value to user RAM Parameter Description Index The index of Modbus memory address 0~511 mapping to Modbus address 42001~42512 data The value you would like to write into the address Return value: None...
com_232_set_format Syntax: void com_232_set_format(int data_length, int parity, int stop_bit) Description: Sets the parameters data length, parity and stop bits of the RS-485 port. Parameter Description data_length Valid range 5 to 8 bits for one character. parity 0: no parity 1: odd parity 2: even parity stop_bit 1: 1 stop bit...
com_232_install Syntax: int com_232_install(char IsCustomerDefine) Description: Allocates the interrupt registers of the microprocessor for use by the RS-232 port and sets the interrupt vector to the interrupt service routine. Parameter Description IsCustomerDefine Communication interrupt status Return value: Installation success Installation fail Example: void main() unsigned char status,IsCustomDefine=0,rddata;...
Page 173
com_232_set_speed((unsigned long)9600); com_232_set_format(8,0,1); printf(“\nBR = 9600, 8 bit, even ,stop bit = 1”); else printf(“\nRS232 port install failed!”); //This is a very important library. As you using RS-232 port, please remember to add it in the end of your program. RS232CallBackRoutine(unsigned char rddata) //your interrupt program Remarks...
Page 174
com_232_install Syntax: int com_232_install(void) Description: Allocates the interrupt registers of the microprocessor for use by the RS-232 port and sets the interrupt vector to the interrupt service routine. Parameter Description None. Return value: integer; Installation status. 0 = Successful installation 1 = Drivers are already installed Example: void main()
com_232_deinstall Syntax: void com_232_deinstall(void) Description: Releases the interrupt register of the microprocessor for use by the RS- 232 port without changing the baud rate or DTR. Parameter Description None. Return value: None. Example: void main() //Releases the interrupt register for use by the RS-232 port com_232_deinstall();...
com_232_set_speed Syntax: void com_232_set_speed(unsigned long speed) Description: Sets the baud rate of the RS-232 port. Parameter Description speed The baud rate value. Return value: None. Example: void main() //Sets the baud rate of the RS-232 port to 9600bps com_232_set_speed(9600L); Remarks: None.
com_232_tx Syntax: void com_232_tx(char c) Description: This function sends a single character to the Tx pin of the RS-232 port, waits until the last bit is sent to the remote terminal, and then sets the RTS pin to OFF. Parameter Description c The character you would like to send.
com_232_tx_string Syntax: void com_232_tx_string(char *s) Description: com_232_tx_string() sends a string by calling com_232_tx() repeatedly. Parameter Description The string you would like to send. Return value: None. Example: void main() com_232_tx_string(“This is a string test.”); Remarks: None.
com_232_rx Syntax: char com_232_rx(void) Description: Returns the next character from the receiving buffer, or a NULL character(‘\0’) if the buffer is empty. Parameter Description None. Return value: The return character. Example: void main() char C232data; C232data=com_232_rx(); Remarks: None.
com_232_tx_ready Syntax: int com_232_tx_ready(void) Description: Check data transmitted already Parameter Description None. Return Value: 0 : data not ready 1 : data ready Remarks: None.
Page 182
com_232_rx_empty() com_232_tx_empty() Syntax: int com_232_rx_empty(void) int com_232_tx_empty(void) Description: Returns the status of the COM2 (RS-232) transmitting and receiving queues. Parameter Description None. Return value: Com_232_rx_empty() returns “TRUE” if the receiving queue is empty. Com_232_tx_empty() returns “TRUE” if the transmitting queue is empty.
Page 183
Remarks: The COM2 (RS-232) transmitter uses polling-action (not interrupt- action). Its queue is always empty.
com_232_carrier Syntax: int com_232_carrier(void) Description: Detects the carrier signal of 232 port. Parameter Description None. Return value: TRUE: If a carrier is present. FALSE: No carrier. Example: void main(void) if( com_232_carrier() == TRUE ) //Telephone carrier signal presented at 232 port, put your associate program here Remarks: None.
com_232_lower_dtr com_232_raise_dtr Syntax: void com_232_lower_dtr(void) void com_232_raise_dtr(void) Description: Sets 232 port to DTR for low signal. Sets 232 port to DTR for high signal. Parameter Description None. Return value: None. Example: None. Remarks: Please refer to the 16C550 UART register document (Appendix B).
com_232_lower_rts com_232_raise_rts Syntax: void com_232_lower_rts(void) void com_232_raise_rts(void) Description: Sets 232 port to RTS for low signal. Sets 232 port to RTS for high signal. Parameter Description None. Return value: None. Example: void main(void) //handshaking with external serial device com_232_lower_rts(); //generates a signal of 500 ms low trigger ADAMdelay(500);...
Page 188
Remarks: Please refer to the 16C550 UART register document (Appendix B).
Page 189
com_232_clear_break com_232_set_break Syntax: void com_232_clear_break(void) void com_232_set_break(void) Description: Sets 232 port to clear BREAK signal. Sets 232 port to send BREAK signal. Parameter Description None. Return value: None. Example: None. Remarks: Please refer to the 16C550 UART register document (Appendix B).
com_232_clear_local_loopback com_232_set_local_loopback Syntax: void com_232_clear_local_loopback(void) void com_232_set_local_loopback(void) Description: Sets 232 port to disable loopback function for diagnostic. Sets 232 port to enable loopback function for diagnostic. Parameter Description None. Return value: None. Example: None. Remarks: Please refer to the 16C550 UART register document (Appendix B).
Page 191
com_232_disable_fifo com_232_enable_fifo Syntax: void com_232_disable_fifo(void) int com_232_enable_fifo(void) Description: Sets 232 port to disable fifo receiving trigger level 1, 4, 8, 14. Sets 232 port to enable fifo receiving trigger level 1, 4, 8, 14. Parameter Description None. Return value: 0: success. -1: fifo not available.
com_232_read_scratch_register com_232_write_scratch_register Syntax: int com_232_read_scratch_register(void) void com_232_write_scratch_register(int value) Description: Reads from COM port scratch register. Writes to COM port scratch register. Parameter Description value Integer value one byte in length, as signed by user from the range 0 to FF. Return value: Please refer to the 16C550 UART register document (Appendix A).
Page 193
com_232_get_line_status, com_232_set_line_params, com_232_get_modem_status Syntax: int com_232_get_line_status(void) int com_232_set_line_params(unsigned lineparams) int com_232_get_modem_status(void) Description: Reads from COM port line control register. Writes to COM port line control register. Reads from COM port modem status register. Parameter Description lineparams Please refer to the UART specifications. Return value: Please refer to the 16C550 UART register document (Appendix A).
Page 194
RS232CallbackRoutine Syntax: void RS232CallBackRountine(unsigned char rddata) Description: Call subroutine applied for RS-232 port Parameter Description rddata default character Return value: None. Example: void main() unsigned char status,IsCustomDefine=0,rddata; status = com_232_install(IsCustomDefine); if( status == 0 ) printf(“\nRS232 port intall ok !”); com_232_set_speed((unsigned long)9600);...
Page 195
else printf(“\nRS232 port install failed!”); RS232CallBackRoutine(unsigned char rddata) //your interrupt program Remarks: This is a very important library. As you using RS-232 port, please remember to add it in the end of your program. modem_command Syntax: void modem_command(char *cmdstr) Description: Sends an AT command string to the modem.
Page 197
modem_initial Syntax: void modem_initial(void) Description: Sets modem to initial status. Due to the ADAM5511 system’s con- struction, the modem can only be connected to COM1. This resets the modem to the initial state. The command has the same effect as sending the ASCII command “atz”...
Page 198
modem_handup Syntax: void modem_handup(void) Description: Sets the modem to hand up the telephone. The command has the same effect as sending the ASCII command “atho” to the modem. Parameter Description None. Return value: None. Example: void main() //close phone modem_handup(); Remarks: None.
Page 199
modem_autoanswer Syntax: void modem_autoanswer(void) Description: Sets up modem to auto answer phone calls. Parameter Description None. Return value: None. Example: void main() //set modem auto answer and waiting phone call modem_autoanswer(); Remarks: None.
Page 200
modem_command_state Syntax: void modem_command_state(void) Description: Sets modem to command mode. In other words, this causes the modem to escape from data mode to command mode. The modem will delay at least 3 seconds before switching back to command mode. This command has the same effect as sending the ASCII command “+++”...
modem_dial Syntax: void modem_dial(char *telenum) Description: Directs modem to connect to the specified telephone number. Parameter Description telenum The phone number you would like to dial out. Return value: None. Example: void main() //COM port and modem initial OK //set the dial out number as 886222184567 modem_dial(“886222184567”);...
CRC16 Syntax: unsigned int CRC16(char *data_p, unsigned int length) Description: Calculates the CRC 16-bit value of the string *data_p. Parameter Description *data_p The string which you want to calculate CRC code. length The length of string *data_p. Return value: The CRC16 code. Example: unsigned char String[]=”this is a test CRC16";...
Checksum Syntax: unsigned int checksum(void *buffer, int len, unsigned int seed) Description: Calculates the checksum of the string or data array in the string buffer. Parameter Description buffer The string for which a user wants to calculate the checksum. The length of the data array in the buffer. seed A seed value added into the checksum for the purpose of calculation or security.
Page 204
Get5052(int Board, int Bit, int Size, void *pValue) Description: Reads the data value in an I/O module. Parameter Description Board ADAM-5511 slot number, from 0 to 3. See “Size” parameter below. Size ABit, AByte, AWord If Size= ABit, Bit=0..15 (pin0..pin15) If Size=AByte, Bit=0 for Low Byte data;...
Page 205
unsigned char Bdata; unsigned int Wdata; //Slot0, pin13, data=0 or 1 Get5051(0, 13, ABit, &Bdata); //Slot2, pin0~pin7, Bdata=Low Byte data Get5051(2, 0, AByte, &Bdata); // Slot3, pin0~pin15, Wdata=Word data Get5051(3, 0, AWord, &Wdata); Remarks: None.
Page 206
Set5050, Set5056, Set5060, Set5068 Syntax: void Set5050(void *pValue, int Board, int Bit, int Size) void Set5056(void *pValue, int Board, int Bit, int Size) void Set5060(void *pValue, int Board, int Bit, int Size) void Set5068(void *pValue, int Board, int Bit, int Size) Description: Sets the digital output for ADAM-5050, ADAM-5056, ADAM-5060 and ADAM-5068 modules to the specified values.
Page 208
Get501718 Syntax: void Get501718(int Board, int Channel, void *pValue) Description: Reads the data value in an I/O module. Parameter Description Board 0 - 3 for Slot0 ...Slot3 Channel 0 - 6 for ADAM-5018 0 - 7 for ADAM-5017 *pValue The value returned Note: The *pValue for ADAM-5017 and ADAM-5018 must be interpreted in reference to the range input that was...
Page 209
(j=0;j<7;j++) //Get ADAM-5018 data and range from channel 0 to 6 on slot 3 of ADAM-5511 Get501718(3,j,value); Remarks: None.
Page 210
*pValue The value returned Return value: None. Example: void main() int *value, j; //One ADAM-5017H module on slot 3 of the ADAM-5511 printf(“Get ADAM5017H..\n”); for (j=0;j<8;j++) //Get ADAM-5017H data from channel 0 to 7 on slot 3 of ADAM-5511 Get5017H(3,j,value);...
Page 212
The *pValue for ADAM-5013 must be interpreted in reference to the input range that was set during module configuration. Return Value: None. Example: void main() int *value, j; //One ADAM-5013 module on slot 0 of the ADAM-5511 printf(“Get ADAM-5013 Value..\n”); for (j=0;j<3;j++)
Page 213
//Get ADAM-5013 data and range from channel 0 to 2 on slot 0 of ADAM-5511 Get5013(0,j,value); Remarks: None.
Page 214
Init5024 Syntax: void Init5024(int Slot, int ch0_val, int ch1_val, int ch2_val, int ch3_val) Description: Initializes ADAM-5024 module in the slot indicated, loading user- specified analog output values into each of the modules’ four chan- nels. Parameter Description ch0_val The initial value output by channel 0 ch1_val The initial value output by channel 1 ch2_val...
Scale Syntax: float scale(int val, float SrcHi, float SrcLow, float DestHi, float Dest- Low) Description: Auto scaling the value from source range to destination range. Parameter Description the original value SrcHi the high limit of original range SrcLow the low limit of original range DestHi the high limit of target range DestLow...
Page 216
Set5024 Syntax: void Set5024(void *pValue, int Board, int Channel) Description: Specifies the output of a channel of a selected ADAM-5024. Parameter Description *pValue The value set for analog output Board Slot number = 0 - 3 Channel AO channel = 0 - 3 Return Value: None.
Page 217
Init5080 Syntax: void Init5080(int slotno) Description: Initial ADAM-5080 Module Parameter Description slotno The specific slot inserted with ADAM- 5080 0-3 or slot0-slot3 Return Value: None Example: void main () //initializes the ADAM-5080 Module in slot 0 init5080(0); Remarks: None.
Page 218
Get5080 Syntax: void Get5080(int slotno, int channel, long *pValue) Description: Get Value from specific channel in ADAM-5080 Parameter Description slotno The specific slot inserted with ADAM-5080 0-3 or slot0-slot3 channel The specific channel in ADAM-5080 *pValue The Value returned Return Value: The Value from the specific channel Example: void main ()
Page 220
GetRange5080 Syntax: void GetRange5080(int Board, void *pValue) Description: Reads the counter range of ADAM-5080 module. Parameter Description Board 0 - 3 for Slot0 ...Slot3. *pValue The counter range code returned. Return Value: None. Remarks: None...
Page 221
Clear Counter Syntax: int Clear_Counter(int slotno, int channel) Description: Reset the current counter value to its initial value Parameter Description slotno The specific slot inserted with ADAM-5080 0-3 or slot0-slot3 channel The specific channel in ADAM-5080 Return Value: None Example: void main () //reset ADAM-5080 channel 0 counter value in slot 0 int Clear_Counter(0, 0);...
Start/Stop Counter Syntax: int Stop_Start_Counter(int slotno, int channel, StartOrStop) Description: Start or stop the specific counter Parameter Description slotno The specific slot inserted with ADAM-5080 0-3 or slot0-slot3 channel The specific channel in ADAM-5080 Start Stop Return Value: None Example: void main () int Start=1, Stop=0;...
Read Overflow Syntax: void ReadOverflowFlag(int slotno, char *pValue) Description: Check if counter value reach max. count limit Parameter Description slotno The specific slot inserted with ADAM-5080 0-3 or slot0-slot3 *pValue The value returned Return Value: The overflow value returned Example: void main () char overflag_value[4];...
Page 225
Set Initial Value Syntax: int SetInitCounterVal(int slotno, int channel, unsigned long Value) Description: Set initial counter value (between 0 to 4,294,967,295) Parameter Description slotno The specific slot inserted with ADAM-5080 0-3 or slot0-slot3 channel The specific channel in ADAM-5080 Return Value: None Example: void main ()
Page 226
Baud Rate Setup Syntax: void ADAM_BaudRate_Setup(unsigned long speed) Description: Set the baud rate of ADAM-4000 Remote I/O Network Parameter Description speed Baud Rate Setting 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 Return Value: None Example: void main () //set the baud rate of ADAM-4000 I/O as 9600bps ADAM_BaudRate_Setup(9600);...
Page 227
Init4011 Syntax: char initADAM4011(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4011 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4011 as ID#2, Check Sum False initADAM4011(2, False);...
Page 228
Init4011D Syntax: char initADAM4011D(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4011D module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4011D as ID#2, Check Sum False initADAM4011D(2, False);...
Page 229
Init4012 Syntax: char initADAM4012(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4012 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4012 as ID#3, Check Sum False initADAM4012(3, False);...
Page 230
Init4013 Syntax: char initADAM4013(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4013 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4013 as ID#4, Check Sum False initADAM4013(4, False);...
Page 231
Init4014 Syntax: char initADAM4014(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4014 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4014 as ID#5, Check Sum False initADAM4014(5, False);...
Page 232
Init4017 Syntax: char initADAM4017(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4017 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4017 as ID#6, Check Sum False initADAM4017(6, False);...
Page 233
Init4018 Syntax: char initADAM4018(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4018 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4018 as ID#7, Check Sum False initADAM4018(7, False);...
Page 234
Init4021 Syntax: char initADAM4021(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4021 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4021 as ID#8, Check Sum False initADAM4021(8, False);...
Page 235
Init4050 Syntax: char initADAM4050(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4050 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4050 as ID#9, Check Sum False initADAM4050(9, False);...
Page 236
Init4052 Syntax: char initADAM4052(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4052 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4052 as ID#10, Check Sum False initADAM4052(10, False);...
Page 237
Init4053 Syntax: char initADAM4053(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4053 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4053 as ID#11, Check Sum False initADAM4053(11, False);...
Page 238
Init4060 Syntax: char initADAM4060(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4060 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4060 as ID#12, Check Sum False initADAM4060(12, False);...
Page 239
Init4080 Syntax: char initADAM4080(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4080 module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4080 as ID#13, Check Sum False initADAM4080(13, False);...
Page 240
Init4080D Syntax: char initADAM4080D(int ID, char ChkSumEn) Description: Initializes the network ID and check Sum for ADAM-4080D module Parameter Description Node number on the network 1~32 ChkSumEn Check Sum Enable True, False Return Value: None Example: void main () //initialize ADAM-4080D as ID#13, Check Sum False initADAM4080D(13, False);...
Page 241
Get4011 Syntax: void Get4011(int ID, unsigned int *pValue) Description: Get Value from ADAM-4011 Module Parameter Description Node number on the network 1~32 *pValue The value returned Return Value: None Example: void main () unsigned int *data11 //initialize ADAM-4011 as ID#2, Check Sum False initADAM4011(2, False);...
Page 243
Get4012 Syntax: void Get4012(int ID, unsigned int *pValue) Description: Get Value from ADAM-4012 Module Parameter Description Node number on the network 1~32 *pValue The value returned Return Value: None Example: void main () unsigned int *data12 //initialize ADAM-4012 as ID#3, Check Sum False initADAM4012(3, False);...
Page 245
Get4013 Syntax: void Get4013(int ID, unsigned int *pValue) Description: Get Value from ADAM-4013 Module Parameter Description Node number on the network 1~32 *pValue The value returned Return Value: None Example: void main () unsigned int *data13 //initialize ADAM-4013 as ID#4, Check Sum False initADAM4013(4, False);...
Page 247
Get4014 Syntax: void Get4014(int ID, unsigned int *pValue) Description: Get Value from ADAM-4014 Module Parameter Description Node number on the network 1~32 *pValue The value returned Return Value: None Example: void main () unsigned int *data14 //initialize ADAM-4014 as ID#5, Check Sum False initADAM4014(5, False);...
Page 249
Get4017 Syntax: void Get4017(int ID, int channel, unsigned int *pValue) Description: Get Value from ADAM-4017 Module Parameter Description Node number on the network 1~32 Channel channel number of ADAM-4017 module *pValue The value returned Return Value: None Example: void main () unsigned int *data17;...
Page 251
Get4018 Syntax: void Get4018(int ID, int channel, unsigned int *pValue) Description: Get Value from ADAM-4018 Module Parameter Description Node number on the network 1~32 Channel channel number of ADAM-4018 module *pValue The value returned Return Value: None Example: void main () unsigned int *data18;...
Page 253
Set4021 Syntax: void Set4021(int ID, unsigned int *pValue) Description: Set Value to ADAM-4021 Module Parameter Description Node number on the network 1~32 *pValue The setting value Return Value: None Example: void main () unsigned int *data21=1000; //initialize ADAM-4021 as ID#8, Check Sum False initADAM4021(8, False);...
Page 255
Set4050, Set4060 Syntax: void Set4050(int ID, void *pValue, int Bit, int Size) void Set4060(int ID, void *pValue, int Bit, int Size) Description: Sets the digital output for ADAM-4050, ADAM-4060 modules to the specified values. Parameter Description Node number on the network 1~32 pValue The digital value specified by the user to...
Page 256
//initialize ADAM-4050 as ID#9, Check Sum False initADAM4050(9, False); //Output 1 to slot 0, pin 13 Set4050(9, Bitdata, 13, ABit); Remarks: None.
Page 257
Get4050, Get4052, Get4053 Syntax: void Get4050(int ID, void *pValue, int Bit, int Size) void Get4052(int ID, void *pValue, int Bit, int Size) void Get4053(int ID, void *pValue, int Bit, int Size) Description: Reads the data value in an I/O module. Parameter Description Node number on the network...
Page 258
//initialize ADAM-4050 as ID#9, Check Sum False initADAM4050(9, False); //Get value from ADAM-5050, pin13, data=0 or 1 Get5050(9, Bdata, 13, ABit); Remarks: None.
Page 259
Get4080 Syntax: char Get4080(int ID, int channel, unsigned long *pValue) Description: Get Value from ADAM-4080 Module Parameter Description Node number on the network 1~32 Channel channel number of ADAM-4017 module *pValue The value returned Return Value: None Example: void main () unsigned long *Idata80;...
Page 261
Clear 4080 Counter Syntax: char Clear_4080_Counter(int ID, int Channel) Description: Reset the current counter value to its initial value Parameter Description Node number on the network 1~32 channel The specific channel in ADAM-4080 Return Value: None Example: void main () //initialize ADAM-4080 as ID#13, Check Sum False initADAM4080(13, False);...
Page 262
Start/Stop 4080 Counter Syntax: char Start_Stop_4080_Counter(int ID, int channel, StartOrStop) Description: Start or stop the specific counter Parameter Description Node number on the network 1~32 channel The specific channel in ADAM-5080 Start Stop Return Value: None Example: void main () int Start=1, Stop=0;...
Page 263
ids=Start_Stop_4080_Counter(13, 0, 1); //if the returned value is 0, print out the start fail message if(ids==0) printf(‘start failed\n”); Remarks: None.
Page 265
Port \ Slot Slot 0 Slot 1 Slot 2 Slot 3 Port 1 Port 2 Port 3 Port 4 Install Port Install the communication drivers int port_install(int portno) portno The specified port number first time install and install completely! not first time install but install completely! portno error no ADAM5090 Module in this slot...
Page 266
Deinstalled Port Uninstalled the communication drivers completely int port_deinstalled(int portno) portno The specified port number deinstall success deinstall fail...
Page 267
Select Working Port Select a specified port for work void port_select(int portno) portno The specified port number None...
Page 268
Reset Slot Reset specified slot int reset_slot(int slotno) slotno The slot you would like to reset None void main () //reset all port in the slot 0 reset_slot(0);...
Page 269
Reset Port Reset specified port void port_reset(int portno) portno The specified port number None...
Page 270
Detect Installed Port Detects which ports have been installed int which_has_been_installed(void) portno The specified port number Port mask which has been installed 0x2353 (0010-0011-0101-0011B) The port01,02,11,13,21,22,32 have been installed 0x0082 (0000-0000-1000-0010B) The port02,14 have been installed void main () int Flag; //here we install port1, 12, 23 port_install(1);...
Page 271
Set Port Baud Rate Set the baud rate of specified port void port_set_speed(int portno, long speed) portno The specified port number long speed 4800L, 9600L, 19200L, 38400L, 115200L None void main () //here we install port1, 2 port_install(1); port_install(2); //select working port1, and set the communication rate to 38400bps port_select(1);...
Page 272
Set Port Data Format Set the parameters for data length, parity and stop bits for specified port void port_set_format(int portno, int data_length, int parity, int stop_bit) portno The specified port number data length 5 - 8 parity 0x00 no parity 0x01 odd parity 0x02...
Page 273
Disable Port FIFO (FIFO Size=1, for Tx and Rx) Enable Port FIFO (FIFO Size=128, for Tx and Rx) Set specified port to disable FIFO Set specified port to enable FIFO void port_disable_fifo(int portno) int port_enable_fifo(int portno) portno The specified port number Disable FIFO : None Enable FIFO...
Page 274
Detect Port Carrier Detect the carrier signal of specified port int port_carrier(int portno) portno The specified port number : no carrier been detected or bad command or parameter : detect carrier void main () port_install(1); port_enable_fifo(1); //if port1 detected carrier, print out the message if(port_carrier(1));...
Page 275
Clear Port Break Set Port Break Set specified port to clear BREAK signal Set specified port to send BREAK signal void port_clear_break(int portno) void port_set_break(int portno) portno The specified port number None void main () port_install(1); port_enable_fifo(1); //set port1 to clear break signal port_clear_break(1);...
Page 276
Clear Local Loopback Set Local Loopback Set specified port to disable loopback function for diagnostic Set specified port to enable loopback function for diagnostic void port_clear_local_loopback(int portno) void port_set_local_loopback(int portno) portno The specified port number None void main () port_install(1); port_enable_fifo(1);...
Page 277
Read LSR Set LCR Read from specified port line status register (LSR) Write to specific port line control register (LCR) int port_get_line_status(int portno) int port_set_line_params(int portno, int lineparams) portno The specified port number lineparams Line control register parameter (see UART Register Description Table) port_get_line_status 0x00XX LSR value...
Page 278
void main () int LSR_Value, LCR_Params; port_install(1); port_enable_fifo(1); //get LSR value LSR_Value=port_get_line_status(1); //set LCR value=0x03 LCR_Params=0x03; port_set_line_status(1, LCR_Params); Register Description Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 Name Line Status Data Rx Break Framing Parity Overrun RxRDY Register Error Empty Empty Error...
Page 279
Read Modem Status (MSR) Read from specified port modem status register int port_get_modem_status(int portno) portno The specified port number 0x00XX modem status 0xFF00 bad command or parameter void main () int MSR_Value; port_install(1); port_enable_fifo(1); //get MSR value MSR_Value=port_get_modem_status(1); Register Description Bit7 Bit6 Bit5...
Page 280
Read Modem Control Register (MCR) Set Modem Control Register (MCR) Read from specified port modem control register Set from specified port modem control register int port_get_modem_control_status(int portno) int port_set_modem_control_params(int portno, int MCRparams) portno The specified port number MCRparams Modem control register parameter (see UART Register Description Table) Read MCR: 0x00XX :...
Page 281
void main () int MCR_Value, MCR_Params; port_install(1); port_enable_fifo(1); //set MCR value=3 (RTS=1; DTR=1) MCR_Params=3 port_set_modem_control_params(1, MCR_Params); //get MCR value MCR_Value=port_get_modem_control_status(1); // MCR value must be 3 Register Description Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 Name Line Status Data Rx Break Framing Parity...
Page 282
Set DTR Low Set DTR High Set specified port DTR low Set specified port DTR high void port_lower_dtr(int portno) void port_raise_dtr(int portno) portno The specified port number None void main () port_install(1); //set port1 DTR low port_lower_dtr(1); //set port1 DTR high port_raise_dtr(1);...
Page 283
Set RTS High Set RTS Low Set specified port RTS high Set specified port RTS low void port_raise_rts(int portno) void port_lower_rts(int portno) portno The specified port number None void main () port_install(1); //set port1 RTS low port_lower_rts(1); //set port1 RTS high port_raise_rts(1);...
Page 284
Modem Initial Set modem to initial status modem_initial_90(int portno) portno The specified port number None...
Page 285
Send Modem AT Command Send AT command string to the modem modem_command_90(int portno, char *cmdstr) portno The specified port number *cmdstr AT command string None...
Page 286
Set Modem Command Mode Set modem to command mode void modem_command_state_90(int portno) portno The specified port number None...
Page 287
Set Modem Autoanswer Set up modem to auto answer phone calls void modem_autoanswer_90(int portno) portno The specified port number None...
Page 288
Modem Dial Out Direct modem to dial the specified telephone number void modem_dial_90(int portno, char *telnumber) portno The specified port number *telnumber The telephone number you would like to dial out None void main () port_install(1); //initial modem for port1 modem_initial_90(1);...
Page 289
Han up Modem Set modem to hand up the telephone void modem_handup_90(int portno) portno The specified port number None...
Page 290
Rx Flush Tx Flush Flush Rx or Tx FIFO void port_flush_rx(int portno) void port_flush_tx(int portno) portno The specified port number None...
Page 291
Receive Error Check Check whether receive error or not int port_rx_error(int portno) portno The specified port number 0 : no error 0x00XX : receive error and return LSR value void main () int Err_Value; port_install(1); //get error check value; if error, print out the message Err_Value=port_rx_error(1);...
Page 292
Ready Check Check received data in port FIFO already int port_rx_ready(int portno) portno The specified port number 0 :data not ready 1 :data ready...
Page 293
Receive Character Receive a character from specific port char port_rx(int portno) portno The specified port number Character void main () char C; port_install(1); //if port1 FIFO receive data, read a character and print it out If(port_rx_ready(1)); C=port_rx(1); printf(“\n %C”, C);...
Page 294
Empty Check Return the status of the specified port transmit queues int port_tx_empty(int portno) portno The specified port number 0 : not empty 1 : FIFO empty 2 : FIFO and Transmitting empty...
Page 295
Send Character Send a character to the THR of the specified port void port_tx(int portno, char c) portno The specified port number The character you would like to send None main() char character port_installed(1) //check whether FIFO empty or not, if empty, send a character if(port_tx_empty(1);...
Page 296
Send String Sends a string by calling port_tx() repeatedly void port_tx_string(int portno, char *s) portno The specified port number the string you would like to send None main() char string port_installed(1) //check whether FIFO empty or not, if empty, send a string if(port_tx_empty(1);...
Page 298
This appendix gives a short description of each module’s registers. For more information, please refer to the STARTECH 16C550 UART chip data book. All registers are one byte. 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.
Page 299
BASE+1 Interrupt Status Register (ISR) when DLAB=0 bit 0: Enable received-data-available interrupt bit 1: Enable transmitter-holding-register-empty interrupt bit 2: Enable receiver-line-status interrupt bit 3: Enable modem-status interrupt BASE+2 FIFO Control Register (FCR) bit 0: Enable transmit and receive FIFOs bit 1: Clear contents of receive FIFO bit 2: Clear contents of transmit FIFO bits 6-7: Set trigger level for receiver FIFO interrupt BASE+3 Line Control Register (LCR)
Page 300
BASE+4 Modem Control Register (MCR) bit 0: DTR bit 1: RTS BASE+5 Line Status Register (LSR) bit 0: Receiver data ready bit 1: Overrun error bit 2: Parity error bit 3: Framing error bit 4: Break interrupt bit 5: Transmitter holding register empty bit 6: Transmitter shift register empty bit 7: At least one parity error, framing error or break indication in the FIFO...
Page 302
The ADAM analog input modules can be configured to transmit data to the host in Engineering Units. Data can be represented in Engineering Units by setting bits 0 and 1 of the data format/checksum/integration time parameter to 0. This format presents data in natural units, such as degrees, volts, millivolts, and milliamps.
Page 303
The input value is -2.65 V and the corresponding analog input module is configured for a range of ±5 V. The response to the Analog Data In command is: -2.6500(cr) The input value is 305.5ºC. The analog input module is configured for a Type J thermocouple whose range is 0ºC to 760ºC.
Page 307
Note: The full scale values in this table are theoretical values for your reference; actual values will vary.
Page 308
You can configure ADAM analog output modules to receive data from the host in Engineering Units. Data can be represented in engineering units by setting bits 0 and 1 of the data format/checksum/integration time parameter to 0. This format presents data in natural units, such as milliamps. The Engineering Units format is readily parsed by the majority of computer languages as the total data string length is fixed at six characters: two decimal digits, a decimal point and three decimal...
Page 309
Note: See next page for table continuation.
Page 310
Note: This table continued from previous page.
Page 311
ADAM 5000 AI/AO Scaling Module Type Range Low Range High Scale Low Scale High Data Format -100 65535 U16B 65535 U16B 385(IEC) 65535 U16B 65535 U16B -100 65535 U16B 5013RTD 65535 U16B 395(JIS) 65535 U16B 65535 U16B 65535 U16B 65535 U16B -150 65535...
Page 314
C:\ADAM5511\Example. The following list describes these examples. Example 1 (Ex1.prj) This example scans all slots in an ADAM-5511 and then shows the status of any I/O modules(include AI/O, DI/O, Counter, and Series Communication Module) located in the slots. Example 2 (Ex2.prj) This is a modem test example which includes dial, hang-up, auto- answer and set break.
Page 316
EIA RS-485 is the industry’s most widely used bidirectional, balanced transmission line standard. It is specifically developed for industrial multi-drop systems that should be able to transmit and receive data at high rates or over long distances. The specifications of the EIA RS-485 protocol are as follows: •...
Page 317
Multi-drop RS-485 implies that there are two main wires in a segment. The connected systems tap from these two lines with so called drop cables. Thus all connections are parallel and connecting or discon- necting of a node doesn’t affect the network as a whole. Since ADAM-5510/P31 systems use the RS-485 standard, they can connect and communicate with the host PC.
Page 318
In this scheme the repeaters are connected to drop-down cables from the main wires of the first segment. A tree structure is the result. This scheme is not recommended when using long lines since it will cause a serious amount of signal distortion due to signal reflections in several line-endings.
Page 319
This is a combination of daisychain and hierarchical structure.
Page 320
Each discontinuity in impedance causes reflections and distortion. When a impedance discontinuity occurs in the transmission line the immediate effect is signal reflection. This will lead to signal distortion. Specially at line ends this mismatch causes problems. To eliminate this discontinuity, terminate the line with a resistor.
Page 321
Because each input is biased to 2.4 V, the nominal common mode voltage of balanced RS-485 systems, the 18 kΩ on the input can be taken as being in series across the input of each individual receiver. If thirty of these receivers are put closely together at the end of the transmission line, they will tend to react as thirty 36kΩ...
Page 322
Thus as already stated above the line termination resistor R will normally equal the characteristic impedance Z The star connection causes a multitude of these discontinuities since there are several transmission lines and is therefore not recommend. Note: The recommend method wiring method, that causes a minimum amount of reflection, is daisy chaining where all receivers tapped from one transmission line needs only to be terminated twice.
Page 324
Unfortunately, it’s impossible to finish a system integration task at one time. We always meet some trouble in the field. A communication network or system isn’t stable, induced noise or equipment is damaged or there are storms. However, the most usual issue is just simply improper wiring, ie, grounding and shielding.
Page 325
As you know, the EARTH cannot be conductive. However, all build- ings lie on, or in, the EARTH. Steel, concrete and associated cables (such as lighting arresters) and power system were connected to EARTH. Think of them as resistors. All of those infinite parallel resistors make the EARTH as a single reference point.
Page 326
Single Phase, Three Line 110V 220V 110V Neutral is the physical cable from Generator. Ground is the local physical cable that connected to Ground Bar . Grounding is one of the most important issues for our system. Just like Frame Ground of the computer, this signal offers a reference point of the electronic circuit inside the computer.
Page 327
Have you ever tried to measure the voltage between a live circuit and a concrete floor? How about the voltage between neutral and a concrete floor? You will get nonsense values. ‘Hot’ and ‘Neutral’ are just relational signals: you will get 110VAC or 220VAC by measuring these signals.
Page 328
• Ground-pin is longer than others, for first contact to power system and noise bypass. • Neutral-pin is broader than Live-pin, for reducing contact imped- ance.
Page 329
• What’s the purpose of high voltage transmission? We have all seen high voltage transmission towers. The power plant raises the voltage while generating the power, then a local power station steps down the voltage. What is the purpose of high voltage transmission wires ? According to the energy formula, P = V * I, the current is reduced when the voltage is raised.
Page 331
Single Point Grounding A D A M A D A M A D A M A D A M 4 0 1 3 4 0 1 4 4 0 1 7 4 0 2 1 Power Supply Those devices will influence each other with swiftly load change.
Page 332
Single Point Grounding +24 V Power Supply +16V +18V +20V +22V +22V +22V Power Supply More cable, but more stable system. The above diagram shows you that a single point grounding system will be a more stable system. If you use thin cable for powering these devices, the end device will actually get lower power.
Page 333
• Single isolated cable The diagram shows the structure of an isolated cable. You see the isolated layer which is spiraled Aluminum foil to cover the wires. This spiraled structure makes a layer for shielding the cables from external noise.
Page 334
• Double isolated cable Figure 10 is an example of a double isolated cable. The first isolating layer of spiraled aluminum foil covers the conductors. The second isolation layer is several bare conductors that spiral and cross over the first shield layer. This spiraled structure makes an isolated layer for reducing external noise.
Page 335
ADAM ADAM ADAM ADAM 4520 4013 4017 4021 RS-232 Terminal Block +24V Never stripping too long of the plastic cable cover. Power * Cascade those shields together by Soldering Supply Connect the shield to Frame-Ground of DC Power Supply. • Never stripping too much of the plastic cable cover. This is improper and can destroy the characteristics of the Shielded-Twisted-Pair cable.
Page 336
• The characteristic of the cable Don’t strip off too much insulation for soldering. This could change the effectiveness of the Shielded-Twisted-Pair cable and open a path to introduce unwanted noise.
Page 337
• Shield connection (1) If you break into a cable, you might get in a hurry to achieve your goal. As in all electronic circuits, a signal will use the path of least resis- tance. If we make a poor connection between these two cables we will make a poor path for the signal.
Page 338
• Shield connection (2) The previous diagram shows you that the fill soldering just makes an easier way for the signal.
Page 339
• Isolate noise sources in shielded enclosures. • Place sensitive equipment in shielded enclosure and away from computer equipment. • Use separate grounds between noise sources and signals. • Keep ground/signal leads as short as possible. • Use Twisted and Shielded signal leads. •...
Page 340
• Follow the single point grounding rule? • Normal mode and common mode voltage? • Separate the DC and AC ground? • Reject the noise factor? • The shield is connected correctly? • Wire size is correct? • Soldered connections are good? •...
Need help?
Do you have a question about the ADAM-5511 and is the answer not in the manual?
Questions and answers