Home

ADAM-5510 Manual Ed 6

image

Contents

1. eee L 1 1 1 Standalone Data Acquisition and Control System1 2 1 2 Features cle der RR Gy RO vi pU IER REIR 1 2 1 2 1 Control flexibility with C programming 1 2 1 2 2 RS 232 485 communication ability 1 2 1 2 3 Complete set of I O modules for total solutions 1 2 1 2 4 Built in real time clock and watchdog timerl1 3 1 3 System Configuration sese 1 3 Chapter 2 Installation Guidelines 2 1 2 1 Starting up ADAM 5510 sss 2 2 2 2 Module Installation 2 neret 2 6 2 3 I O Slots and I O Channel Numbering 2 7 2 4 IM GUNTIN G stet yada ea OP uate EH RENTE UR 2 7 2 5 Jumper Settings and DIP Switch Settings 2 9 2 6 Wiring and Connections see 2 11 2 7 LED Status of the ADAM 5510 A2 Unit 2 13 Chapter 3 ADAM 5510 System 3 1 3 T QV LVIeW isc sain eerie ERE ERRR cs Re Rep ERE TER SER 3 2 3 2 Major Features coii eed RR ei RH IER eere 3 2 3 3 Technical Specifications of ADAM 5510 System 3 3 3 4 Basic Function Block Diagram eese 3 6 Chapter 4 I O Modules ecce d 1 Chapter 5 Programming and Downloading 5 1 5 I Programimi nE gece cons acids sete eiei mdr der Rr rH RM 5 2 5 2 File Download and Transfer eese 5 7 5 3 Setup Procedure of Remote Turbo Debugger 5 11 Chapter 6
2. 2 6 Figure 2 6 ADAM 5510 panel mounting screw placement 2 7 Figure 2 7 ADAM 5510 rail mounting eee 2 8 Figure 2 8 Jumper locations on the CPU card sss 2 9 Figure 2 9 COM2 port RS 485 control mode setting JP3 2 9 Figure 2 10 Watchdog timer setting eee 2 10 Figure 2 11 ADAM 5510 network address DIP switch 2 10 Figure 2 12 ADAM 5510 power wiring eee 2 11 Figure 3 1 ADAM 5510 system amp I O module dimensions 3 5 Figure 3 2 Function block diagram es 3 6 Figure 5 1 Converting program codes sseeee 5 4 Figure 5 2 Man sCreen oie pseseevetet du ecte EE EEEE ie eux 5 8 Figure 5 3 Program downloading sse 5 9 Figure 5 4 Program downloaded successfully 5 9 Figure 5 57 Elle transfer ori se ert recte edente 5 10 Figure 5 6 Wiring for turbo debugging eese 5 11 Figure 5 7 Creating TDADAM EXE HH 5 12 Figure 5 8 Configuring Turbo C editor sees 5 13 Figure 5 9 Creating new transfer item sse 5 13 Figure 5 10 New transfer item for ADAM 5510 turbo debugger 5 14 Figure 5 11 Linking ADAM 5510 for remote debugging 5 14 Figure E 1 Figure E 2 Figure E 3 Figure E 4 Figure E 5 Figure E 6 Figure F 1 Figure F 2 Figure F 3 Figure F 4 Figure F
3. 1 6 Configure the I O modules that you want to implement in the applications See Chapter 4 Write and simulate control logic on host PC Convert the programs into 80188 or 80186 compatible codes The floating operation must be set to emulation mode Then compile the application programs Transfer program code into the SRAM D drive of ADAM 5510 Then execute it to check if it works as intended If the program works as intended download the program into the flash ROM C drive of ADAM 55 10 Re power on the ADAM 5510 system to let it standalone operates Note For more details on Steps 2 through 6 see Chapter 5 ADAM 5510 A 3 Quick Start Example This page intentionally left blank A 4 ADAM 5510 B COM Port Register Structure Register Structure This appendix gives short description of each of the module s registers For more information please refer to the data book for the STARTECH 16C550 UART chip 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 COMI is 3F8h and COM2 is 2F8h DLAB is the Divisor Latch Access Bit bit 7 of BASE 3 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 write BASE 0_ Divisor latch bits 0 7 when DLAB 1 BASE 1 Divis
4. 7 Avoid creating sharp bends in the wires Programming port connection The ADAM 5510 has a programming port with a DB 9 connection This port allows you to program configure and troubleshoot the ADAM 5510 from your host computer The programming port has an RS 232 interface and only uses TX RX and GND signals The pin assignment of the port is as follows Pin No Description Pin 1 Not Used Pin 2 Tx Pin 3 Rx Pin 4 Not Used Pin 5 GND Pin 6 Not Used Pin 7 Not Used Pin 8 Not Used Pin 9 Not Used Table 2 1 DB 9 programming port pin assignments RS 232 port connection The COMI 3F8 port is dedicated as an RS 232 interface and has a DB 9 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 2 12 ADAM 5510 Chapter 2 2 7 sure to check the pin assignments for the connector The following table shows the pin assignments for the COMI port PinNo Description DSR Table 2 2 RS 232 port pin assignments RS 485 port connection The COM2 2F8 port is dedicated as an RS 485 interface Screw terminals DATA and DATA are used for making the COM2 RS 485 connections LED Status of the ADAM 5510 A2 Unit The ADAM 5510 A2 unit front panel cover has four LEDs which display the following four status a Red LED Power base unit power
5. 100 00 0 0000 000 00 0000 0 0000 2 5000 000 00 100 00 Reading 10000 0000 00 000 20 000 1 pA 000 00 100 00 Reading 0000 8000 z z N N N x n T T m m T T m n m m m T T m m m T T T m eo Qo e eo 2 e e Two s Complement 07h Not Used ADAM 5510 C 5 Data Formats and I O Ranges Input Range Data Formats Maximum Minimum Displayed Actual Description Specified Specified Resolution Value Engineering Type J Units Thermocouple of FSR Reading 0 C to z ee Con p Engineerin 1000 0 0000 0 0 1 C Thermocouple of FSR Reading o 0 C to 1000 C Two s Complement Engineering Units of FSR 100 C to F 400 C Two s 1 LSB Engineerin 1000 00 0000 0 4C Thermocouple Type T Thermocouple Reading Complement 3E l Q o 3 5 o 3 o of FSR 100 00 000 00 0 01 Reading 9 CI Two s FFF 000 LSB 1000 C Engineering Type R Units Thermocouple of FSR Reading 500 C to o Two s FFF 492 1750 C Complement Engineerin 1750 0 0500 00 0 1 C Type S g g Units Thermocouple of FSR Reading o o 500 C to 1750 C Two s Complement Engineering Units 96 of FSR 100 00 027 77 0 0196 Reading 500 e i Two s TFFF 2381 1 LSB 1800 C Complement Type B Thermocouple o Q e 3 v o 3 o a S C 6 ADAM 5510 Appendix C C 4 Analog Input Ranges ADAM 5017H R
6. 100 00 a 100 00 000 00 L 200 00 4000 00 100 00 100 00 il 100 00 000 00 200 00 000 00 ADAM 5510 C 9 Data Formats and I O Ranges Note This table continued from previous page 100 Ohms Engineering 600 00 000 00 Platinum RTD 0 to 600 C a 0 00392 120 Ohms Engineering 100 00 80 00 Nickel RTD 80 to 100 C 120 Ohms Engineering 100 00 000 00 Nickel RTD 0 to 100 C C 10 ADAM 5510 Examples on Utility Diskettes Examples on Utility Diskettes Nine examples are included on the two ADAM 5510 utility diskettes After you install the utility diskettes on your host PC these examples will be located in the directory C 5510 SOURCE The following list describes these examples Example 1 Ex1 prj ADAM 5510 reads data from low speed analog input modules then shows the data on screen with the help of the ADAM 5510 utility Example 2 Ex2 prj ADAM 5510 sets the output values of some analog output and digital output modules Then it gets data from some analog input and digital input modules and shows the data on screen with the help of the ADAM 55 10 utility Example 3 Ex3 prj This example demonstrates the ability of the ADAM 5510 to communi cate with other ADAM products such as the ADAM 5000 485 system or ADAM 4000 series modules In this example session the host PC runs ADAM EXE and acts as the master while ADAM 5510 acts as the slave Example 4 E
7. Menu item Sub menu option Default value Compiler EXE file C Mtc bin tc exe Modify settings according to actual Project file PRJ C 5510 source ex1 prj Paths at the user s host PC i Debugger EXE file C td30 td exe Turbo debug program PC comm port COM1 Host PC COM port rate baud rate Debug file exe Ex1 exe Po C 5510 debugdl p C dos edit com P ERE C 5510 source ex1 c iy 4 i Configure EXE file C 5510 adam exe Setup ADAM 5000 VO module utility Programming 5510 Yes E77 Program path C 5510 configdl l J Table 0 2 Reference table for setting up working paths 0 6 ADAM 5510 Chapter 0 Note In addition to Borland Turbo C you have to purchase Borland Turbo Debugger if you need to debug your programs 0 3 2 I O modules configuration 1 Move the cursor to Utility select Configure and press lt Enter gt 2 After displaying some processing messages the screen shown in Figure 0 3 will appear This screen can be used for configuring and calibrating ADAM 5000 I O modules Figure 0 3 Utility Configure menu screen 3 This menu screen consists of a menu bar at the top of the screen and a status field that displays information about the connected modules When you first start the program it automatically scans for any attached modules and displays their data Module charac teristics module configuration parameters and input or output values will be display
8. Syntax void modem command char cmdstr Description Sends an AT command string to the modem For details refer to the AT command document provided by the manufacturer Parameter Description cmdstr Specifies command string refer to AT command string Return value None Example void main void modem_command atz initialize modem Remarks None 6 90 ADAM 5510 Chapter 6 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 to the modem Parameter Description None Return value None Example void main void t receiving data from modem so modem is in trans fer data mode modem command state now you can send an AT command string to modem Remarks None ADAM 5510 6 91 Function Library 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 modem to dial Return value None Example void main void COM port and modem initial OK modem_dial 886222184567 waiting to link Rema
9. int reset slot void port reset int which has been installed void port set speed void port set format void port disable fifo int port enable fifo int port carrier void port clear break void port set break void port clear local loopback void port set local loopback int port get line status int port set line params int port get modem status int port get modem control status int port set modem control params void port lower dtr void port raise dtr void port raise rts void port lower rts 6 8 ADAM 5510 Chapter 6 modem initial 90 modem command 90 void modem command state 90 void modem autoanswer 90 void modem dial 90 void modem handup 90 void port flush rx void port flush tx int port rx error int port rx ready char port rx int port tx emptyO void port tx void port tx string ADAM 5510 6 9 Function Library 6 5 Function Library Description 6 5 1 System Utility Library UTILITY LIB 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 ADAMdelay 1000 delay 1 sec codes placed here by user Remarks None 6 10 ADAM 5510 Chapter
10. 500 00 000 00 500 00 10pv Units ofFSR 100 00 000 00 100 00 0 01 Reading OBh 10 Two s 7FFF 0000 8000 1LSB Complement Engineering 4150 00 000 00 150 00 10 uV Units Reading 100 150 mV of FSR 100 00 000 00 100 00 0 01 Two s 7FFF 0000 8000 1LSB Complement Engineering 20 000 00 000 20 000 1 uV Units 20 mA of FSR 100 00 000 00 100 00 0 01 Teang Two s 7FFF 0000 8000 1 LSB Complement C 4 ADAM 5510 Appendix C C 3 Analog Input Ranges ADAM 5018 Module Range Input Range Data FES Zero F S Displayed Actual Code Description Formats esolution Value Engineering 15 000 00 000 15 000 uv Units 15 mV ofFSR 100 00 f 000 00 10000 0 0196 Reading 1000 Two s 0000 8000 Complement Engineering 50 000 00 000 50 000 Units 50 mV of FSR 100 00 Two s Complement 000 00 100 00 Reading 100 0000 8000 Engineering 100 00 Units 100 mV of FSR 100 00 Two s Complement 000 00 100 000 10 pv 100 00 1 Reading 100 LSB 500 00 0 pV 000 00 0000 000 00 000 00 100 00 01 Reading 10 8000 1 LSB 1 0000 00 pV 100 00 0 01 Reading 10000 8000 LSB 0000 Engineering 500 00 Units 500 mV of FSR 100 00 Two s Complement Engineering 1 0000 Units HV of FSR 100 00 Two s Complement Engineering 2 5000 Units 25V of FSR 100 00 Two s Complement Engineering 20 000 Units 20 mA ofFSR
11. COM2 0x2F8 Return value None Example define COM1 Ox3F8 define COM2 Ox2F8 void main void com lower rts COM1 handshaking with external serial device ADAMdelay 500 com raise rts COM1 generates a signal of 500 ms low trigger Remarks Please refer to the 16C550 UART register document Appendix B ADAM 5510 6 61 Function Library com read scratch register com write scratch register Syntax int com read scratch register unsigned baseaddr void com write scratch register unsigned baseaddr int value Description Reads from COM port scratch register Writes to COM port scratch register Parameter Description baseaddr The UART address COM120x3F8 COM2 0x2F8 value Integer value one byte in length assigned by user from the range 0 to FF Return value Please refer to the 16C550 UART register document Appendix B Example None Remarks This byte is reserved for the user Please refer to the 16C550 UART register document Appendix B 6 62 ADAM 5510 Chapter 6 com set format Syntax void com set format int data length int parity int stop bit Description Sets the parameters for data length parity and stop bits for the COMI port Parameter Description data length Valid range 5 to 8 bits for 1 character parity 0 no parity 1 odd parity 2 even parity stop bit 1 1 stop bit 2 2 stop bits Return value None Example void
12. Channel 0 6for ADAM 5018 0 7 for ADAM 5017 p Value The value returned Note The pValue for ADAM 5017 and ADAM 5018 must be interpreted in reference to the range input that was set during module configuration Return value None Example An example for Init501718 Get501718 and GetRange501718 main int value range i j One ADAM 5018 ADAM 5017 module on slot 3 of the ADAM 5510 printf Init ADAM5018 or ADAM5017 n Init501718 3 printf Get ADAM5018 or ADAM5017 n for j 0 j lt 7 j for i 0 i lt 4 i Get ADAM 5018 data and range from channel 0 to 6 on 6 36 ADAM 5510 Chapter 6 slot 3 of ADAM 5510 Get501718 3 j value See range index in Appendix C if i 3 t GetRange501718 3 j range printf ADAM 5018 or ADAM5017 d d n j value printf with range is Ox x range Remarks None ADAM 5510 6 37 Function Library GetRange5013 Syntax void GetRange5013 int Board int Channel void pRange Description Reads the input range in an ADAM 5013 module Parameter Description Board 0 3 for SlotO Slot3 Channel 0 2 for ADAM 5013 pRange The input range code returned See Appendix C Return Value None Remarks None 6 38 ADAM 5510 Chapter 6 GetRange501718 Syntax void GetRange501718 int Board int Channel void pRange Description Reads the
13. None 6 78 ADAM 5510 Chapter 6 com pgm deinstall Syntax void com pgm deinstall void Description Releases the interrupt registers of the microprocessor for use by the programming port without changing the baud rate or DTR Parameter Description None Return value None Example void main There are some codes before such a function call com pgm deinstall Remarks The programming port is normally used for downloading control programs to the ADAM 5510 using the ADAM 5510 utility The programming port can be used as an additional communication port if the users have such a requirement NOTE The user MUST reset the ADAM 5510 before he uses the port for program downloading again ADAM 5510 6 79 Function Library com pgm flush rx com pgm flush tx Syntax void com pgm flush rx void com pgm flush tx Description CONG Programming port buffer flusher Initializes the transmit and receive queues to their empty states Parameter Description None Return value None Example void main t com pgm flush rx com pgm flush tx Remarks The COM3 programming port transmitter uses polling action not interrupt action Its buffer is always flushed 6 80 ADAM 5510 Chapter 6 com pgm install Syntax int com pgm install void Description Allocates the interrupt registers of the microprocessor for use by the program
14. void Get5080 int slotno int channel long pValue Parameter Description slotno The specific slot inserted with ADAM 5080 0 3 or slotO slot3 channel The specific channel in ADAM 5080 0 3 pValue The Value returned Return Value The Value from the specific channel Example void main unsigned long int aiv 4 int i for i 0 1i lt 4 i get each value from ADAM 5080 in slot 0 Get5080 0 i amp aiv i 6 96 ADAM 5510 Chapter 6 Name Reset Counter Description Reset the current counter value to its initial value Syntax int Clear Counter int slotno int channel Parameter Description slotno The specific slot inserted with ADAM 5080 0 3 or slotO slot3 channel The specific channel in ADAM 5080 0 3 Return Value None Example void main t reset ADAM 5080 channel 0 counter value in slot 0 int Clear Counter 0 0 ADAM 5510 6 97 Function Library Name Start Stop Counter Description Start or stop the specific counter Syntax int Stop Start Counter int slotno int channel StartOrStop Parameter Description slotno The specific slot inserted with ADAM 5080 0 3 or slot0 slot3 channel The specific channel in ADAM 5080 0 3 Start 1 Stop 0 Return Value None Example void main int Start 1 Stop 0 Start counter ids Start_Stop_Counter 0 0 1 if the returned value is 0 print out the start fail message if ids 0 pri
15. 5510 P31 systems are fully isolated and use just a single set of twisted pair wires to send and receive Since the nodes are connected in parallel they can be freely disconnected from the host without affecting the functioning of the remaining nodes An industry stan dard shielded twisted pair is preferable due to the high noise ratio of the environment When nodes communicate through the network no sending conflicts can occur since a simple command response sequence is used There is always one initiator with no address and many slaves with addresses In this case the master is a personal computer that is connected with its serial RS 232 port to an ADAM RS 232 RS 485 converter The slaves are the ADAM 5510 P31 systems When systems are not transmitting data they are in listen mode The host computer initiates a command response sequence with one of the systems Commands normally contain the address of the module the host wants to communicate with The system with the matching address carries out the command and sends its response to the host E 2 ADAM 5510 Appendix E E 1 Basic Network Layout 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
16. 6 EraseSector Syntax unsigned short EraseSector unsigned long ulBase Description Erases a 64 KB sector of data in the 256 KB Flash memory Parameter Description ulBase User determined address range to be erased taken from addresses in the range 0x80000L to OxBOOOOL Return value TRUE Erase successful FALSE Excess address range Example void main void EraseSector 0x80000L Remarks None ADAM 5510 6 11 Function Library Get BoardID Syntax unsigned char 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 5510 from 0 to 3 Return value The return values are ADAM 5017H ADAM 5050 ADAMS050 ID 6 12 ADAM 5510 Chapter 6 Example unsigned char IOModuleName unsigned char SlotNumber void main void Read IO module name in Slot 0 SlotNumber 0 IOModuleName Get BoardID SlotNumber If IOModuleName ADAM5051 ID IO Board is current put your code in Here else printf nThe IO Board is NOT ADAM5051 printf nPlease Check your system setup Remarks None ADAM 5510 6 13 Function Library Get NodelD Syntax unsigned char Get NodelID void Description Gets the DIP switch number of the ADAM 5510 controller Parameter Description None Return value The DIP switch number of the A
17. ADAM 5510 6 75 Function Library com 485 rx empty com 485 tx empty Syntax intcom 485 rx empty void intcom 485 tx empty void Description Returns the status of the COM2 RS 485 transmitting and receiving queues Parameter Description None Return value Com_485_rx_empty returns TRUE if the receiving queue is empty Com 485 tx empty returns TRUE if the transmitting queue is empty Example void main unsigned char data if com_485_rx_empty FALSE data com_485_rx Remarks The COM2 RS 485 transmitter uses polling action not interrupt action Its queue is always empty 6 76 ADAM 5510 Chapter 6 com 485 tx Syntax void com 485 tx charc Description This function sends a single character to the Tx pin of the RS 485 port waits until the last bit is sent to the remote terminal and then sets the RTS pin to OFE Parameter Description c The character you would like to send Return value None Example void main t com 485 tx 0x03 com 485 tx Remarks None ADAM 5510 6 77 Function Library com 485 tx string Syntax void com 485 tx string char s Description com 485 tx string sends a string by calling com 485 tx repeatedly Parameter Description S The string you would like to send Return value None Example void main com 485 tx string This is a string test Remarks
18. Power 3000 Ve Input Output 3000 Ve e Communication 2500 V COM only Power Unregulated 10 to 30 Ve Protected against power reversal Power consumption 2 0 W 3 4 ADAM 5510 Chapter 3 Mechanical Case ABS with captive mounting hardware Plug in screw terminal block Accepts 0 5 mm to 2 5 mm 1 12 or 2 14 to 22 AWG Environment Operating temperature 10 to 70 C 14 to 158 F Storage temperature 25 to 85 C 13 to 185 F Humidity 5 to 95 96 non condensing Atmosphere No corrosive gases NOTE Equipment will operate below 30 humidity Howev er static electricity problems occur much more frequently at lower humidity levels Make sure you take adequate precautions when you touch the equipment Consider using ground straps anti static floor coverings etc if you use the equipment in low humidity environments Dimensions The following diagrams show the dimensions of the system unit and an I O unit All dimensions are in millimeters J o 0000 1 j UI TOT j j HEERE 7 Figure 3 1 ADAM 5510 system amp I O module dimensions ADAM 5510 3 5 ADAM 5510 System 3 4 Basic Function Block Diagram Opto Coupled Isolation Isolation Figure 3 2 Function
19. and ADAM 5510 After steps 1 through 8 are complete the ADAM 5510 is ready for standalone operation provided that a proper application executable has been transferred to it Conclusion By carefully walking through all the installation and operating instructions described above you should have experienced most of the usual procedures for using ADAM 5510 For further sophisticated utilization or programming skills please refer to following chapters ADAM 5510 0 13 Quick Start This page intentionally left blank 0 14 ADAM 5510 1 Introduction Introduction 1 1 1 2 Standalone Data Acquisition and Control System The task of monitoring and controlling a process in a laboratory or an industry can be extremely complex As the number of data collection points and process control actuators in the network increases this task becomes more challenging PC based DA amp C systems provide a high value alternative to older more expensive technology in the control industry but most systems require a desktop PC or equivalent at their core Now Advantech s ADAM 5510 can operate a process control network independent of a desktop PC Features 1 2 1 Control flexibility with C programming The ADAM 5510 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 a way similar to how one uses an x86 PC in the office The ADAM 5510 can be controlled by programs wr
20. character you would like to send Return value None Example void main t com pgm tx 0x03 com pgm tx Remarks None 6 86 ADAM 5510 Chapter 6 com pgm tx string Syntax void com pgm tx string char s Description com pgm tx string sends a string by calling com pgm tx repeat edly Parameter Description S The string you would like to send Return value None Example void main com_pgm_tx_string This is a string test Remarks None ADAM 5510 6 87 Function Library 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 void main void t unsigned int code code CRC16 String strlen String printf n The string s CRC16 code d String Code Remarks None 6 88 ADAM 5510 Chapter 6 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 void modem autoanswer waiting phone call Remarks None ADAM 5510 6 89 Function Library modem command
21. com clear break com set break Syntax void com clear break unsigned baseaddr void com set break unsigned baseaddr Description Sets COM port to clear BREAK signal Sets COM port to send BREAK signal Parameter Description baseaddr The UART address COM1 0x3F8 COM2 0x2F8 Return value None Example None Remarks Please refer to the 16C550 UART register document Appendix B ADAM 5510 6 53 Function Library com clear local loopback com set local loopback Syntax void com clear local loopback unsigned baseaddr void com set local loopback unsigned baseaddr Description Sets COM port to disable loopback function for diagnostic Sets COM port to enable loopback function for diagnostic Parameter Description baseaddr The UART address COM1 20x3F8 COM2 0x2F8 Return value None Example None Remarks Please refer to the 16C550 UART register document Appendix B 6 54 ADAM 5510 Chapter 6 com deinstall Syntax void com deinstall void Description Uninstalls the communications drivers completely without changing the baud rate or DTR Parameter Description None Return value None Example void main void codes placed here by user com deinstall Remarks This function MUST be called before returning to DOS so the interrupt vector will not point to our driver anymore ADAM 5510 6 55 Function Library com disable fif
22. com pgm install com pgm rx com pgm rx empty com pgm set format 6 4 ADAM 5510 Chapter 6 com pgm set speed com pgm tx com pgm tx empty com pgm tx string com set format com get line status com set line params com get modem status com install com lower dtr com raise dtr com lower rts com raise rts com read scratch register com write scratch register com rx com rx empty com tx empty com set parity com set speed com tx com tx ready com tx string CRC160 modem autoanswer modem command state modem command modem dial modem handup modem initial ADAM 5510 6 5 Function Library Category C Low speed I O module access functions LIO LIB AiUpdate Get50130 Get5017180 Get5017HQ GetRange5013 GetRange501718 GetRange5017H Init50130 Init5017180 Init5017HQ Category D High speed I O module access functions HIO LIB Get50500 Get5051 Get5052 Init50240 Set50240 Set50500 Set50560 Set50600 Set5068 6 6 ADAM 5510 Chapter 6 Category E Counter Frequency Module Access Functions LAI LIB Init50800 Get5080 Clear Counter Start Stop Counter ReadOverflowFlag SetInitCounterVal ADAM 5510 6 7 Function Library Category F Serial module access functions A5090 LIB int port install int port deinstalled void port select
23. d GetRTCtime RTC hour printf n min d GetRTCtime RTC min sd GetRTCtime RTC sec printf n sec Remarks None 6 16 ADAM 5510 Chapter 6 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 t int I recover last value for I 0 I lt 4 I SlotValue I Get SysMem I Remarks None ADAM 5510 6 17 Function Library LED init LED OFF LED ON Syntax void LED init void void LED OFF int which led void LED ON int which led Description Turns LED lights on and off The LED I O port must be initialized first It will take a little time for the light to stabilize following the signal for the turning on and turning off of the light Parameter Description which led PWR RUN COMM Return value None Example void main void LED init flash COMM led while 1 LED ON COMM ADAMdelay 500 LED OFF COMM Remarks None 6 18 ADAM 5510 Chapter 6 ProgramByte Syntax unsigned short ProgramByte unsigned long ulAddress unsigned char byte Description Programs a byte of information into the 256 KB Flash memory This feature supports data logging or mass infor
24. eeeee E 3 E 2 Line Termination ccesseceeee HH eem E 6 E 3 RS 485 Data Flow Control eI E 8 Appendix F Grounding Reference F 1 E l Grounding eere e Seas oral ae el ama eed F 3 L1 The Earth for r f rence uv etna F 3 1 2 The Frame Ground and Grounding Bar F 4 1 3 Normal Mode and Common Mode F 5 1 4 Wire impedance sssssssssssse F 7 1 5 Single Point Grounding eee eee F 9 E2 Shielding esee eR DE ERR F 11 2 1 Cable Shield 2 ne Rex F 11 2 2 System Shielding s eese F 13 F 3 Noise Reduction Techniques seesesss F 17 E 4 Check Point List eere ie F 18 Table of Figures Figure 0 1 Installation wiring of the ADAM 5510 and host PC 0 4 Figure 0 2 Menu for setting up compiler working paths 0 5 Figure 0 3 Utility Configure menu screen eese 0 7 Figure 0 4 Downloading to ADAM 5510 s Flash ROM 0 10 Figure 0 5 Opening screen operating ADAM 5510 remotely 0 11 Figure 1 1 ADAM 5510 system configuration ceecee 1 3 Figure 2 1 ADAM 5510 wiring and connections es 2 3 Figure 2 2 ADAM 5510 software utility eeeeee 2 4 Figure 2 3 Communication port selection seeeeees 2 4 Figure 2 4 Emulating screen of ADAM 5510 esses 2 5 Figure 2 5 Module alignment and installation
25. library ProgramByte ProgramSector and EraseSector The size could be adjusted by function library Set NVRAM Size Include GOKB RAM Disk You can disable RAM Disk to get fullly 191KB memory space or re size the RAM Disk via adjust the parameter of VDISK SYS of file CONFIG SYS 5 6 ADAM 5510 Chapter 5 5 2 File Download and Transfer This section explains how to download application programs from a PC into the ADAM 5510 flash ROM and how to transfer files from a PC into ADAM 5510 s SRAM Install utility software on host PC ADAM 5510 systems come packaged with a utility disk containing the files and directories listed in Chapter 0 Quick Start Copy all the files and directories on the utility disk to the specified directory of the host computer s hard drive Creating the ALLFILE directory Application programs are downloaded from a host PC to the flash ROM of ADAM 5510 using the ADAM 5510 utility software The ADAM 5510 utility software is first installed on a host PC and the user must create a new directory also on the host PC named ALLFILE The user must then load into ALLFILE the following required files The application program intended for installation in ADAM 5510 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 55
26. main Sets data format of the COMI port to 8 bit data length no parity 1 stop bit com set format 8 0 1 Remarks None ADAM 5510 6 63 Function Library com set parity Syntax void com set parity enum par code parity int stop bits Description Sets the parity and stop bits Parameter Description int code COM NONE 8 data bits no parity COM EVEN 7 data bits even parity COM ODD 7 data bits odd parity COM ZERO 7 data bits parity bit zero COM ONE 7 data bits parity bit one int stop bits Must be 1 or 2 Return value None Example void main void com set parity COM NONE 1 set N 8 1 Remarks None 6 64 ADAM 5510 Chapter 6 com set speed Syntax void com set speed unsigned long speed Description Sets the baud rate of the COM port Parameter Description speed The baud rate value Return value None Example void main void t com set speed 96001 set baud rate 9600 bps Remarks None ADAM 5510 6 65 Function Library com rx Syntax char com rx void Description Returns the next character from the receive buffer or a NULL character 07 if the buffer is empty Parameter Description None Return value c The returned character Example void main void unsigned char COMdata COMdata com rx Remarks None 6 66 ADAM 5510 Ch
27. mask which has been installed EX 0x2353 0010 0011 0101 0011B The port01 02 1 1 13 21 22 32 have been installed 0x0082 0000 0000 1000 0010B The port02 14 have been installed Example void main int Flag here we install port1 12 23 port_install 1 port install 12 port install 23 set flat as the return value Flag which has been install Flag must be 0000 0100 0010 0001B 6 106 ADAM 5510 Chapter 6 Name Set Port Baud Rate Description Set the baud rate of specified port Syntax void port set speed int portno long speed Parameter Description portno The specified port number long speed 4800L 9600L 19200L 38400L 115200L Return Value None Example 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 port speed 1 38400L select working port2 and set the communication rate to 9600bps port select 2 port speed 2 9600L ADAM 5510 6 107 Function Library Name Set Port Data Format Description Set the parameters for data length parity and stop bits for specified port Syntax void port set format int portno int data length int parity int stop bit Parameter Description portno The specified port number data length 5 8 parity 0x00 no parity 0x01 odd parity 0x02 even parity stop bit 0x01 1 stop bit 0x02 2 stop b
28. program on the diskette will automatically complete the installation When installation is completed the default working directory will be automatically changed to c 5510 Key in adam5510 lt Enter gt This starts the utility program for ADAM 5510 The highlighted cursor will be at its default location at COMport on the menu bar Press Enter a pop up window will appear Use the arrow keys to move the highlighted cursor to select a COM port on the host PC then press Enter to confirm the selection Press lt ESC gt to return to the menu bar me Armiral 0 7 ee Eide RRO es 8 1D e urca azl zri XEHTEER Cont ith SUPT Tr m Select AIE Bett SAC TLS Hr Figure 0 2 Menu for setting up compiler working paths ADAM 5510 0 5 Quick Start 6 Move the cursor to Option and press Enter to activate the pull down menu Move the cursor to Compiler on the pull down menu and press Enter The screen now looks like Figure 0 2 see previous page 7 Use the arrow keys and Enter to set the individual access paths for each item We suggest using the PRJ file to manage your application program 8 The access path for your own application program should be filled in on the Project file PRJ line 9 Other items in the Option pull down menu can be set using procedures similar to steps 5 through 8 Table 0 2 provides a reference for this configuration procedure
29. 0 exe Select COMport Choose that COM port through which you want to connect the host PC to the ADAM 5510 For example COMI the baud rate was previously set Press Esc to return to the menu bar Select Utility Config Wait as instructed by the screen File transfer and rebooting will proceed automatically and a scan will identify all ADAM I O modules Finally a screen similar to that shown in Figure 0 3 should appear Configure the system and I O modules if necessary then select Quit and return to the main utility Select Option Compile then fill in the path for the Turbo C IDE and e 5510 source ex1 prj for the source file path where indicated 10 Return to the menu bar select Utility Compile Turbo C IDE will be invoked to load our example file Ex1 prj Compile this example file into an executable file 0 12 ADAM 5510 Chapter 0 0 5 11 Press Alt T to transfer the file Ex1 exe from the host PC to the ADAM 5510 Specify Source filename c 5510 source ex1 exe and save to ADAM 5510 Disk d SRAM virtual disk or ADAM 5510 Disk e Flash disk Note that if you save the executable file to another directory that directory must be speci fied 12 Now you can run exl exe on ADAM 5510 This example reads the data configuration of the low speed AI modules in the ADAM 5510 then shows the data on the screen 13 The above are typical steps for initializing the host PC
30. 10 is powered on When downloading to the ADAM 5510 s flash ROM the utility software first clears all non permanent files from the flash ROM then installs all the files contained in directory ALL FILE into the flash ROM It is therefore critical that all the required files be available in a directory ALLFILE when the utility software tries to access ALLFILE ADAM 5510 5 7 Programming and Downloading Downloading into Flash memory ADAM 5510 s C drive With the ADAM 5510 utility software and the directory ALLFILE loaded with its proper contents installed on the host PC you can execute the utility software The main screen shown in Figure 5 2 will appear when execution begins re Oe Es ee Al al HILAR s ENTREE malect RIGHD LEFT mcye curmar berupz lriliry V4 al bsjaci Eut E campo Figure 5 2 Main screen After the utility software has begun executing select the COM port of the host PC that has been connected to the ADAM 5510 Then select Program from the bar menu and press lt Enter gt to begin download ing The screen shown in Figure 5 3 will appear 5 8 ADAM 5510 Chapter 5 Figure 5 3 Program downloading Follow the instructions shown on the screen Power off the ADAM 5510 and then re power on Then press any key within 7 seconds to burn the files contained in ALLFILE into the ADAM 5510 s flash ROM After the files are successfully burned into the flash ROM the screen shown in Figure 5
31. 12 Ex12 prj The ADAM 5090 allows a direct link to PC This example provides internal amp external loopback test function and helps user to verify the ADAM 5090 module and the COM port of PC Example 13 Ex13 prj Using ADAM 5090 COM port and ADAM 4520 RS 232 to RS 422 485 converter to scan ADAM 4000 5000 series module as remote func tion User can also send command to the existing module to get response ADAM 5510 D 3 Examples on Utility Diskettes Example 14 Ex14 prj This example tests the modem device with the basic connecting function Users can use this program to connect to other device through a modem and allows other modem to connect to it It can also call a pager and leave a number message with it D 4 ADAM 5510 E RS 485 Network RS 485 Network 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 e Maximum line length per segment 1200 meters 4000 feet e Throughput of 10 Mbaud and beyond Differential transmission balanced lines with high resistance against noise e Maximum 32 nodes per segment e Bi directional master slave communication over a single set of twisted pair cables e Parallel connected nodes true multi drop ADAM
32. 15 If Size AByte Bit 0is Low Byte data Bit 8 is High Byte data If Size AWord Bit does not care always word data Return Value None Example void main void unsigned char Bitdata 1 Set5056 amp Bitdata 0 13 ABit Output 1 to slot 0 pin 13 Remarks None 6 50 ADAM 5510 Chapter 6 6 5 4 Communication Library COMM LIB 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 len The length of the data array in the buffer seed A seed value added into the checksum for the purpose of calculation or security Return value The checksum of the data array buffer Example unsigned char String this is a test CheckSum void main void t unsigned int code code checksum String strlen String 0 Remarks None ADAM 5510 6 51 Function Library com carrier Syntax intcom carrier void Description Detects the carrier signal of COM port Parameter Description None Return value TRUE If a carrier is present FALSE No carrier Example void main void if com carrier TRUE Telephone carrier signal present at COM port put your associate program here Remarks None 6 52 ADAM 5510 Chapter 6
33. 2 Star structure E 4 ADAM 5510 Appendix E Random This is a combination of daisychain and hierarchical structure Coverter Repeater d RS232 RS485 RS 485 2 E MANI We NI AZA Lez RS 232 repeater KO bm bit bin 1 2 1 a ae E m AM 5510 P31 bi m Figure E 3 Random structure ADAM 5510 E 5 RS 485 Network E 2 Line Termination 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 Rt 120 Q Rt 470 oie a MT Rt 470 Q Figure E 4 Signal distortion The value of the resistor should be a close as possible to the charac teristic impedance of the line Although receiver devices add some resistance to the whole of the transmission line normally it is sufficient to the resistor impedance should equal the characteristic impedance of the line Example Each input of the receivers has a nominal input impedance of 18 kQ feeding into a diode transistor resistor biasing network that is equivalent to an 18 KQ input resistor tied to a common mode voltage of 2 4 V Itis this configuration which provides the la
34. 3 Function Library com pgm set format Syntax void com pgm set format int data length int parity int stop bit Description Sets the parameters data length parity and stop bits of the program ming port Parameter Description data length Valid ranges 7 or 8 bits for one character parity 0 no parity 1 odd parity 2 even parity stop bit 1 1 stop bit 2 2 stop bits Return value None Example void main Sets the data format of the programming port to 8 bit data length no parity 1 stop bit com pgm set format 8 0 1 Remarks None 6 84 ADAM 5510 Chapter 6 com pgm set speed Syntax void com pgm set speed unsigned long speed Description Sets the baud rate of the programming port COM Parameter Description speed The baud rate value Return value None Example void main t com pgm set speed 96001 Sets the baud rate of the programming port to 9600 bps Remarks We suggest that users set the baud rate of the programming port below 57600 bps included because the programming port UART chip is not a standard UART chip ADAM 5510 6 85 Function Library com pgm tx Syntax void com pgm tx char c Description This function sends a single character to the Tx pin of the program ming port waits until the last bit is sent to the remote terminal and then sets the RTS pin to OFF Parameter Description c The
35. 4 will appear Power off and power on the ADAM 5510 once again The ADAM 5510 system will automatically execute the applications Bown load complete r e ALL own load ADAR_DER dox File Figure 5 4 Program downloaded successfully ADAM 5510 5 9 Programming and Downloading Transferring files to SRAM ADAM 5510 s D drive The ADAM 5510 provides 192 KB free SRAM for use in program operation and for control logic and performance simulation before downloading the execution codes to the flash ROM You can transfer files from a host PC to the ADAM 5510 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 5 5 will appear MS DOS Promet Figure 5 5 File transfer 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 5 10 ADAM 5510 Chapter 5 5 3 Setup Procedure of Remote Turbo Debugger To help users debug applications written in Borland Turbo C Advan tech has included the executable program UPDATE EXE on the ADAM 5510 utility disk This executable allows users to customize the Turbo C remote debugger for ADAM 5510 s use Follow the steps below to customize the remote debugging environment 1 Before you start the setup procedure please connect a DB 9 cable between the host PC COM1 and the ADAM 5510 COMI as shown in the diagr
36. 424 V Power Supply More cable but more stable system Figure F 8 Single point grounding 2 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 The thin cable will consume the energy F 10 ADAM 5510 Appendix F F2 Shielding 2 1 Cable Shield Single Isolated Cable Use Aluminum foil to cover those wires for isolating the external noise Figure F 9 Single isolated cable 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 ADAM 5510 F 11 Grounding Reference Double Isolated Cable Second Layer First Layer Reduce wire impedance and Use Aluminum foil to enhance cable intensity by cover those wires for those parallel nude conductors isolating the external noise Figure F 10 Double isolated cable 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 a
37. 5 Figure F 6 Figure F 7 Figure F 8 Figure F 9 Figure F 10 Figure F 11 Figure F 12 Figure F 13 Figure F 14 Figure F 15 D isSych lnl g d eere a EE CURSUS E 3 Sir diuini P M E E 4 Random Struc ture xeu i o e eene A E 5 Signal distoftlOh oen tee E 6 Termination resistor locations esses E 7 RS 485 data flow control with RTS E 8 Think the EARTH as GROUND e F 3 Groundin es Bar ioter P REEL F 4 Normal mode and Common mode F 5 Normal mode and Common mode F 6 The purpose of high voltage transmission F 7 wir Impedance 2 15 52 5 mente DR RERERRRCETRDDURE D HbS F 8 Single point grounding 1 sees F 9 Single point grounding 2 eee F 10 Single isolated cable sse F 11 Double isolated cable ssssssssess F 12 System Shielding Di ener F 13 The characteristic of the cable ssssss F 14 System Shielding 1 misioari eni ai n F 15 System Shielding 2 eee F 16 Noise Reduction Techniques ssssss F 17 Table 0 1 Table 0 2 Table 0 3 Table 2 1 Table 2 2 Table 4 1 Table 5 1 Table 5 2 Table 5 3 Table 6 1 Tables ADAM 5000 I O modules aeree 0 3 Reference table for setting up working paths 0 6 Module configuration utility menu
38. 5510 Chapter 2 2 6 Wiring and Connections This section provides basic information on wiring the power supply I O units communication port connection and programming port connection Power supply wiring Although the ADAM 5510 systems are designed for a standard industrial unregulated 24 V o power supply they accept any power unit that supplies within the range of 10 to 30 V e The power supply ripple must be limited to 200 mV peak to peak and the immediate ripple voltage should be maintained between 10 and 30 Vic Screw terminals Vs and GND are for power supply wiring Note The wires used should be at least 2 mm POWER SUPPLY vs 410 430 Vig amp ing G3 INIT K COM OS DATA x DATA Figure 2 12 ADAM 5510 power wiring I O modules wiring The system uses a plug in screw terminal block for the interface between an I O module 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 Always use a continuous length of wire Do not combine wires to make them longer ADAM 5510 2 11 Installation Guidelines Use the shortest possible wire length Use wire trays for routing where possible Avoid running wires near high energy wiring nn A W Avoid running input wiring in close proximity to output wiring where possible
39. Copyright Notice This document is copyrighted 2000 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 Acknowledgment ADAM is a trademark of Advantech Co Ltd IBM and PC are trademarks of International Business Machines Corporation CE Nonification The ADAM 5510 series developed by Advantech Co Ltd has passed the CE test for environmental specifications Test conditions for passing included the equipment being operated within an industrial enclosure using shielded twisted pair RS 485 cables and having SFC 6 sleeve core clamps added to the power cable see Figure 0 1 in Chapter 0 In order to protect the ADAM 5510 system from being damaged by ESD Electrostatic Discharge and EMI leakage we strongly recommend the use of CE compliant industrial enclosure products shielded twisted pair RS 485 cables and core clamps 6th Edition March 2005 A Message to the Customer Advantech Customer Services Each and ever
40. DAM 5510 controller Example unsigned char SystemNodeNumber void main void t SystemNodeNumber Get NodeID If SystemNodeNumber 0x15 put your code in Here else printf nNode number Error Remarks None 6 14 ADAM 5510 Chapter 6 Get NVRAM Size Syntax unsigned char Get NVRAM 5Size 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 1to15 Example void main t unsigned char sector sector Get NVRAM Size Remarks None ADAM 5510 6 15 Function Library 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 RIC 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 The value requested by the user Example void main void printf n Century amp d GetRTCtime RTC century printf Mn Year d GetRTCtime RTC year printf Mn month d GetRTCtime RTC month printf n weekday d GetRTCtime RTC week printf n day d GetRTCtime RTC day printf Mn hour f
41. DAM 5510 turbo debugger 10 Now every time you want to use the Turbo Debugger to debug the program in ADAM 5510 you can select from the menu as shown in Figure 5 11 Figure 5 11 Linking ADAM 5510 for remote debugging 5 14 ADAM 5510 Function Library Function Library 6 1 6 2 6 3 Introduction User designed ADAM 5510 application programs make use of ADAM 5510 library functions To make the most efficient use of ADAM 5510 s memory space the ADAM 5510 function library has been separated into six 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 The smaller the linked libraries the smaller the compiled executable will be Note 1 These function libraries support Borland Turbo C 3 0 for DOS only Note 2 Please include all necessary ADAM 5510 function libraries in your project file Library Classification ADAM 5510 has four function libraries categorized according to usage Category A System Functions UTILITY LIB Category B Communication Functions COMM LIB Category C Low Speed I O Module Access Functions LIO LIB Category D High Speed I O Module Access Functions HIO LIB Category E Counter Frequency Module Access Functions LAT LIB Category F Serial Module Access Functions A5090 LIB Libraries Sized for Different Memory Modes The ADAM 5510 function libr
42. E R S and B 0 1 C one decimal place thermocouple C 2 ADAM 5510 Appendix C Example 1 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 Example 2 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 The re sponse to the Analog Data In command is 305 50 cr Example 3 The input value is 5 653 V The analog input module is configured for a range of 5 V range When the engineering units format is used the ADAM Series analog input modules are configured so that they automatically provide an over range capability The response to the Analog Data In command in this case is 5 6530 cr ADAM 5510 C 3 Data Formats and I O Ranges C 2 Analog Input Ranges ADAM 5017 ila D POR Exp Code Description Formats Resolution Value Engineering 10 000 00 000 10 000 1 mv Units of FSR 100 00 000 00 100 00 0 01 Reading 10 V 1000 Two s 7FFF 0000 8000 1 LSB Complement Engineering 5 0000 0 0000 5 0000 100 00 pV Units of FSR 100 00 000 00 100 00 0 01 Reading 1000 Two s 7FFF 0000 8000 1 LSB Complement Engineering 1 0000 0 0000 1 0000 100 00 pV Units of FSR 100 00 000 00 100 00 0 01 Reading 10000 Two s 7FFF 0000 8000 1 LSB ADAM Complement 5017 Engineering
43. FIFO empty 2 FIFO and Transmitting empty 6 130 ADAM 5510 Chapter 6 Name Send Character Description Send a character to the THR of the specified port Syntax void port tx int portno char c Parameter Description portno The specified port number c The character you would like to send Return Value None main char character port_installed 1 check whether FIFO empty or not if empty send a character if port_tx_empty 1 character a port tx 1 character ADAM 5510 6 131 Function Library Name Send String Description Sends a string by calling port tx repeatedly Syntax void port tx string int portno char s Parameter Description portno The specified port number s the string you would like to send Return Value None main char string port_installed 1 check whether FIFO empty or not if empty send a string if port_tx_empty 1 string abcde port tx string 1 string 6 132 ADAM 5510 A Quick Start Example Quick Start Example A 1 This chapter provides guidelines to what is needed to set up and install a standalone ADAM 5510 control system ADAM 5510 System Requirements Before you setup an ADAM 5510 system you can follow the steps to install I O modules into the ADAM 5510 base 1 Align the module with the grooves on the top and bottom of the base 2 Push the unit straight into the base unt
44. Function Library 6 1 6E IntrodUCctiOTr sem dt oth eoe ee A ev edes 6 2 6 2 Library Classification esee A 6 2 6 3 Libraries Sized for Different Memory Modes 6 2 6 4 Index creer Rate 6 3 6 5 Function Library Description sseeeeeee 6 10 6 5 1 System Utility Library UTILITY LIB 6 10 6 5 2 Low Speed I O Library LIO LIB 6 33 6 5 3 High Speed I O Library HIO LIB 6 42 6 5 4 Communication Library COMM LIB 6 51 6 5 5 Counter Frequency Library LIA LIB 6 95 6 5 6 Serial I O Library A5090 LIB 6 101 Appendix A Quick Start Example A I A l ADAM 5510 System Requirements A 2 A 2 Basic Steps to Install ADAM 5510 System A 3 Appendix B COM Port Register Structure B 1 Appendix C Data Formats and I O Ranges C 1 C 1 Analog Input Formats eee C 2 C 2 Analog Input Ranges ADAM 5017 C 4 C 3 Analog Input Ranges ADAM 5018 C 5 C 4 Analog Input Ranges ADAM 5017H C 7 C 5 Analog Output Formats eese C 8 C 6 Analog Output Ranges sese C 8 C 7 ADAM 5013 RTD Input Format and Ranges C 9 Appendix D Examples on Utility Diskettes D 0 Appendix E RS 485 Network Hed E l Basic Network Layout
45. Name Set DTR Low Set DTR High Description Set specified port DTR low Set specified port DTR high Syntax void port_lower_dtr int portno void port_raise_dtr int portno Parameter Description portno The specified port number Return Value None Example void main port_install 1 set port DTR low port_lower_dtr 1 set port DTR high port_raise_dtr 1 6 118 ADAM 5510 Chapter 6 Name Set RTS High Set RTS Low Description Set specified port RTS high Set specified port RTS low Syntax void port raise rts int portno void port lower rts int portno Parameter Description portno The specified port number Return Value None Example void main port_install 1 set port RTS low port lower rts 1 set port RTS high port_raise_rts 1 ADAM 5510 6 119 Function Library Name Modem Initial Description Set modem to initial status Syntax modem initial 90 int portno parameter Description portno The specified port number Return Value None 6 120 ADAM 5510 Chapter 6 Name Send Modem AT Command Description Send AT command string to the modem Syntax modem command 90 int portno char cmdstr parameter Description portno The specified port number cmdstr AT command string Return Value None ADAM 5510 6 121 Function Library Name Set Modem Command Mode Description Set modem to comman
46. Receive Error Check Description Check whether receive error or not Syntax int port rx error int portno Parameter Description portno The specified port number Return Value 0 no error 0x00XX receive error and return LSR value Example void main int Err_ Value port_install 1 get error check value if error print out the message Err_Value port_rx_error 1 If Err Value printf n Rx Error The LSR value X Err_Value ADAM 5510 6 127 Function Library Name Ready Check Description Check received data in port FIFO already Syntax int port rx ready int portno Parameter Description portno The specified port number Return Value 0 data not ready data ready 6 128 ADAM 5510 Chapter 6 Name Receive Character Description Receive a character from specific port Syntax char port rx int portno Parameter Description portno The specified port number Return Value Character Example void main char C port_install 1 hf port FIFO receive data read a character and print it out If port_rx_ready 1 C port_rx 1 printf n C C ADAM 5510 6 129 Function Library Name Empty Check Description Return the status of the specified port transmit queues Syntax int port tx empty int portno Parameter Description portno The specified port number Return Value 0 not empty 1
47. Relay output Isolated Relay Output ADAM 5068 8 ch Relay output Isolated ADAM 5069 8 ch Relay output Isolated Counter Frequency ADAM 5080 4 ch Counter Frequency Isolated Serial I O ADAM 5090 4 port RS232 Non isolated ADAM 5000 Table 4 1 I O Module Support List 9 Programming and Downloading Programming and Downloading 5 1 This chapter explains how to program applications and download programs into the ADAM 5510 system Additionally it points out limitations and issues about which you should be aware Programming The operating system of ADAM 5510 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 5510 In order to build successful applications you should keep the following limitations and concerns in mind 5 2 ADAM 5510 Chapter 5 Mini BIOS functions The ADAM 5510 provides only two serial communication ports for connecting peripherals so the mini BIOS of ADAM 5510 only provides 10 function calls Since the user s program cannot use other BIOS function calls the ADAM 5510 may not work as intended Additionally certain language compilers such as QBASIC directly call BIOS functions that are not executable in ADAM 5510 The ADAM 5510 mini BIOS function calls are listed in the following table Subfunc
48. SR CTS Register UART Register Description Table ADAM 5510 6 115 Function Library Name Read Modem Control Register MCR Set Modem Control Register MCR Description Read from specified port modem control register Set from specified port modem control register Syntax int port get modem control status int portno int port set modem control params int portno int MCRparams Parameter Description portno The specified port number MCRparams Modem control register parameter see UART Register Description Table Return Value Read MCR OxOOXX modem status OxFFOO badcommand or parameter Write MCR 0x0000 write MCR success Ox0001 read back error OxFFOO badcommand or parameter 6 116 ADAM 5510 Chapter 6 Example void main int MCR_ Value MCR_ Params port_install 1 port_enable_fifo 1 set MCR value 3 RTSz1 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 Bi6 BitS Bit4 Bit3 Bit2 Bitl BitO Name Ed Status Data Tx Rx Break Framing Parity Overrun RxRDY F s Error Empty ant Error Error Error Line Control divisor Tx Force odd even Parity oe data length bits 1 0 Register latch Break parity parity enable access us bit UART Register Description Table ADAM 5510 6 117 Function Library
49. Utility select Debug and press Enter Note that if you have only one COM port on your host PC you must replace the cable connecting the host PC and ADAM 5510 before debugging Replace the straight through cable with cross over cable 4 To modify defective source code move the cursor to Utility select Editor and press Enter The text editor specified in the Option Editor working path will be invoked Note Crossover DB 9 cable must be used with the Turbo Debugger 0 3 4 Run program and download 1 Move cursor to Program and press Enter 2 The program downloading process will start and will take about two minutes A counter will be displayed on the screen indicating the percentage completed When the downloading process finishes the screen shown in Figure 0 4 will be displayed ADAM 5510 0 9 Quick Start Figure 0 4 Downloading to ADAM 5510 s Flash ROM 3 Press the RESET button on the ADAM 5510 front panel 4 Press any key within 7 seconds after pressing RESET Wait for ADAM 5510 to boot from ROM DOS 5 After ADAM 5510 resets and reboots the welcome screen shown in Figure 0 5 will appear Now you are operating the ADAM 5510 remotely through your host PC and may access the ROM disk 0 10 ADAM 5510 Chapter 0 Figure 0 5 Opening screen operating ADAM 5510 remotely 6 The ROM DOS system can now be operated in MS DOS PC DOS prompt mode That is you can in
50. V ye Screw terminals Vs and GND are for power supply wiring Connect the download cable between the host computer and the ADAM 5510 Standard DB 9 pin cables straight through type can be used to connect the ADAM 5510 programming port and host PC RS 232 port The following figure shows how to connect the cables ADAM 5510 COM RS 232 C nw oh DAM o Oo o o k ADAM 5510 EA ipqaoaapngaggaggagag ubpgaagaaagaggaagaad uagaopagpagapnaganpna POWER SUPPLY 10 30 J i P COM2 RS 485 PROGRAMMING PORT RS 232 HOST COMPUTER Figure 2 1 ADAM 5510 wiring and connections Step 3 Run utility software in host computer You will find a utility disk containing an ADAM5510 EXE file in the same box as your ADAM 5510 unit This file is a menu driven software utility provided for downloading user s programs When the file is executed the main screen appears as shown in Figure 2 2 ADAM 5510 2 3 Installation Guidelines Figure 2 2 ADAM 5510 software utility Select COM port First highlight the COMport option on the top bar and press lt Enter gt The status field shown below will appear Second highlight the COM port of PC you used to connect the ADAM 5510 then press Enter The baud rate is set to a default value of 57600 bps and cannot be change
51. a pValue The value returned Return value None Example void main void unsigned char Bdata unsigned int Wdata Get5051 0 13 ABit amp Bdata S1ot0 pinl3 data 0 or 1 Get5051 2 0 AByte amp Bdata Slot2 pinO0 pin7 Bdata Low Byte data Get5051 3 0 AWord amp Wdata Slot3 pinO0 pin15 Wdata Word data 6 44 ADAM 5510 Chapter 6 Remarks None ADAM 5510 6 45 Function Library GetRange5017H Syntax void GetRange5017H int Board int Channel void pRange Description Reads the input range in an ADAM 5017H module Parameter Description Board 0 3 for SlotO Slot3 Chanel 0 7for ADAM 5017H pRange The input range code returned See Appendix C Return Value None Remarks None 6 46 ADAM 5510 Chapter 6 Init5017H Syntax void Init5017 int Slot Description Initializes ADAM 5017H Note that ADAM 5017H must be initialized before other commands are issued to it Parameter Description Slot From 0 to 3 Return Value None Example void main void t int I initializes 4 slots containing ADAM 5017H modules for I 0 I 4 I Init5017H I Remarks None ADAM 5510 6 47 Function Library Init5024 Syntax void Init5024 int Slot int chO val int ch1 val int ch2 val int ch3 val Description Initializes ADAM 5024 module in the slot indicated loading user specified analog outp
52. am below Z T O QD Host 5510 COM1 COM1 Q a o a o n a S t a o a o pin pin o mi a o o ARER n Es s 2 R xis5 Tm D B 5 E zr 3 TX RX 2 7 a Oo a a S35 GND GND 5 ET M B B B 5 d r HOST COMPUTER DB 9 DB 9 n 2 a o a a N 6 n o a a C Figure 5 6 Wiring for turbo debugging NOTE A special DB 9 cable is required for this connection The wires are transposed between pins 2 and 3 on one end and pins 2 and 3 on the other end Pin 2 of the connector on one end should correspond to pin 3 of the connector on the other end 2 Copy the UPDATE EXE from the ADAM 5510 utility disk to the directory containing the Turbo Debugger executable file in the host PC NOTE 1 ADAM 5510 supports Turbo C version 3 0 NOTE 2 Users must purchase and properly install the Turbo Debugger in advance ADAM 5510 5 11 Programming and Downloading 3 Execute the UPDATE EXE program in the Turbo Debugger directory and follow the instructions on the screen Input the file name TDREMOTE EXE The file TDADAM EXE will be created in the directory with the Turbo Debugger after you complete this step Figure 5 7 Creating TDADAM EXE Copy TDADAM EXE to the DEBUGDL directory for loading into the ADAM 5510 Add the following statements to
53. and communicate with the host PC The basic layouts that can be used for an RS 485 network are Daisychain The last module of a segment is a repeater It is directly connected to the main wires thereby ending the first segment and starting the next segment Up to 32 addressable systems can be daisychained This limitation is a physical one When using more systems per segment the IC driver current rapidly decreases causing communication errors In total the network can hold up to 64 addressable systems The limita tion on this number is the two character hexadecimal address code that can address 64 combinations The ADAM converter ADAM repeaters and the host computer are non addressable units and therefore are not included in these numbers n Y i Segment 1 j Segment 2 f T RS2 es RS 485 RS 232 Figure E 1 Daisychaining ADAM 5510 E 3 RS 485 Network Star Layout 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 Coverter RS232 RS485 EE O RS 485 RS 232 h D I Wiii a 3 I Figure E
54. ange Input Range Data Full Zero Ful Scale Code Formats Scale ag Note eo ai e o N m d e o 5 2 m o S H 2 o m 3 D o e e 3 lt lt e e o e o e e e o n Displayed Resolution uS 10V Eee Engineering 5 5 Engineering 5 5 ojm E E E ont care 2 7 mV ont care 5 5 o TJ TI 7 FFF Don t care 1 3 mV Don t care 2 75 Don t care 0 67 mV 1V sf 500 mV Eu ere 20 mA Engineering 2 Dont care 5 3 uA Two s Comp OF FF 265 porca 1 20mA pues EE 5 3 uA OFFF o Don t care The full scale values in this table are theoretical values for your reference actual values will vary Don t care 1 375 FFF ont care 0 34 mV DBHI mn E E Dont care 687 5 Don t care 0 16 mV Dont care N A o o o c N 3 e a z 3 3 3 3 3 lt lt lt e ADAM 5510 Data Formats and I O Ranges C 5 Analog Output Formats You can configure ADAM analog output modules to receive data from the host in Engineering Units 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 digits The resolutio
55. apter 6 com tx Syntax void com tx char c Description com tx sends a single character by waiting until the transmit buffer isn t full then putting the character into it The interrupt driver will then send the character once it is at the head of the transmit queue and a transmit interrupt occurs Parameter Description c The value you would like to send Return value None Example void main void com_tx 0x02 com_tx 0x03 Remarks None ADAM 5510 6 67 Function Library com rx empty com tx empty Syntax intcom rx empty void int com tx empty void Description Small routines to return status of the transmit and receive queues Parameter Description None Return value Com rx empty void returns TRUE if the receive queue is empty Com tx empty void returns TRUE if the transmit queue is empty Example void main void unsigned char data if com rx empty FALSE data com rx Remarks None 6 68 ADAM 5510 Chapter 6 com tx string Syntax void com tx string char s Description com tx string sends a string by repeatedly calling com tx Parameter Description S The string you would like to send Return value None Example unsigned char name ADAM5510 void main void t com tx string name Remarks None ADAM 5510 6 69 Function Library com 485 deinstall Syntax void com 485 dein
56. aries support four memory modes SMALL MEDIUM COMPACT and LARGE You can use library files sized according to your memory mode For example if you use small mode you can link UTILITYS LIB and LIOS LIB to implement system and low speed I O module access functions On the other hand if you use large mode you can link UTILITYL LIB and LIOL LIB 6 2 ADAM 5510 Chapter 6 6 4 Index Category A System functions UTILITY LIB ADAMdelay EraseSector Get BoardID Get NodelD Get NVRAM Size GetRTCtimeQ Get_SysMem LED init LED OFFQ LED ONOQ ProgramByte ProgramSector read backup ram read mem Release All Set NVRAM Size SetRTCtime Set_SysMem Timer Init Timer Reset Timer Set tmArriveCnt Note tmArriveCntis an array of integers WDT clear WDT disable WDT_enable write_backup_ram ADAM 5510 6 3 Function Library Category B Communication functions COMM LIB checksum com 485 deinstall com 485 flush rx com 485 flush tx com 485 install com 485 rx com 485 rx empty com 485 set format com 485 set speed com 485 tx com 485 tx empty com 485 tx string com carrier com clear break com set break com clear local loopback com set local loopback com deinstall com disable fifo com enable fifo com flush rx com flush tx com pgm deinstall com pgm flush rx com pgm flush tx
57. block diagram 3 6 ADAM 5510 4 I O modules This manual introduces the detail specifications functions and application wiring of each ADAM 5000 I O modules To organize an ADAM 5000 series and ADAM 5510 Series Controller you need to select I O modules to interface the main unit with field devices or processes that you have previously determined Advantech provides 20 types of ADAM 5000 I O modules for various applications so far Following table is the I O modules support list we provided for user s choice More detailed specification and user s guides please refer the user s manual of ADAM 5000 IO Module It had integrated and collected this information Module Name Specification Reference ADAM 5013 3 ch RTD input Isolated ADAM 5017 8 ch AI Isolated Analog I O ADAM 5017H 8 ch High speed AI Isolated ADAM 5018 7 ch Thermocouple input Isolated ADAM 5024 4 ch AO Isolated Digital O ADAM 5050 7 ch D 1 0 Non isolated ADAM 5051 16 ch DI Non isolated ADAM 5051D 16 ch DI w LED Non isolated ADAM 50518 16 ch Isolated DI wLED Isolated ADAM 5052 8 ch DI Isolated ADAM 5055S 16 ch Isolated DI O w LED Isolated ADAM 5056 16 ch DO Non isolated ADAM 5056D 16 ch DO w LED Non isolated ADAM 5056S 16 ch Isolated DO w LED Isolated ADAM 5056SO 16 ch Iso DO w LED source Isolated ADAM 5060 6 ch
58. cks whether the data of the low speed AI module in slot 0 is ready if AiUpdate 0 amp channel 0 access data Remarks None ADAM 5510 6 33 Function Library Get5013 Syntax void Get5013 int Board int Channel void p Value Description Reads the data value in an ADAM 5013 module Parameter Description Board 0 3 for SlotO Slot3 Channel 0 2 for ADAM 5013 pValue The value returned Note The pValue for ADAM 5013 must be interpreted in reference to the input range that was set during module configuration Return Value None Example An example for Init5013 Get5013 and GetRange5013 main int value range i j One ADAM 5013 module on slot 0 of the ADAM 5510 printf Initialize ADAM 5013 n Init5013 0 printf Get ADAM 5013 Value n for j 0 j lt 3 j for i 0 1i lt 4 i Get ADAM 5013 data and range from channel 6 34 ADAM 5510 Chapter 6 0 to 2 on slot 0 of ADAM 5510 Get5013 0 j value if i223 GetRange5013 0 j range See range index in Appendix C printf ADAM 5013 d d n j value printf with range is 0x x range Remarks None ADAM 5510 6 35 Function Library 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 SlotO Slot3
59. computer and the ADAM 5510 A standard DB 9 pin cable straight through type can be used to connect the ADAM 5510 programming port and the host PC s RS 232 port ADAM 5510 COM1 RS 232 EA npnuupuunundaugungud eupgaagaagaaaunmdu unmngapgdgpnpaagagpau POWER SUPPLY fA 10 30 Vag Q DB 9 20 COM2 RS 485 SEED ANALOG INPUT oo ANALOG OUTPUT PROGRAMMING DIGITAL INPUT PORT RS 232 DIGITAL OUTPUT HOST COMPUTER Figure 0 1 Installation wiring of the ADAM 5510 and host PC 5 The default software package supported by ADAM 5510 is Borland Turbo C 3 0 for DOS We suggest installing C pro gramming tools on the host PC to aid in modifying your ADAM 5510 application programs Note If you have only one COM port make sure you use an RS 232 DB 9 straight through cable to connect the host PC and the ADAM 5510 during downloading programming Reconnect the host PC and ADAM 5510 using an RS 232 DB 9 crossover cable to proceed with communication debugging Otherwise a failure in installation or communication will result 0 4 ADAM 5510 Chapter 0 0 3 Utility application program ADAM5510 EXE 0 3 1 Configuration 1 Insert ADAM 5510 utility diskette No 1 into the floppy disk drive e g A in the host PC Change the host computer default drive from C to A Key in install Enter The install
60. d The screen is as shown in Figure 2 3 Figure 2 3 Communication port selection 2 4 ADAM 5510 Chapter 2 Step 4 Power on the ADAM 5510 unit Highlight the Terminal option then press Enter Power on the ADAM 5510 After about 5 seconds the screen shown in Figure 2 4 will appear showing that the system has successfully started ercainal dae Drive Da i 3 05 05 73 04 19 940 04 1 44 256 bytes 0 bytes tree Command Response cammunicetian vith modules Figure 2 4 Emulating screen of ADAM 5510 ADAM 5510 2 5 Installation Guidelines 2 2 Module Installation When inserting modules into the system align the PC board of the module with the grooves on the top and bottom of the system Push the module straight into the system until it is firmly seated in the backplane connector Once the module is inserted into the system push in the retaining clips located at the top and bottom of the module to firmly secure the module to the system Figure 2 5 Module alignment and installation 2 6 ADAM 5510 Chapter 2 2 3 2 4 I O Slots and I O Channel Numbering The ADAM 5510 system provides 4 slots for use with I O modules The I O slots are numbered 0 through 3 and the channel numbering of any I O module in any slot starts from 0 For example the ADAM 5017 is an 8 channel analog input module Its input channel numbering is 0 thru 7 Mounting The ADAM 5510 system can be i
61. d 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 itis 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 still need a function call to disable the watchdog timer Interrupt types Three types of interrupts may occur in the ADAM 5510 The follow ing table shows the types of interrupts Interrupt Name Interrupt Type Non maskable interrupt NMI 02h COMI interrupt OCh COM2 interrupt OEh Table 5 2 ADAM 5510 interrupt types ADAM 5510 5 5 Programming and Downloading Memory mapping The following table shows the memory mapping of the ADAM 5510 system Memory Type Function Description Map Address Monitor Program OxF8000 OxFFFFF 32KB Flash ROM iin BIOS OB C00 ETERS 256KB ROM DOS OXEBOOO0 OxF6BFF 47KB User s Application 0xC0000 OxEAFFF 172KB Flash Memory User accesse and 0x80000 OXBFFFF 256KB 256KB Storage memory Monitor Program 0x3F000 Ox3FFFF Battery Backup 0x30000 Ox3EFFF 60KB SRAM 256KB pue S Ox2FFFF 191KB System Area 0x00000 0x003FF Table 5 3 ADAM 5510 memory mapping Accessed by function
62. d mode Syntax void modem command state O90 int portno parameter Description portno The specified port number Return Value None 6 122 ADAM 5510 Chapter 6 Name Set Modem Autoanswer Description Set up modem to auto answer phone calls Syntax void modem autoanswer 90 int portno parameter Description portno The specified port number Return Value None ADAM 5510 6 123 Function Library Name Modem Dial Out Description Direct modem to dial the specified telephone number Syntax void modem dial 90 int portno char telnumber parameter Description portno The specified port number telnumber The telephone number you would like to dial out Return Value None Example void main port_install 1 hnitial modem for port modem_initial_90 1 set the dial out number as 1234 5678 modem_dial_90 1 12345678 6 124 ADAM 5510 Chapter 6 Name Han up Modem Description Set modem to hand up the telephone Syntax void modem handup 90 int portno parameter Description portno The specified port number Return Value None ADAM 5510 6 125 Function Library Name Rx Flush Tx Flush Description Flush Rx or Tx FIFO Syntax void port flush rx int portno void port flush tx int portno parameter Description portno The specified port number Return Value None 6 126 ADAM 5510 Chapter 6 Name
63. d port to clear BREAK signal Set specified port to send BREAK signal Syntax void port clear break int portno void port set break int portno Parameter Description portno The specified port number Return Value None Example void main port_install 1 port_enable_fifo 1 set port to clear break signal port_clear_break 1 or port set break 1 ADAM 5510 6 111 Function Library Name Clear Local Loopback Set Local Loopback Description Set specified port to disable loopback function for diagnostic Set specified port to enable loopback function for diagnostic Syntax void port clear local loopback int portno void port set local loopback int portno Parameter Description portno The specified port number Return Value None Example void main port_install 1 port_enable_fifo 1 set port to enable loopback function for diagnostic port_set_local_loopback 1 or port_clear_local_loopback 1 6 112 ADAM 5510 Chapter 6 Name Read LSR SetLCR Description Read from specified port line status register LSR Write to specific port line control register LCR Syntax int port get line status int portno int port set line params int portno int lineparams Parameter Description portno The specified port number lineparams Line control register parameter see UART Register Description Table Return Value port get line s
64. dication in the FIFO BASE 6 Modem Status Register MSR bit 0 Delta CTS bit 1 Delta DSR bit 2 Trailing edge ring indicator bit 3 Delta received line signal detect bit 4 CTS bit 5 DSR bit 6 RI bit 7 Received line signal detect BASE 7 Temporary data register B 4 ADAM 5510 Data Formats and I O Ranges Data Formats and I O Ranges C 1 Analog Input Formats The ADAM analog input modules can be configured to transmit data to the host in Engineering Units 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 The Engineering Units format is readily parsed by the majority of computer languages because the total data string length including sign digits and decimal point does not exceed seven characters The data format is a plus or minus sign followed by five decimal digits and a decimal point The input range which is em ployed determines the resolution or the number of decimal places used as illustrated in the following table Input Range Resolution 15 mV 50 mV 1 uV three decimal places 100 mV 150 mV 10 uV two decimal places 500 mV 1 V 2 5 V tb V 100 uV four decimal places 1 mV three decimal places 1 pA three decimal places Type J and T 0 01 C two decimal places thermocouple Type K
65. dog timer to monitor the micropro cessor It will automatically reset the microprocessor in the ADAM 5510 system if the system fails 3 3 Technical Specifications of ADAM 5510 System System e CPU 80188 40 16 bit microprocessor Flash ROM 256 KB 170 KB free memory for users Operating system Boot ROM DOS Flash memory 256 KB 400 KB free space for users SRAM 64 KB battery backup 192 KB free memory for users Timer BIOS Yes Real time clock Yes Watchdog timer Yes e COM1 3F8 RS 232 e COM2 2F8 RS 485 Programming port RS 232 interface DB 9 connector Tx Rx GND e T O capacity 4 modules limitation one ADAM 5024 allowed CPU power consumption 1 0 W Status display Power CPU Communication Battery ADAM 5510 3 3 ADAM 5510 System RS 232 interface COM1 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 COM2 Signals DATA DATA Mode Half duplex multi drop Connector Screw terminal Transmission speed Up to 115 2 Kbps Max transmission distance 4000 feet 1220 m RS 232 programming port COM3 Signals Tx Rx GND Mode Asynchronous point to point Connector DB 9 pin Transmission speed Up to 115 2 Kbps Max transmission distance 50 feet 15 2 m Isolation
66. e frame ground of the DC power supply should be connected to the system ground ADAM 5510 F 13 Grounding Reference Characteristic of Cable This will destroy the twist rule Dont strip off too long of plastic cover for soldering or will influence the characteristic of twistedpair cable Figure F 12 The characteristic of the cable 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 F 14 ADAM 5510 Appendix F System Shielding A difficult way for signal FigureG 13 System Shielding 1 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 The noise will try to find another path for easier flow ADAM 5510 F 15 Grounding Reference System Shielding A more easy way for signal Figure F 14 System Shielding 2 Shield connection 2 The previous diagram shows you that the fill soldering just makes an easier way for the signal F 16 ADAM 5510 Appendix F F3 Noise Reduction Techniques Isolate noise sources in shielded enclosures Place sensitive equipment in shielded enclosure and away from comp
67. e is raised As you know each cable has impedance because of the metal it is made of Referring to Ohm s Law V I R this decreased current means lower power losses in the wire So high voltage lines are for reducing the cost of moving electrical power from one place to another ADAM 5510 F 7 Grounding Reference Wire Impedance The wire impedance will consume the power Figure F 6 wire impedance F 8 ADAM 5510 Appendix F 1 5 Single Point Grounding Single Point Grounding S S S 16V 18V 20V 22V 0 0 0 0 Those devices will influence each other with swiftly load change Figure F 7 Single point grounding 1 What s Single Point Grounding Maybe you have had an unpleasant experience while taking a hot shower in Winter Someone turns on a hot water faucet somewhere else You will be impressed with the cold water The bottom diagram above shows an example of how devices will influence each other with swift load change For example normally we turn on all the four hydrants for testing When you close the hydrant 3 and hydrant 4 the other two hydrants will get more flow In other words the hydrant cannot keep a constant flow rate ADAM 5510 F 9 Grounding Reference Single Point Grounding ce Ce al oo ADAM ADAM ADAM ADAM 24V 4013 4014 4017 4021 Power 416V 18V 420V 22V Ce 22V 22V 22V 22V nd I Load ADAM ADAM ADAM ADAM
68. e local physical cable that connected to Ground Bar iris Phase Three Line N L T Figure F 2 Grounding Bar According to previous description grounding is one of the most important issues for our system Just like Frame Ground of the comput er this signal offers a reference point of the electronic circuit inside the computer If we want to communicate with this computer both Signal Ground and Frame Ground should be connected to make a reference point of each other s electronic circuit Generally speaking it is necessary to install an individual grounding bar for each system such as computer networks power systems telecommunication networks etc Those individual grounding bars not only provide the individual reference point but also make the earth a true ground F 4 ADAM 5510 Appendix F 1 3 Normal Mode and Common Mode Normal Mode amp Common Mode pv Neutral Live Hot ys Ground Normal Mode refers to defects occurring between the live and neutral conductors Normal mode is sometimes abbreviated as NM or L N for live to neutral Common Mode refers to defects occurring between either conductor and ground Itis sometimes abbreviated as CM or N G for neutral to ground Figure F 3 Normal mode and Common mode 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 wi
69. ed in the status field ADAM 5510 0 7 Quick Start pouen peeo o pe COMport Select host PC COM port eg COM1 and configure other parameters Search Search for ADAM 5000 series plug in modules Setup Specify module types amp I O range values including three options v System setting v Module setting v Output data Get current VO values amp module status Calibrate Calibrate modules Parameters are stored in each module s onboard EEPROM Terminal Change to ADAM 5510 terminal mode allowing key in of commands then return to main menu Save module setup values in the host PC Quit Exit main menu Return to last operating status Table 0 3 Module configuration utility menu selections 0 3 3 Compiling and debugging user defined applications ADAM 5510 EXE can also be used to compile your application programs Call Turbo C and the Turbo Debugger from this utility 1 Make sure the relevant access paths were all properly specified Refer to Section 0 3 1 2 Move the cursor to Utility select Compile and press En ter The Turbo C Integrated Developing Environment will be invoked and will load the PRJ file just specified Set the compiler options to x87 Emulation and 8088 86 or 80186 CPU Only 0 8 ADAM 5510 Chapter 0 3 After compiling your source code to an executable file you can trace the execution process using the Turbo Debugger if neces sary Move the cursor to
70. essages you get when the problem occurs 2 Call your dealer and describe the problem Please have your manual product and any helpful information readily available 3 If your product is diagnosed as defective obtain an RMA return material authorization number from your dealer This allows us to process your return more quickly 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 5 Write the RMA number visibly on the outside of the package and ship it prepaid to your dealer Table of Contents Chapter 0 Quick Start e eee O 1 0 1 System Re ines Pes m A 0 1 1 Host computer NER eco qi M een Seng 0 1 2 ADAME5510 i ie epe eee ep e nete 0 2 0 1 3 I O modules nnt ttem em 0 3 0 2 Installation 30 o neon eu DD eb t eo dera 0 3 0 3 Utility application program ADAMS510 EXE 0 5 0 3 1 Configuration 5 edoenib detecte eee eire 0 5 0 3 2 I O modules configuration eeeeeeeenrne 0 7 0 3 3 Compiling and debugging user defined applications 0 8 0 3 4 Run program and download sese 0 9 0 4 Exaniples2 ise pee Eee MP 0 12 0 5 Conclusio 5 ate hp es eee let 0 13 Chapter 1 Introduction
71. functions of MS DOS except the BIOS Users can run standard PC software or application programs written in high level languages under this ROM DOS environment Built in ROM and RAM disk for programming The ADAM 5510 has built in flash ROM and SRAM for file down loading system operation and data storage The system provides 170 KB free ROM to allow users to download programs There is also 192 KB free RAM to provide the memory needed for efficient application operation and file transfer Built in RS 232 485 communication ports The ADAM 5510 has two serial communication ports to enable the controller to communicate with other devices in your applications The COMI port is dedicated as an RS 232 interface The COM2 port is dedicated as the RS 485 port This unique design makes the controller suitable for use in a variety of applications 3 2 ADAM 5510 Chapter 3 3 way isolation and watchdog timer Electrical noise can enter a system in many different ways It may enter through an I O module a power supply connection or the communication ground connection The ADAM 5510 system provides isolation for I O modules 3000 Vc communication connections 2500 V c and power connections 3000 Vc The 3 way isolation design prevents ground loops and reduces the effect of electrical noise on the system It also offers better surge protection to prevent dangerous voltages or spikes from harming your system The system also provides a watch
72. he value returned Note The pValue for ADAM 5017H must be interpreted in reference to the input range that be setup in the module configuration Return Value None Example main t int Value range int Format Range One ADAM 5017H module on slot 1 of the ADAM 5510 printf Init ADAM5017H n Init5017H 1 printf Get ADAM5017H n for j 0 j lt 8 j for iz0 i 4 i 6 42 ADAM 5510 Chapter 6 Get ADAM 5017H data and range from channel 0 to 7 on slot 1 of ADAM 5510 in Appendix C and Remarks None if Get5017H 1 j value i 3 GetRange5017H 1 j range See range index and format Range range amp OxFF Format range amp OxFF00 58 printf ADAM 5017H d d n j value printf with range is Ox X format is 0x X Range Format ADAM 5510 6 43 Function Library Get5050 Get5051 Get5052 Syntax void Get5050 int Board int Bit int Size void pValue void Get5051 int Board int Bit int Size void p Value void Get5052 int Board int Bit int Size void pValue Description Reads the data value in an I O module Parameter Description Board ADAM 5510 slot number from 0 to 3 Bit See Size parameter below Size ABit AByte AWord If Size ABit Bit 0 15 pinO pin15 If Size AByte Bit 0 for Low Byte data Bit 8 for High Byte data If Size AWord Bit does not care Always word dat
73. hese subroutines to execute the ADAM 5510 s I O functions while programming in Borland C 3 0 languages For a detailed description refer to Chapter 6 Function Library 1 2 4 Built in real time clock and watchdog timer The microcontroller also includes a real time clock and watchdog timer The real time clock records events while they occur The watchdog timer is designed to automatically reset the microprocessor if the system fails This feature greatly reduces the level of mainte nance required and makes the ADAM 5510 ideal for use in applica tions which require a high level of system stability 1 3 System Configuration The following diagram shows a possible ADAM 5510 system configuration COM1 RS 232 f nm ADAM LO Q o o El oO oO a a oO oO n if oO Dr a El ror n o a n Lees B B 8 E iii B is a B El o a im mo M 8 L i I I a ao a El o a n a oOo o a a im Li a oO A E POWER SUPPLY m a B E fi 10 430 V y D i E OJ Y g J J DB 9 s COM2 RS 485 g M ANALOG INPUT PROGRAMMING DIGITAL INPUT HOST COMPUTER DIGITAL OUTPUT Figure 1 1 ADAM 5510 system configuration ADAM 5510 1 3 Introduction This page intentionally left blank 1 4 ADAM 5510 2 Installation Guidelines Installation G
74. il it is firmly seated in the backplane connector 3 Push in the retaining clips at the top and bottom of the unit to secure the module to the base The following list gives an overview of what is needed to setup install and configure an ADAM 5510 environment e ADAM 5510 Main Unit and I O Modules e AnIBM PC AT compatible computer with a standard RS 232 port e Power supply for the ADAM 5510 system 10 to 30 V e ADAM 5510 utility diskettes po e Straight through and crossover DB 9 cables 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 commu nication port to allow users to download programs into the ADAM 5510 Power supply For ease of use in industrial environments the ADAM 5510 is designed to accept industry standard 24V unregulated power Operation is guaranteed when using any power supply voltage between 10 and 30V c Power ripples must be limited to 200 mV peak to peak while the voltage in all cases must be maintained between 10 and 30 V A 2 ADAM 5510 Appendix A Utility software A menu driven utility software disk is provided with ADAM 5510 to help users to download programs to the ADAM 5510 The ADAM 5510 utility software is executed in an MS DOS or compatible environ ment A 2 Basic Steps to Install ADAM 5510 System The following steps explain how to build a successful ADAM 5510 application
75. input range in an ADAM 501718 module Parameter Board Channel pRange Return Value pRange Remarks None Description 0 3 for SlotO Slot3 0 7 for ADAM 5017 0 6 for ADAM 5018 The input range code returned See Appendix C The input range code returned ADAM 5510 6 39 Function Library Init5013 Syntax void Init5013 int Slot Description Initializes ADAM 5013 Note that ADAM 5013 must be initialized before other commands are issued to it Parameter Description Slot From 0 to 3 Return Value None Example void main void int I initializes 4 slots RTD modules for I 0 I lt 4 I Init5013 TI Remarks None 6 40 ADAM 5510 Chapter 6 Init501718 Syntax void Init501718 int Slot Description Initializes ADAM 5017 or ADAM 5018 Note that ADAM 5017 or ADAM 5018 must be initialized prior to other commands being issued to them Parameter Description Slot From 0 to 3 Return value None Example void main void t int I initializes 4 slots AI module for I 0 I lt 4 I Init501718 I1 Remarks None ADAM 5510 6 41 Function Library 6 5 3 High Speed I O Library HIO LIB Get5017H Syntax void Get5017H int Board int Channel void p Value Description Reads the data value in an ADAM 5017H module Parameter Description Board 0 3 for SlotO Slot3 Channel 0 7for ADAM 5017H pValue T
76. ipment However 80 of reliability depends on Grounding and Shielding In other words we need to invest more in that 2096 and work on these two issues to make a highly reliable system This application note brings you some concepts about field grounding and shielding These topics will be illustrated in the following pages 1 Grounding 11 The Earth for reference 12 The Frame Ground and Grounding Bar 13 Normal Mode and Common Mode 14 Wire impedance 15 Single Point Grounding 2 Shielding 2 1 Cable Shield 2 2 System Shielding 3 Noise Reduction Techniques 4 Check Point List F 2 ADAM 5510 Appendix F F1 Grounding 1 1 The Earth for reference Why we think the EARTH as GROUND As you know that the EARTH can t be conductive indeed But those parallel resistors make the EARTH as a single point and just for reference Figure F 1 Think the EARTH as GROUND Why we think the EARTH as GROUND 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 point for reference ADAM 5510 F 3 Grounding Reference 1 2 The Frame Ground and Grounding Bar Neutral is the physical cable from Generator Ground is th
77. its Return Value None Example void main port_install 1 port_select 1 port speed 1 9600L set data format Data Length 8 Parity None Stop Bit 1 port set format 1 8 0 1 6 108 ADAM 5510 Chapter 6 Name Disable Port FIFO FIFO Size 1 for Tx and Rx Enable Port FIFO FIFO Size 128 for Tx and Rx Description Set specified port to disable FIFO Set specified port to enable FIFO Syntax void port_disable_fifo int portno int port_enable_fifo int portno Parameter Description portno The specified port number Return Value Disable FIFO None Enable FIFO 0x00 FIFO enable success 0x01 FIFO not available 0x04 portno error Example void main port_install 1 port set format 1 8 0 1 enable port FIFO to 128 byte port_enable_fifo 1 ADAM 5510 6 109 Function Library Name Detect Port Carrier Description Detect the carrier signal of specified port Syntax int port carrier int portno Parameter Description portno The specified port number Return Value 0 nocarrier been detected or bad command or parameter 1 detect carrier Example void main port_install 1 port_enable_fifo 1 if port1 detected carrier print out the message if port_carrier 1 printf n port detect carrier 6 110 ADAM 5510 Chapter 6 Name Clear Port Break Set Port Break Description Set specifie
78. itten in C language Given the prevalence of C language programming tools this is a distinct advantage for many users and can result in a very short learning curve and very modest training expense requirements See Chapter 3 ADAM 5510 System for detailed technical specifications 1 2 2 RS 232 485 communication ability The ADAM 5510 has three serial communication ports giving it excellent communication abilities This facilitates its ability to control networked devices Among its three ports COMI is a dedicated RS 232 port and COM is a dedicated RS 485 port These two ports allow the ADAM 5510 to satisfy diverse communication demands CONG is a programming port for downloading or transferring executable programs from a host PC It can also be used as an RS 232 communication port 1 2 3 Complete set of I O modules for total solutions The ADAM 5510 uses a convenient backplane system common to the ADAM 5000 series Advantech s complete line of ADAM 5000 modules integrates with the ADAM 5510 to support your applica tions 1 2 ADAM 5510 Chapter 1 A full range of digital modules support 10 to 30 V e I O and relay outputs A set of analog modules provide 16 bit resolution and programmable input and output including bipolar signal ranges For details refer to Chapter 4 I O Modules A complete set of C language I O subroutines are included in the ADAM 5510 s function library to reduce programming effort Users can easily call t
79. ll get nonsense values Hot and Neutral are just relational signals you will get 110VAC or 220VAC by measuring these signals Normal mode and common mode just show you that the Frame Ground is the most important reference signal for all the systems and equipments ADAM 5510 F 5 Grounding Reference Normal Mode amp Common Mode Neutral Live Hot Ground Groundpinis longer than others for first contact to power system and noise bypass Neutralpin is broader thanLive pin for reduce contacted impedance Figure F 4 Normal mode and Common mode 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 F 6 ADAM 5510 Appendix F 1 4 Wire impedance Whats the purpose of High Voltage Transmission High Voltage Transmission Generator End User Raise Voltage Down Voltage Referring to OHM rule above diagram shows that how to reduce the power loss on cable Figure F 5 The purpose of high voltage transmission 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 voltag
80. mation storage Parameter Description ulAddress User determined destination address for byte transfer taken from the range 0x80000L to OxBFFFHL byte The value to be saved Return value TRUE Successful transfer to Flash memory FALSE Error destination already occupied excess address range or program error Example void main void unsigned long FlashAddr 0x80000L programByte FlashAddr 0x55 programByte FlashAddr 1 0OxAA Remarks None ADAM 5510 6 19 Function Library ProgramSector Syntax unsigned short ProgramSector unsigned long ulAddress unsigned charfar SECTOR DATA Description Programs an entire 32 KB sector of data of the global variable SECTOR DATA into 256 KB Flash memory Parameter Description ulAddress User determined destination address in the Flash memory taken from addresses in the range 0x80000L to OxB8000L SECTOR DATA Pointer at the starting address in the origin memory of the user s data array Return value TRUE Successful transfer to Flash memory FALSE Error destination already occupied excess address range or program error Example void main void int i for I 0 I lt 32768 I SECTOR_DATA I 55 ProgramSector 0x80000L Remarks None SECTOR_DATA 6 20 ADAM 5510 Chapter 6 read backup ram Syntax unsigned char read backup ram unsigned int index Description Reads the value i
81. ming port COM3 and sets the interrupt vector to the inter rupt service routine Parameter Description None Return value int status 0 Successful installation Drivers are already installed Example void main t int status status com pgm install if status 0 printf n Programming port has been installed successfully else exit 0 Remarks None ADAM 5510 6 81 Function Library com pgm rx Syntax char com pgm 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 c The return character Example void main t char CPGMdata CPGMdata com pgm rx Remarks None 6 82 ADAM 5510 Chapter 6 com pgm rx empty com pgm tx empty Syntax int com pgm rx empty void int com pgm tx empty void Description Returns the status of the COM3 Programming port transmitting and receiving queues Parameter Description None Return value Com pgm rx empty returns TRUE if the receiving queue is empty Com pgm tx empty returns TRUE if the transmitting queue is empty Example void main t unsigned char data if com pgm rx empty FALSE data com pgm rx Remarks The CONG programming port transmitter uses polling action not interrupt action Its queue is always empty ADAM 5510 6 8
82. n 4 Two ADAM 5510 utility diskettes 0 2 ADAM 5510 Chapter 0 5 Power supply for the ADAM 5510 10 to 30 V o with power cable 0 1 3 I O modules At least one I O module is needed to use the system A variety of I O modules are available to meet different application requirements Table 0 1 gives a current listing of these modules as of this printing eae Mame Spocicaton Rates 2 Digital VO ADAM 5050 16 ch universal DI O Non isolated ADAM 5051 16 ch DI Non isolated ADAM 5052 8 ch DI Isolated ADAM 5056 16 ch DO Non isolated 3 Relay output ADAM 5060 6 ch relay output Isolated ADAM 5068 _ 8 ch relay output lsolated 4 Counter Frequency ADAM 5080 4 ch counter frequency input Selectable Isolation 5 Serial O ADAM 5090 4 port RS 232 Module Non isolated Table 0 1 ADAM 5000 I O modules 0 2 Installation 1 Open the ADAM 5510 package and make sure that the following items are present 1 One ADAM 5510 base unit with two blank slot covers 2 One ADAM 5510 user s manual 3 One core clamp for use in power supply connections 4 Two ADAM 55 10 utility diskettes ADAM 5510 0 3 Quick Start 2 Make sure that everything described in Section 0 1 is ready 3 Connect the ADAM 5510 power cable between the power supply and the ADAM 5510 screw terminals Vs and GND Make sure that the power source is between 10 to 30 Vie 4 Connect the download cable between the host
83. n backup RAM at index address 60 KB total backup RAM index 0 61439 absolute addresses from 0x30000 Ox3EFFF Parameter Description index From 0 to 61439 60 KB in total Return value The single byte value in backup RAM at address index Example void main void t unsigned char data data read backup ram 500 put your codes here Remarks None ADAM 5510 6 21 Function Library read mem Syntax unsigned char read mem int memory segment unsigned int 1 Description Reads far memory data 256 KB Flash memory from Ox80000L to OxBFFFFL where the Absolute Address SEG 16 OFFSET For example Ox800FFL 0x8000 16 OXOOFF Parameter Description memory segment User determined address taken from the range 0x8000 to OXBFFE i Offset for use in location of memory taken from the range 0x0000 to OXFFFF 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 6 22 ADAM 5510 Chapter 6 Release All Syntax void Release AII Description Releases all timer resources of the ADAM 5510 system Parameter Description None Return value None Remarks None Example void main t int idx Initializes the timer built into the 80188 microprocessor Timer Init Sets time inter
84. n is 5 pA Example An analog output module on channel 1 of slot 0 in an ADAM 5000 system at address Olh is configured for a 0 to 20 mA range If the output value is 4 762 mA the format of the Analog Data Out command would be 01S0C14 762 lt cr gt C 6 Analog Output Ranges Range Output Range Data Formats Maximum Displayed Code Description Specified Resolution Signal Engineering 20 000 5 yA Units 30 0 to 20 mA of Span 100 00 5 pA Hexadecimal FFF 5 yA Binary Engineering 20 000 5 pA Units 31 4 to 20 mA of Span 100 00 5 yA Hexadecimal FFF 5 pA Binary Engineering 10 000 2 442 mV Units 32 Oto 10V of Span 100 00 2 442 mV Hexadecimal 2 442 mV Binary C 8 ADAM 5510 Appendix C C 7 ADAM 5013 RTD Input Format and Ranges 100 Ohms Platinum RTD 100 to 100 C a 0 00385 100 Ohms Platinum RTD 0 to 100 C a 0 00385 100 Ohms Platinum RTD 0 to 200 C a 0 00385 100 Ohms Platinum RTD 0 to 600 C a 0 00385 100 Ohms Platinum RTD 100 to 100 C a 0 00392 100 Ohms Platinum RTD 0 to 100 C a 0 00392 100 Ohms Platinum RTD 0 to 200 C a 0 00392 Data Formats Engineering Units Engineering Units Engineering Units Engineering Units Engineering Units Engineering Units Engineering Units 0 1 C 0 1 C 0 2 C 0 1 C 0 1 C 2 C Maximum Minimum Displayed Specified Resolution Signal 100 00
85. nated twice RS 485 Data Flow Control The RS 485 standard uses a single pair of wires to send and receive data This line sharing requires some method to control the direction of the data flow RTS Request To Send and CTS Clear To Send are the most commonly used methods Host command Module reply Re Figure E 6 RS 485 data flow control with RTS Intelligent RS 485 Control ADAM 4510 and ADAM 4520 are both equipped with an I O circuit which can automatically sense the direction of the data flow No handshaking with the host like RTS Request to Send is necessary to receive data and forward it in the correct direction You can use any software written for half duplex RS 232 with an ADAM network without modification The RS 485 control is completely transparent to the user E 8 ADAM 5510 Appendix F Grounding Reference ADAM 5510 F 1 Grounding Reference Field Grounding and Shielding Application Overview 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 You know the 80 20 rule in our life we spend 2096 time for 8096 work but 8046 time for the last 20 of the work So is it with system integration we pay 20 for Wire Cable and 0 for Equ
86. nd cross over the first shield layer This spiraled structure makes an isolated layer for reducing external noise Additionally follow these tips just for your reference The shield of a cable cannot be used for signal ground The shield is designed for carrying noise so the environment noise will couple and interfere with your system when you use the shield as signal ground The higher the density of the shield the better especially for communication network Use double isolated cable for communication network AI AO Both sides of shields should be connected to their frame while inside the device for EMI consideration Don t strip off too long of plastic cover for soldering ADAM 5510 Appendix F 2 2 System Shielding wi Power Cascade those shields together by Soldering NIE Supply Never stripping too long of the plastic cable cover Connect the shield to Frame Ground of DC Power Supply J Figure F 11 System Shielding Never stripping too much of the plastic cable cover This is improper and can destroy the characteristics of the Shielded Twisted Pair cable Besides the bare wire shield easily conducts the noise Cascade these shields together by soldering Please refer to follow ing page for further detailed explanation Connect the shield to Frame Ground of DC power supply to force the conducted noise to flow to the frame ground of the DC power supply Th
87. ne 8 pin DIP switch on backplane board The following figure shows the location of the jumpers JP2 gar on N JP4 is for battery power ON OFF Figure 2 8 Jumper locations on the CPU card COM2 port RS 485 control mode setting The COM2 port is dedicated as an RS 485 interface Jumper JP3 on the CPU card lets you configure the control mode for automatic control or RTS control Jumper settings are shown below AUTO AUTO RTS RTS Automatic Control Default RTS Control Figure 2 9 COM2 port RS 485 control mode setting JP3 ADAM 5510 2 9 Installation Guidelines 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 Reset Mode Default Figure 2 10 Watchdog timer setting NMI Mode Disable WDT Network address setting Set the network address using the 8 pin DIP switch Valid settings range from 0 to 255 00h to FFh where ON in any of the 8 DIP switch positions equates to a binary 1 and OFF equates to a binary O For example if the Node ID is 03h the DIP switch settings for switches 1 and 2 representing bits 1 and 2 would both be ON while the rest of the switches would be OFF The default Node ID is O1h x Figure 2 11 ADAM 5510 network address DIP switch 2 10 ADAM
88. nstalled on a panel or on a DIN rail Panel mounting Mount the system on the panel horizontally to provide proper ventila tion You cannot mount the system vertically upside down or on a flat horizontal surface A standard 7 tating screw 4 mm diameter should be used D amp Figure 2 6 ADAM 5510 panel mounting screw placement ADAM 5510 2 7 Installation Guidelines DIN rail mounting The system can also be secured to the cabinet by using mounting rails If you mount the system on a rail you should also consider using end brackets at each end of the rail The end brackets help keep the system from sliding horizontally along the rail This minimizes the possibility of accidentally pulling the wiring loose If you examine the bottom of the system you will notice two small retaining clips To secure the system to a DIN rail place the system on to the rail and gently push up on the retaining clips The clips lock the system on the rail To remove the system pull down on the retaining clips lift up on the base slightly and pull it away from the rail Figure 2 7 ADAM 5510 rail mounting 2 8 ADAM 5510 Chapter 2 2 5 Jumper Settings and DIP Switch Settings This section tells you how to set the jumpers and DIP switch to configure your ADAM 5510 system It gives the system default configuration and your options for each jumper and dip switch There are three jumpers on the CPU card and o
89. ntf start failed n 6 98 ADAM 5510 Chapter 6 Name Check Overflow Description Check if counter value reach max count limit Syntax void ReadOverflowFlag int slotno char pValue Parameter Description slotno The specific slot inserted with ADAM 5080 0 3 or slotO slot3 pValue The value returned Return Value The overflow value returned Example void main t char overflag value 4 int i ReadOverflowFlag 0 amp overflag value 0 for i 0 i lt 4 i printf channel d over flag value dWMn i overflag value i ADAM 5510 6 99 Function Library Name Set Initial Value Description Set initial counter value between 0 to 4 294 967 295 Syntax int SetInitCounterVal int slotno int channel unsigned long Value Parameter Description slotno The specific slot inserted with ADAM 5080 0 3 or slot0 slot3 channel The specific channel in ADAM 5080 0 3 Return Value None Example void main unsigned long int i i 1000 set 1000 to the initial counter value SetInitCounterVal 0 0 i 6 100 ADAM 5510 Chapter 6 6 5 6 Serial I O Library A5090 LIB Port 1 31 Port 2 32 Port 3 33 Port 4 34 Table 6 1 ADAM 5090 Port No Definition Name Install Port Description Install the communication drivers Syntax int port_install int portno Parameter Description portno The specified port number Return Value 0 firs
90. o com enable fifo Syntax void com disable fifo unsigned baseaddr int com enable fifo unsigned baseaddr unsigned triggerlevel Description Sets COM port to disable fifo receiving trigger level 1 4 8 14 Sets COM port to enable fifo receiving trigger level 1 4 8 14 Parameter Description Baseaddr The UART address COM1 0x3F8 COM2 0x2F8 Triggerlevel 1 4 8 14 Return value 0 Success 1 Fifo not available 10 Failure to enable Example None Remarks Please refer to the 16C550 UART register document Appendix B 6 56 ADAM 5510 Chapter 6 com flush rx com flush tx Syntax void com flush rx void void com flush tx void Description Buffer flushers Initializes the transmit and receive queues respective ly to their empty state Parameter Description None Return value None Example void main void com flush tx com flush rx Remarks None ADAM 5510 6 57 Function Library com get line status com set line params com get modem status Syntax int com get line status unsigned baseaddr int com set line params unsigned baseaddr unsigned lineparams int com get modem status unsigned baseaddr Description Reads from COM port line control register Writes to COM port line control register Reads from COM port modem status register Parameter Description baseaddr The UART address COM1 20x3F8 COM2 0x2F8 lineparams Plea
91. or 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 Baias Diis Baudrete Divsor sm 102 3 3 we 9 s 2 B 2 ADAM 5510 Appendix B BASE 1 BASE 2 BASE 3 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 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 ek Bte FIFO tigger ever a CA NT Line Control Register LCR bit 0 Word length select bit 0 bit 1 Word length select bit 1 bit 2 Number of stop bits bit 3 Parity enable bit 4 Even parity select bit 5 Stick parity bit 6 Set break bit 7 Divisor Latch Access Bit DLAB ADAM 5510 B 3 Register Structure 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 in
92. plication requirements or specific information on the installation and operation of any of our products Website information You can access the most current support on our website http www advantech com support or http www advantech com support kbase dir htm Product Warranty Advantech warrants to you the original purchaser that each of its products will be free from defects in materials and workmanship for one year from the date of purchase This warranty does not apply to any products which have been repaired or altered by other than repair personnel authorized by Advantech or which have been subject to misuse abuse accident or improper installation Advantech assumes no liability as a consequence of such events under the terms of this Warranty 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 materials service time and freight Please consult your dealer for more details If you think you have a defective product follow these steps 1 Collect all the information about the problem encountered e g type of PC CPU speed Advantech products used other hardware and software used etc Note anything abnormal and list any on screen m
93. ption None Return value None Example void main void int I WDT enable For I 0 I lt 10 I ADAMdelay 1000 WDT clear WDT disable Remarks None ADAM 5510 6 31 Function Library 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 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 6 32 ADAM 5510 Chapter 6 6 5 2 Low Speed I O Library LIO LIB AiUpdate Syntax int AiUpdate int Board int channel Description Checks whether the data of a low speed analog input module such as ADAM 5017 ADAM 5018 and ADAM 5013 is ready to be accessed Parameter Description int Board The slot number of an ADAM 5510 from 0 to 3 int channel The return value indicates the channel for which data is ready Valid value 0 to 7 for ADAM 5017 Valid value 0 to 6 for ADAM 5018 Valid value 0 to 2 for ADAM 5013 Return value int status 0 Ready Notready 2 The hardware of the module failed Example void main Che
94. put commands to operate the ROM disk and access files on the ADAM 5510 Note The ADAM 5510 s operating system 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 However there are limitations when running applica tion programs in the ADAM 5510 For example the ROM DOS command set does not include com mands that operate through the console to control the screen e g CLS clear screen etc In order to build successful applications you should keep these limitations and concerns in mind For more detailed information please refer to Chapter 6 ADAM 5510 0 11 Quick Start 0 4 Example Let s rehearse the above instructions with a simple example EX1 PRJ 1 Connect the host PC and the ADAM 5510 as described in section 0 2 Note that the COM port of the host PC and ADAM 5510 must be connected by a straight through DB 9 cable Install 3 I O modules in the ADAM 5510 ADAM 5017 5018 and 5013 in slots 1 2 and 3 respectively Insert the Utility Disk into the floppy disk drive in the host PC Run Install exe This executable program will copy necessary header files and libraries to the respective Turbo C header file and library directories The installation proceeds automatically Press any key after successful installation Now the default working directory should be 5510 Run Adam551
95. rge common range of the receiver required for RS 485 systems See Figure E 5 below E 6 ADAM 5510 Appendix E Figure E 5 Termination resistor locations Because each input is biased to 2 4 V the nominal common mode voltage of balanced RS 485 systems the 18 kQ 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 36kQ resistors in parallel with the termination resistor The overall effective resistance will need to be close to the characteristics of the line The effective parallel receiver resistance R will therefore be equal to R 36x 10 30 1200 Q While the termination receptor R will equal R R 1 RJR Thus for a line with a characteristic impedance of 100 Q resistor R 100 1 100 1200 2 110 Q Since this value lies within 10 of the line characteristic impedance ADAM 5510 E 7 RS 485 Network E 3 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 termi
96. rks None 6 92 ADAM 5510 Chapter 6 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 void modem handup close phone Remarks None ADAM 5510 6 93 Function Library modem initial Syntax void modem initial void Description Sets modem to initial status Due to the ADAMS510 system s con struction the modem can only be connected to COMI This resets the modem to the initial state The command has the same effect as sending the ASCII command atz to the modem Parameter Description None Return value None Example void main void you need to initialize COM1 modem initial put your modem function Remarks None 6 94 ADAM 5510 Chapter 6 6 5 5 Counter Frequency Library LIA LIB Name Initial Slot Description Initial ADAM 5080 Module Syntax void Init5080 int slotno Parameter Description slotno The specific slot inserted with ADAM 5080 0 3 or slotO slot3 Return Value None Example void main t initializes the ADAM 5080 Module in slot 0 init5080 0 ADAM 5510 6 95 Function Library Name Get Value Description Get Value from specific channel in ADAM 5080 Syntax
97. se refer to the UART specifications Return value Please refer to the 16C550 UART register document Appendix B Example None Remarks Please refer to the 16C550 UART register document Appendix B 6 58 ADAM 5510 Chapter 6 com install Syntax int com install int portnum Description Installs the communications drivers Parameter int portnum Description Return value Desired port number always 1 for ADAM 5510 int status 0 Successful installation 1 Drivers already installed 2 Invalid port number 3 No UART for specified port Example void main void status if else exit 0 com install 1 status 0 printf n COMI Remarks None COM1 install OK ADAM 5510 6 59 Function Library com lower dtr com raise dtr Syntax void com lower dtr void void com raise dtr void Description Sets COM port to DTR for low signal Sets COM 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 6 60 ADAM 5510 Chapter 6 com lower rts com raise rts Syntax void com lower rts unsigned baseaddr void com raise rts unsigned baseaddr Description Sets COM port to RTS for low signal Sets COM port to RTS for high signal Parameter Description baseaddr The UART address COM1 0x3F8
98. sec SetRTCtime RTC_min min SetRTCtime RTC_hour hour Remarks None 6 26 ADAM 5510 Chapter 6 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 lt 14 I Set SysMem I data I 10 Remarks None ADAM 5510 6 27 Function Library 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 6 28 ADAM 5510 Chapter 6 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 ADAM 5510 6 29 Function Library Timer Set Syntax int Timer Set unsigned int msec Description Req
99. selections 0 8 DB 9 programming port pin assignments 2 12 RS 232 port pin assignments eeeeeee 2 13 ADAM 5000 I O module support list 4 4 ADAM 5510 mini BIOS function calls 5 3 ADAM 5510 interrupt types eee 5 5 ADAM 5510 memory mapping RI 5 6 ADAM 5090 Port No Definition eene 6 101 0 Quick Start Quick Start Welcome amp Preview Welcome to the Advantech ADAM 5510 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 5510 s core capabilities This Quick Start chapter contains the following sections System requirements Installation guide Set up and configuration instructions A training example 0 1 System Requirements 0 1 1 Host computer 1 IBM PC compatible computer with 286 or above CPU HDD FDD and at least 640 KB of conventional memory plus 1 MB of extended memory 2 At least one standard RS 232 port e g COMI COM2 3 One RS 232 DB 9 straight through cable for downloading programming 4 One RS 232 DB 9 cross over cable for communication debugging 5 DOS version 3 31 or higher 6 Borland Turbo C 3 0 for DOS 0 1 2 ADAM 5510 1 One ADAM 5510 base unit with two blank slot covers 2 One ADAM 5510 user s manual 3 One core clamp for use in power supply connectio
100. stall void Description Releases the interrupt register of the microprocessor for use by the RS 485 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 485 port com 485 deinstall Remarks This function MUST be called before returning to DOS The interrupt vector will not be pointed to the interrupt service routine again 6 70 ADAM 5510 Chapter 6 com 485 flush rx com 485 flush tx Syntax void com 485 flush rx void void com 485 flush tx void Description COM2 RS 485 buffer flusher Initializes the transmitting and receiv ing queues to their empty states Parameter Description None Return value None Example void main t com 485 flush rx com 485 flush tx Remarks The COM2 RS 485 transmitter uses polling action not interrupt action Its buffer is always flushed ADAM 5510 6 71 Function Library com 485 install Syntax intcom 485 install void Description Allocates the interrupt registers of the microprocessor for use by the RS 485 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 int status status com_485_install if sta
101. status light is ON when power is ON in base unit b Green LED RUN base unit booting status light is on during boot up c Orange LED COMM base unit comm status light is on during base unit communication d Yellow LED BATT base unit battery status light is on when battery is low in base unit ADAM 5510 2 13 Installation Guidelines This page intentionally left blank 2 14 ADAM 5510 ADAM 5510 System ADAM 5510 System 3 1 3 2 Overview The ADAM 5510 is a PC based programmable microcontroller for standalone data acquisition and control which can control monitor and acquire data through multichannel I O modules Its IBM PC compatible hardware and operating system runs programs written in both assembly and high level languages Each system can handle up to 4 I O modules up to 64 I O points The system also provides serial communication ports RS 232 485 allowing the system to communi cate with other devices for versatile applications Major Features The ADAM 5510 system consists of two major components the main unit and I O modules The main unit includes a CPU card a power regulator a 4 slot base two serial communication ports and a pro gramming port It has the following major features Built in 80188 CPU and ROM DOS operating system ADAM 5510 s CPU card includes an 80188 microprocessor Its ROM DOS operating system is an MS DOS compatible system It provides all the basic
102. t time install and install completely 4 not first time install but install completely 5 portno error 6 no ADAMS5090 Module in this slot ADAM 5510 6 101 Function Library Name Deinstalled Port Description Uninstalled the communication drivers completely Syntax int port deinstalled int portno Parameter Description portno The specified port number Return Value 0 deinstall success l deinstall fail 6 102 ADAM 5510 Chapter 6 Name Select Working Port Description Select a specified port for work Syntax void port select int portno Parameter Description portno The specified port number Return Value None ADAM 5510 6 103 Function Library Name Reset Slot Description Reset specified slot Syntax int reset slot int slotno Parameter Description slotno The slot you would like to reset 0 3 Return Value None Example void main reset all port in the slot 0 reset_slot 0 6 104 ADAM 5510 Chapter 6 Name Reset Port Description Reset specified port Syntax void port reset int portno Parameter Description portno The specified port number Return Value None ADAM 5510 6 105 Function Library Name Detect Installed Port Description Detects which ports have been installed Syntax int which has been installed void Parameter Description portno The specified port number Return Value Port
103. tatus Ox00XX OxFF00 port_set_line_params 0x00 0x01 OxFEO0 OxFF00 LSR value bad command or parameter write success LCR read back error LCR write not able bad command or parameter ADAM 5510 6 113 Function Library Example 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 Bi BiS Bit4 Bit3 Bit2 Bitl Bit Name LSR Line Status Data Tx THR Rx Break Framing Parity Overrun RXRDY Register Error Empty Empty Error Error Error LCR Line Control divisor Tx Force odd even Parity Number data length bits 1 0 Register latch Break parity parity enable Jof access stop bit UART Register Description Table 6 114 ADAM 5510 Chapter 6 Name Read Modem Status MSR Description Read from specified port modem status register Syntax int port get modem status int portno Parameter Description portno The specified port number Return Value Ox00XX modem status OxFF00 i bad command or parameter Example 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 Bi6 Bi5 Bit4 Bit3 Bit2 Bitl BitO Name MSR Modem DCD DSR CTS Delta Trailing Delta Delta Status DCD RI edge D
104. the autoexec bat file in the DEBUGDL directory COM EOLEXE TDADAM EXE rpl rs4 NOTE Hegarding related parameters for the Turbo Debug ger please refer to Borland s documentation on the Turbo Debugger 6 Download the files in the DEBUGDL directory to the ADAM 5510 FLASH ROM by selecting Debug in the Utility pull down menu in the ADAM 5510 utility screen Reset the ADAM 5510 The ADAM 5510 is now configured for remote debugging Now configure Turbo C on the host computer for remote debugging 5 12 ADAM 5510 Chapter 5 8 Open the Turbo C editor on the host computer Select the Options item on the menu bar in the Turbo C editor Select Transfer on the pull down menu under the Options selection See Figure 5 8 Figure 5 8 Configuring Turbo C editor 9 Add a new program title as shown in Figure 5 9 The Program Titles will now look something like that shown in Figure 5 10 see next page n ra CTT a aidea AA a LS 7 ST te Ll 278 182 m IX T anolator Fi Hole Enter title sou wont assigned to the Tronofer JESP mmm Tp ES SS Se SSS Figure 5 9 Creating new transfer item ADAM 5510 Programming and Downloading MS DOS Promet oo m j Los File Fait Searom Run Cose DUM DNCTE IG S CUN TLD ti EST C Fi Hole Woo cursor inso to oxamine the Lios of Ironofor jseng 5 ge Yn Figure 5 10 New transfer item for A
105. ton Task esc instruct Print Failed to BOOT ROM DOS message Timer tick Table 5 1 ADAM 5510 mini BIOS function calls ADAM 5510 5 3 Programming and Downloading Converting program codes The ADAM 5510 has an 80188 CPU Therefore programs download ed into its flash ROM must first be converted into 80186 or 80188 compatible code and the floating point operation must be set to emulation mode For example if you were to develop your applica tion program in Borland C you would compile the program as indicated in the screen below F1 Help Dmtect and ume coprocessor nth cwisa emulate the OmaT aT Figure 5 1 Converting program codes Other limitations 1 The ADAM 5510 does not support the standard PC function 8253 Therefore the C language function call delay cannot be used in ADAM 5510 applications 2 Certain critical files are always kept in flash ROM such as operating system BIOS and monitoring files The ADAM 5510 provides an additional 170 KB of free ROM space for download ing user applications An additional free 192 KB of RAM is provided for operation of applications 5 4 ADAM 5510 Chapter 5 Programming the watchdog timer The ADAM 5510 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 unmanne
106. tus 0 printf n The allocation of COM2 port OK else exit 0 Remarks None RS 485 is 6 72 ADAM 5510 Chapter 6 com 485 rx Syntax char com 485 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 c The return character Example void main char C485data C485data com_485_rx Remarks None ADAM 5510 6 73 Function Library com 485 set format Syntax void com 485 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 2 2 stop bits Return value None Example void main Sets the data format of the RS 485 port to 8 bit data length no parity 1 stop bit com 485 set format 8 0 1 Remarks None 6 74 ADAM 5510 Chapter 6 com 485 set speed Syntax void com 485 set speed unsigned long speed Description Sets the baud rate of the RS 485 port Parameter Description speed The baud rate value Return value None Example void main com 485 set speed 9600L Sets the baud rate of the RS 485 port to 9600 bps Remarks None
107. uests 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 Integer Function success value represents function timer ID Max value of 100 l Function failure Remarks Timer function calls in the ADAM 5510 are emulated as timer func tions 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 6 30 ADAM 5510 Chapter 6 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 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 Parameter Descri
108. uidelines 2 1 This chapter explains how to install an ADAM 5510 microcontroller A quick hookup scheme is provided that lets you easily configure your system before implementing it into your application Starting up ADAM 5510 Step 1 Review your requirements Before you start installing the ADAM 5510 make sure the system requirements are met Host computer 1 IBM PC compatible computer with 286 or above CPU HDD FDD and at least 640 KB of conventional memory plus MB of extended memory 2 At least one standard RS 232 port e g COMI COM2 W ND Nn f One RS 232 DB 9 straight through cable for downloading programming One RS 232 DB 9 crossover cable for communication debugging DOS version 3 31 or higher Borland Turbo C 3 0 for DOS Borland Turbo Debugger optional This software is required only if you want to debug application programs on the ADAM 5510 ADAM 5510 Un A U N One ADAM 5510 base unit wiht two blank slot covers One ADAM 5510 user s manual One core clamp for power supply connection Two ADAMS510 utility diskettes Power supply for the ADAM 5510 10 to 30 V o with power cable I O modules 1 At least one ADAM 5000 series I O module 2 2 ADAM 5510 Chapter 2 Step 2 Wiring the power cable and download cable Connect the power cable between the power supply and the ADAM 5510 Make sure the power source is between 10 to 30
109. ut values into each of the modules four channels Parameter Description chO val The initial value output by channel 0 chl val The initial value output by channel 1 ch2 val The initial value output by channel 2 ch3 val The initial value output by channel 3 Return Value None Example void main void Init5024 0 0 0 0 0 initializes outputs of all channels of the ADAM 5024 in slot 0 to output a value of 0 Remarks None 6 48 ADAM 5510 Chapter 6 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 Remarks None ADAM 5510 6 49 Function Library 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 Parameter Description pValue The digital value specified by the user to be output Board Oto 3 SlotO Slot3 Bit See Size parameter below Size ABit AByte AWord IfSize ABit Bit 0 15 pinO pin
110. uter equipment Use separate grounds between noise sources and signals Keep ground signal leads as short as possible Use Twisted and Shielded signal leads Ground shields on one end ONLY while the reference grounds are not the same Check for stability in communication lines Add another Grounding Bar if necessary The diameter of power cable must be over 2 0 mm Independent grounding is needed for A I A O and communication network while using a jumper box Use noise reduction filters if necessary TVS etc You can also refer to FIPS 94 Standard FIPS 94 recommends that the computer system should be placed closer to its power source to eliminate load induced common mode noise Noise Reduction Techniques External Signal oa a6 Power Supply eparate Load and Device power ascade amplify isolation circuit before I O channel Figure F 15 Noise Reduction Techniques ADAM 5510 F 17 Grounding Reference F 4 Check Point List 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 The terminal screw are tight F 18 ADAM 5510
111. val 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 ADAM 5510 6 23 Function Library Releases all timer resources Release A11 6 24 ADAM 5510 Chapter 6 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 t 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 ADAM 5510 6 25 Function Library 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 RIC 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
112. x4 prj This is amodem test example which includes dial hang up auto answer and set break Example 5 Ex5 prj In this example the user s RAM RTC and battery backup RAM are combined to implement a data logger This data logger can store the time stamp of each piece of data recorded Example 6 Scanio prj This example scans all slots in an ADAM 5510 and then shows the status of any I O modules located in the slots It also demonstrates on off control of the LEDs on the ADAM 5510 and reads RTC real time clock time ADAM 5510 Appendix D Example 7 Ex7 prj ADAM 5017H is a new released AI module in the ADAM 5000 series It has a much higher sampling rate than its predecessor ADAM 5017 as demonstrated by this example Example 8 Ex8 prj ADAM 5510 allows users to adjust the size of the battery backup SRAM This example shows the way to use related functions Example 9 Ex9 prj The ADAM 5510 utility contains three functions allowing users to access the timer in the ADAM 5510 This example demonstrates these functions Example 10 Ex10 prj This example tells user how to read the counter value from the ADAM 5080 and how to show the data on the screen with ADAM 5510 Utility Example 11 Ex11 prj This example provides user a testing tool to verify the ADAM 5090 module Select any two ports on the module and connected by port to port cable the program can detect whether the ports are all right Example
113. y Advantech product is built to the most exacting specifications to ensure reliable performance in the unusual and demanding conditions typical of industrial environments Whether your new Advantech equipment is destined for the laboratory or the factory floor you can be assured that your product will provide the reliability and ease of operation for which the name Advantech has come to be known Your satisfaction is our number one concern Here is a guide to Advantech s customer services To ensure you get the full benefit of our services please follow the instructions below carefully Technical Support We want you to get the maximum performance from your prod ucts So if you run into technical difficulties we are here to help For most frequently asked questions you can easily find answers in your product documentation These answers are normally a lot more detailed than the ones we can give over the phone So please consult this manual first If you still cannot find the answer gather all the information or questions that apply to your problem and with the product close at hand call your dealer 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 In addition free technical support is available from Advantech engineers every business day We are always ready to give advice on ap

Download Pdf Manuals

image

Related Search

Related Contents

WiDirect User Manual  Trust 18891 headset  DGG-IM2 2013.01A  LeMans - Spectrum Signal Processing  Manuel de l`opérateur du TCM400  Daitem - Anbo Technology  Inklusion – ein Segen?  Aiptek 510002  Manuel d`utilisation  

Copyright © All rights reserved.
Failed to retrieve file