High Speed Link System Master-Slave Distributed Solution User’s Manual Manual Rev. 2.05 Revision Date: October 15, 2007 Part No: 50-12100-2040 Advance Technologies; Automate the World.
Copyright 2007 ADLINK TECHNOLOGY INC. All Rights Reserved. The information in this document is subject to change without prior notice in order to improve reliability, design, and function and does not represent a commitment on the part of the manufacturer. In no event will the manufacturer be liable for direct, indirect, special, incidental, or consequential damages arising out of the use or inability to use the product or documentation, even if advised of the possibility of such damages.
Getting Service from ADLINK Customer Satisfaction is top priority for ADLINK Technology Inc. Please contact us should you require any service or assistance. ADLINK TECHNOLOGY INC. Web Site: http://www.adlinktech.com Sales & Service: Service@adlinktech.com TEL: +886-2-82265877 FAX: +886-2-82265717 Address: 9F, No. 166, Jian Yi Road, Chungho City, Taipei, 235 Taiwan Please email or FAX this completed service form for prompt and satisfactory service.
Table of Contents Table of Contents..................................................................... i List of Tables.......................................................................... iv List of Figures ......................................................................... v 1 Introducing HSL ................................................................. 1 1.1 1.2 1.3 1.4 1.5 The HSL System.................................................................. 1 Product Overview ............
3 HSL Slave Module............................................................. 39 3.1 3.2 3.3 3.4 Slave I/O Module ............................................................... 40 Discrete I/O Module ...................................................... 40 Analog I/O Module ........................................................ 41 Motion Control .............................................................. 41 General Specifications ..................................................
5.6 Pulse Stretcher Function (HSL-DI16-UL Only) ................ 105 6 How to Program with HSL Function Library................ 109 6.1 Programming with HSL DLL ............................................ 109 DIO Operation ............................................................. 109 AI/O Operation ............................................................ 110 Motion Operation: ....................................................... 111 Appendix A A.1 A.2 Appendix B B.1 B.2 B.3 B.4 D.
List of Tables Table Table Table Table Table iv 1-1: 1-2: 1-3: 1-4: 1-5: Remote Operation .................................................. Slave I/O modules .................................................. Remote Motion modules ......................................... Terminal Base ......................................................... Polling cycle time of HSL (Full Duplex Mode) .........
List of Figures Figure 1-1: HSL topology ............................................................. 2 Figure 1-2: Traditional distributed PLC architecture .................... 5 Figure 1-3: Networking PLC......................................................... 6 Figure 1-4: HSL as distributed PLC ............................................. 7 Figure 1-5: Time-deterministic DAQ using HSL........................... 8 Figure 1-6: HSL technology brief -1 ...........................................
How to Use This Manual This manual helps you in configuring, installing, and using the HSL series products, and describes the functions and the operational theorem of the high-speed link technology. This manual is divided into the following chapters: Chapter 1 - HSL Introduction: Provides an overview of the HSL system, including the system features, specifications, and communication technology. Chapter 2 - HSL Master Controller: Presents detailed information on the HSL master.
References Master board. HSL is a master-slave communication system. In host side, we call the control board as master board. Slave module. HSL is a master-slave communication system. In remote side, the slave module can connect a variety of sensors. Slave index. The basic unit in HSL system. One HSL slave module may occupy 1, 2 or 4 slave indexes. This depends on the design of slave modules. Full duplex. Data transmission and receiving at the same scanning time. Half duplex.
viii How to Use This Manual
1 Introducing HSL 1.1 The HSL System The HSL is an innovative distributed I/O technology that enables time-deterministic scanning of thousands of I/O points in milliseconds using master-slave architecture. The HSL master board comes in PCI or PMC form factors. The PMC board is used in embedded controllers. By using commercial Ethernet cable with RJ-45 connector, you can easily set up the HSL slave modules as close as possible to the sensor devices, reducing wiring effort.
1.1.1 Product Overview The illustration shows the basic HSL system topology. Figure 1-1: HSL topology 1.1.2 Product Highlights High-speed performance With scanning speed as high as 1000 points per ms, it takes only 1.895 ms for an HSL master to scan all the discrete I/O points of slave modules under 6 Mbps. For example, a distributed control system with 63 slave I/O modules of HSLDI16DO16-DB-NN with 2016 discrete I/O points can be scanned or updated within 1.895 ms.
Time-deterministic scanning The HSL master controller implements a deterministic time period when scanning all slave I/O modules. The total scanning cycle time is exactly proportional to the number of slave indexes. At 6 Mbps, every 30.33 µs is added for another slave index. For an HSL system with 30 discrete I/O slave modules (where every discrete I/O module occupies one slave index), the scanning time period is precisely 30 X 30.33 µs = 909.9 µs.
available slot. In contrast with centralized configuration, the distributed I/O configuration eliminates this limitation of a centralized I/O configuration. With the HSL system, adding more I/O points only requires one more slave I/O module and an Ethernet cable for communication link. Self-diagnostic function The HSL provides a self-diagnostic function that eliminates communication failures.
modules at fixed scanning period and keeps the most updated I/O status information on the SRAM. You may read and write the data in the 32 KB SRAM on HSL master card through the PCI or PMC bus. You can easily read/write the most updated I/ O information and never worry with the HSL protocol. 1.1.3 HSL Applications HSL as a Distributed PLC The distributed PLC is an important system in the field of industry automation. Via communication modules, such as RS232, RS485, PLC also performs distributed control.
Figure 1-3: Networking PLC PLCs that are capable of network communications are usually very expansive. And since the PLC is not an open architecture, only hardware vendors are capable of producing it.
The HSL distributed control architecture is illustrated in Figure 1.4. With HSL, there is no need for an extra PC for Ethernet communication. You may use only one IPC to control the entire system.
The time-deterministic characteristic of an HSL system is an important factor when implementing a DAQ application. With an HSL system, all I/O data are refreshed in time-deterministic. The sampling rate (or scan rate) is linearly dependent on the number of slave indexed occupied, ranging from 91 µs (less than three slave indexes) to 1.911 ms (63 slave indexes) under 6 Mbps.
1.2 HSL System Specifications Platform X Hardware platform: Industrial PC with PCI Bus/Embedded SBC with PMC connector X Operating system platform: Windows® 98/2000/NT/XP or Linux Redhat Software support X Windows XP/2k library X Linux: Kernel 2.4.
Transmission Speed L (m) 3 Mbps 300 6 Mbps 200 12 Mbps 100 Table 1-1: Remote Operation Supports maximum 2.
Communications X Multi-drop full-duplex RS-422 with transformer isolation scheme X Transmission speed: 3/6/12 Mbps (6 Mbps is factory default setting). X I/O refresh rate: scan time unit × numbers of slave indexes (minimum is 3; maximum is 63) 3 Mbps 6 Mbps 12 Mbps Full Duplex 60.67 µs 30.33 µs 15.17 µs Half Duplex 118 µs 59 µs 29.
1.3 HSL Series Products HSL Master controller boards See HSL Master Board on the previous section. At least one master controller card is needed for an HSL system. With PCI-7854 or PMC-7852/G, two master controllers are available. A maximum of 12 cards are supported for a single computer system. Slave I/O modules A variety of HSL slave I/O modules are available.
Note: Start Index Setting Range means range of the start index address of DIP switch setting. Full duplex and half duplex mode have different ranges. Terminal Base A variety of HSL terminal base are also available.
1.4 Technical Information 1.4.1 HSL Technology Introduction Inside an HSL system, a single master controller communicates with multi-slave through a command-response. The master controller sends commands to slave I/O modules for setting output values and requesting input information. Every slave module responds after receiving commands with address ID. The responses may either be to set output according to the received values or to reply requested input information to the master controller.
The teacher (master) sends message “ID.#, your output values are XXX” to all students (slave I/O modules). Every student (with ID.#) then sets its output channels according to the values heard. The values that the teacher announced to the students are written on the blackboard (RAM on master cards), and can be easily modified. The following illustration shows the working theory for gathering input information.
The teacher (master) sends the message “ID.#, what is your latest input status” to all students (slave I/O modules). Every student (with ID.#) then gives his answer. The teacher writes the answers on the blackboard (RAM on master cards). When someone (user’s AP) wants to know the students’ answers, he refers to the blackboard. All input information are saved in the memory. These two procedures take turn and repeat on every slave module.
Figure 1-8: HSL I/O polling cycle Introducing HSL 17
The HSL master-slave communication architecture is illustrated below: Figure 1-9: Master-slave communication architecture 18 Introducing HSL
1.4.2 HSL Terminology In addition to the input/output polling mechanism shown above, here are some HSL-related syntax for your reference. HSL Master. Master is defined as the teacher in Figure 1.9 and 1.10. The master takes charge of giving commands, including output value announcements and latest input status requests. Slave I/O Module. Slave I/O modules are defined are the students in Figure 1.9 and 1.10. Slave I/O modules are passive components in an HSL system.
1.4.3 System Configurations To develop an HSL application, you must know how to configure the HSL cards and slave I/O modules. The following sections describe the configuration concepts for an HSL system. For detailed information, refer to individual chapters. Master Card Index (card_ID). You can install one or more HSL master boards in an IPC system. The PCI BIOS assigns the card index for each HSL master board. You need to specify the card index for programming purposes. The card index is starts from 0.
Slave Index. A complete HSL system is composed of one master and 1 to 63 slave indexes. The following diagram illustrates an HSL system. Figure 1-11: HSL system layout example-serial wiring Every master circuit can support up to 32 slaves. However, since the slave address is assigned by a 6-bit DIP-switch on the I/O module’s termination board with the value ‘0’ reserved, the maximum number of slaves is 63, not 64. The slave I/O modules in an HSL system must have different slave index.
1.4.4 Wiring The HSL network follows a modified RS-422 electrical specification. Wiring The wire cables of an HSL system are carefully selected for installation convenience and standardization without sacrificing communication quality. A 100BaseTX cable with RJ-45 connectors is used on HSL systems. Full-duplex RS-422 with multi-drop The typical RS-422 is not a networking specification. However, HSL modified the specification to suit network applications.
The diagram below illustrates RS-422 with multi-drop: Figure 1-12: HSL wiring – RS-422 with multi-drop X There are two RJ-45 notches in each master. Each notch supports one port of wiring. X Only four lines of the RJ-45 cable are used: two for transmission and two for reception. X All slave modules are connected in parallel. X The isolation between connection cable and individual slave I/O modules protects the signals from interference by other slaves.
1.4.5 Networking Topology Base on the RS-422/RS-485 architecture, a variety of topologies are available for an HSL circuit, including serial, multi-drop, star, etc. The following sections illustrate some applicable network topologies for your reference. Serial wiring All slave I/O modules are connected using a twin-head 100BaseTX cables.
1.4.6 I/O refreshing rate of an HSL system The scan time unit for one slave index is set in 3/6/12 Mbps transmission rate. Once the maximum slave address is set, the polling cycle time of the HSL system is using the following formula: Polling cycle time = maximum-address-of-slave * scan time unit Maximum Cycle Time Cycle Time Cycle Time address under 3 Mbps under 6 Mbps under 12 Mbps 5 303.33 µs 151.67 µs 75.83 µs 10 606.67µs 303.33 µs 151.67 µs 20 1.213 ms 606.67 µs 303.33 µs 30 1.
1.4.7 Communication error handling The HSL communication protocol is designed to eliminate any error, there may be some chances of communication errors such as light striking, sudden off-line, etc. In an HSL system, the master holds an accumulated slave-no-response count for every individual slave I/O module. The count value is updated for each slave module in every polling cycle. X If communication with certain slave I/O module is successful, the no-response count value for this slave is set to 0.
1.5 Software Support Window® 2000/XP DLL The provided Windows® 2K/XP DLL (Dynamic Link Library) is a programming interface for systems using Microsoft® Windows®. The driver works with any Windows® programming language that integrates DLL such as Visual C/C++ (6.0 or above), Borland C++(5.0 or above), or Visual Basic (6.0 or above). Linux Driver The HSL Linux driver includes device drivers and shared library for Linux-based systems.
28 Introducing HSL
2 HSL Master Controller The HSL master is the key component in charge of communicating with slave I/O modules. The master sets output values to and gathers input information from slaves. ADLINK presents four types of HSL master cards: PCI-7853, PCI7854 and PMC-7852, and PMC-7852/G. The main difference between these cards is the number of supported HSL master.
2.2 Specifications PCI Bus X PCI local bus specification Rev. 2.
2.2.
2.2.
X JP1, 2, 3, 6: Full/Half duplex mode with first master controller (Default: Full duplex mode) X JP4, 5: Full/Half duplex mode with second master controller (Default: Full duplex mode) X SW1: Transmission speed option.
2.3 Configuration 2.3.1 SW1 (PMC-7852/G only) Figure 2-4: SW1 – Transmission Rate Setting No. Set transmission rate 1 OFF ON OFF ON 2 OFF OFF ON 3 OFF ON OFF ON 4 OFF OFF ON Rate 12M 6M 3M ON ON 1st Master Controller 2nd Master Controller EXC Default: 6 Mbps. 2.3.2 JP 1, 2, 3, 6 / JP 4, 5 (PMC-7852/G only) Figure 2-5: Top View of PMC-7852/G, for JP 1, 2, 3, 4, 5, 6 jumper settings.
2.
2.5 Software Architecture Description The PCI-7853/PCI-7854/PMC-7852/G comes with one or two HSL master ASICs that control the HSL communication. The purpose of communicating with HSL I/O modules is to gather input data from or set output value to them. To achieve this purpose, each HSL master controller manages a 2Kbyte SRAM on PCI-7853/ PCI-7854 boards for data storage. For every polling cycle, the master refreshes all input data from the I/O modules and sets the latest output data to the I/O modules.
2.6 Installation 2.6.1 Hardware Installation The PCI-7853/PCI-7854 is a plug and play device, with the system BIOS automatically assigning the interrupt channel and memory mapping address. You only need to adjust the SW1 to the desired transmission speed. For PMC-7852/G, refer to GEME user manual for details. 2.6.2 Software Installation Refer to chapter 4.1.
38 HSL Master Controller
3 HSL Slave Module The HSL is a master-slave network system that features an innovative distributed architecture that modularizes the communication, I/O functions and signal termination. ADLINK provides a complete line of slave I/O modules and terminal bases including discrete I/O, analog I/O, and motion control to meet your application requirements. For motion control modules, refer to the HSL4XMO user’s manual. Slave I/O Module. There are three groups of slave I/O modules with varied dimensions.
3.1 Slave I/O Module 3.1.1 Discrete I/O Module ADLINK provides three I/O module series: DB, M and L.
3.1.2 Analog I/O Module ADLINK provides M series analog I/O module. Series M Model Analog Analog Input Output Slave Index Occupation HSL-AI16AO2-M-VV 16 2 2 (Leap number) HSL-AI16AO2-M-AV 16 2 2 (Leap number) 4 2 U HSL-AO4 Below is the selection guide. HSL - AIxAOx - - XY Signal Type: X: Input signal type, V means voltage and A means current. Y: Output signal type, V means voltage.
3.1.4 General Specifications Discrete I/O Module Photo couple isolation 2500 VRMS Input impedance 4.7 kΩ Input Voltage Input Current Discrete Input Operation Voltage (@ 24 VDC Power Supply) Response Time Switch capacity Discrete Output Response Time Relay Type Rating Relay Switching Frequency Response Time +24 V * For NPN(1) For PNP (2) -10 mA +10 mA For NPN(1) ON: 11.4 VDC (max) OFF: 14.3 VDC (min) For PNP(2) ON: 12.6 VDC (min) OFF: 9.8 VDC (max) ON: 8.
*Note: The HSL-DI16-UL supports 5 V, 12 V, and 24 V, selected by a jumper for each channel: X JDI0 - JDI15 (input voltage setting) Input impedance 4.7 kΩ (@24 VDC, 2.74 k (@12 VDC), 1.1 k (@5 VDC) DI_COM @ 24 VDC Discrete Input Operation Voltage DI_COM @ 12 VDC DI_COM @ 5 VDC ON: 14.0 VDC (max) OFF: 18.0 VDC (min) ON: 6.0 VDC (min) OFF: 8.0 VDC (max) ON: 1.0 VDC (min) OFF: 3.
3.1.5 DIP Switch Setting: Notes 44 (1) The address (or slave index) 0 is reserved. (2) The HSL-DI32-M, HSL-DO32-M, HSL-DI32-DB, and HSLDO32-DB require two consecutive addresses starting from an odd number. For example, if the DIP switch is set to 3, it occupies slave index 3 and 4. (3) The HSL-AI16AO2-M-VV/AV requires two leap addresses at full duplex mode. For example, if the DIP switch is set to 2, the module occupies addresses 2 and 4.
3.1.
-P Wet Contact Input v+ IN G LED Internal Circuits -N NPN Sinking Output 46 HSL Slave Module
-P PNP Sourcing Output -R Relay Output LED NO.n Internal Circuit SSR Load COM.
Analog Input (Single-End Voltage Input) Ground Signal Source IN(+) ADC AGND Analog Input (Current Measure) Current Source IN(+) R ADC IN(-) R=125 Ohm %1 accuracy Thermocouple Measurement IN(+) ADC IN(-) <30V AGND 48 HSL Slave Module
Dimension -DB Daughterboard form factor (100 mm X 78.
-U 50 U-series slave I/O module (71.
3.2 Terminal Base Available terminal bases include: X HSL-TB32-U-DIN X HSL-TB64-DIN X HSL-TB32-M-DIN X HSL-TB32-MD Features X Field I/O wiring connection for HSL I/O modules X Screw- or spring-type terminal for easy field wiring X Power and ground connections for each signal channel X Interlocking design for installation in rugged environments X Power LED indicator X DIN rail mounting X Onboard terminator resistor 3.2.
3.2.2 Jumper Settings Since HSL is a serial transmission system, a terminator must be placed at the end of the cable. Each TB has an onboard jumper selectable terminator. The terminator must be enable only by the last module.
3.2.
3.2.4 Dimensions -DB with HSL-TB32-U-DIN (126 mm x 120.1 mm x 107.3 mm) -DB with HSL-TB64-DIN (168.7 mm x 120.1 mm x 107.
-M module with HSL-TB32-M-DIN (128.5 mm x 85.
3.3 HSL-HUB/Repeater Available HSL-HUB/Repeater includes: X HSL-HUB X HSL-Repeater Features X Master to HUB, HUB to HUB, HUB to Slave link styles X Supports T-bracing connection/Star connection (subsystem concept) X Supports up to 2.
3.3.
3.3.
3.4 Managing Slave Index in an HSL Network 3.4.1 Before you proceed Before powering on the slave modules, you have to adjust the DIP switch. For more information, refer to section 3.1.6. Take note of the following: 1. A master controller can connect up to 63 slave indexes. For example, the PCI-7852 has two master controllers. Therefore, it supports a maximum 126 slave indexes. 2. The more compact the slave addresses are in an HSL network, the greater efficiency. 3.
Observe the motion control module rule Module HSL-4XMO-CG-N/P HSL-4XMO-CD-N/P Slave Index Occupation 4 (Leap) / 4(Consecutive) Transmission Transmission Mode Speed Full Duplex / Half Duplex 3/6/12 Mbps Selectable 5. Special rules 60 Z If you will install only one HSL-AI16AO2-M-VV or HSLAI16AO2-M-AV and the DIP switch is set to 1 (HSLAI16AO2-M-VV/AV only supports full duplex mode), the occupied indexes will be 1 and 3.
3.4.2 Examples The following examples are provided for user reference. All modules used are set in full duplex mode. Example 1 Provided you installed two HSL-DI16DO16, two HSL-DI32-MN, and an HSL-AI16AO2-VV with all slave modules in full duplex mode, you can have two conditions as follows: Condition 1: HSL-AI16AO2-VV operates at 6 Mbps. We recommended that you use the provided slave index configuration.
HSL-AI6AO2-M-VV is assigned as 1. Because of the special rule, users have to assign the “max_slave_No” of HSL_start(…) as 3 or call HSL_auto_start by connect_index #1. The illustration below explains this. HSL-DI16DO16 Consequently, the cycle time of the first master controller is 30.33µs x 6 and the cycle time of the second master controller is 45.5 µs at 12 Mbps, full duplex mode.
Example 2 Provided you installed two HSL-DI16DO16-UJ, one HSLDI16DO16-M-NN, two HSL-DO32-M-N, one HSL-AI16AO2-VV, and two HSL-4XMO-CG-N with all slave modules in full duplex mode, you can have the following conditions: Condition 1: The HSL-AI16AO2-VV and two HSL-4XMO-CGN operate in 6 Mbps. We recommended that you use the provided slave index configuration.
and two HSL-4XMO-CG-N modules connect to another master controller. The management table below is for reference. Group 2 DIP Switch Index Occupation in HSL HSL-4XMO-CG-N #1 1 1, 3, 5, 7 HSL-4XMO-CG-N #2 2 2, 4, 6, 8 HSL-AI16AO2-M-VV 9 9, 11 Refer to the illustration below. The cycle time of the first master controller is 30.33µs x 7, while the cycle time of second master controller is 15.17µs x 11 at 12 Mbps, full duplex mode.
4 HSL LinkMaster Utility After installing the master controller and slave modules, you are now ready to install the HSL driver and the LinkMaster utility for system testing and debugging. This utility features a user-friendly interface that enables you to easily test I/O statuses, including read/write the I/O data, calibration and motion control. It is recommended that you use this utility before implementing the whole system.
4.1 Software Installation You can install the HSL drivers from the ADLINK All-in-One CD that comes with the package or you may download the drivers from the ADLINK website. The latest driver version are available from the website. To install the HSL drivers: 1. Locate, then double-click the SETUP.exe file from the All-in-One CD. The installation window appears. Click Next. 2. Follow screen instruction to install. 3. Restart the system when the installation process is completed.
4.2 ADLINK HSL LinkMaster Utility 4.2.1 Launching the LinkMaster Utility After installing the drivers, click Start > PCI-7853 > LinkMaster to launch the LinkMaster utility. The main window appears. 4.2.2 Before you proceed 1. LinkMaster is a testing and debugging program based on VB 6.0 and is only available for Windows® 98/NT/ 2000/XP environments with a monitor that has a screen resolution of 800x600 or higher. The utility does not support DOS environment. 2.
4.2.3 LinkMaster Utility Introduction Below is the LinkMaster main user interface labeled according to function. 68 X A. Select card X B. Network quality test X C. Set hub number (Only for 7853/54) X D. Set duplex mode (Only for 7853/54) X E. Set speed mode (Only for 7853/54) X F. General slave selection X G. Auto scan slave modules X H. Show software information X I.
X J. Test slave module X K. Exit motion creator X L. Version information Below are descriptions of the main interface buttons. 1. Current Select Card ID. When LinkMaster is activated, it searches all HSL master control cards installed in the system, such as PCI-7853, PCI-7854 and PMC-7852/G. Every card shows its index (ID) ranging from 0 to?. You can use this function to specify which card you want to operate. 2. Current Select Connect Index.
4. Connect/Auto Scan. Clicking this button allows the utility to scan all slave modules connected to the master card with specified connect index. The utility shows all the slave modules’ information including the address and slave type within the 9th block. 5. Slaves Disconnect. Click this to stop the utility from scanning all the slave modules and to disconnect them. 6. Status Msg. Checks if the slave modules are connected or disconnected.
4.2.4 HSL-DI16DO16 Utility 1. Slave Address. Shows the slave index occupied by the module. 2. Digital Input. A white circle indicates no digital input; a red icon indicates that the digital input is not activated. 3. Digital Output. Click on the icon to activate the digital output. Red icon indicates that the digital output is turned on, and vice-versa. 4. Slave Status: Shows the communication status between the slave module and the master card. The functions definition are enumerated below.
4.2.5 HSL-DI32 and HSL-DO32 Utility 1. Slave Address. Shows the slave index occupied by the module. These modules occupy two slave indexes starting from an odd number. For example, when you adjust the DIP switch to 3, the modules are assigned indexes 3 and 5. 2. Digital Input. A white circle indicates no digital input; a red icon indicates that the digital input is not activated. 3. Digital Output. Click on the icon to activate the digital output.
4.2.6 HSL-DI8/HSL-DO8/HSL-DI4DO4 Utility 1. Slave Address. Shows the slave index occupied by the module. These modules occupy only one slave index. 2. Digital Input. A white circle indicates no digital input; a red icon indicates that the digital input is not activated. 3. Digital Output. Click on the icon to activate the digital output. Red icon indicates that the digital output is turned on, and vice-versa. 4. Slave Status: Shows the communication status between the slave module and the master card.
4.2.7 HSL-R8DI16 Utility 1. Slave Address. Shows the slave index occupied by the module. These modules occupy only one slave index. 2. Digital Input. A white circle indicates no digital input; a red icon indicates that the digital input is not activated. 3. Digital Output. Click the icon to activate digital output. This function turns the relay ON or OFF. A red circle indicates that the relay is on, and vice versa. 4.
4.2.8 HSL-AI16AO2 Utility 1. Slave Address. Shows the slave index occupied by the module. The module occupies two consecutive indexes. For example, when you adjust the DIP switch to 4, the module obtains slave indexes 4 and 6. 2. Signal Type. Indicates the module’s signal type. 3. Signal Range. Allows selection of the signal range. The utility offers four ranges including ±10V, ±5V, ±2.5V and ±1.25V for HSL-AI16AO2-M-VV. For HSL-AI16AO2-MAV, the signal ranges are 20 mA, 10 mA, and 5 mA. 4.
9. Calibration. Calibrates the module. The modules are shipped with correct calibration. Refer to Appendix C if you want to recalibrate the module. 10.Exit. Closes the utility. 11. Slave Status: Shows the communication status between the slave module and the master card. The functions definition are enumerated below. 4.2.9 Z Bit 0 is Data_Req bit. Z Bit 2 is for CHK1. When Bit2 is equal to 1, a communication error occurred once). Z Bit 3 is for CHK3.
5 HSL Function Library This chapter describes the functions for developing programs in C, C++, or Visual Basic. 5.1 List of Functions This section presents all the functions. The function prototypes and common data types are declared in HSL.h. It is recommended that you use these data types in your application programs. The following table shows the data type names and their ranges.
For the motion control library description, refer to the HSL-4XMO function library manual. This section contains the system level function, discrete I/O control, and analog I/O control. Initialization and System Information, Section 5.
Discrete I/O, Section 5.
Pulse Stretcher Function (HSL-DI16-UL only), Section 5.
5.
HSL_auto_start: Automatically detects the total connected slave modules. Every master controller can connect up to 63 slave indexes. HSL_stop: Stops scanning the connected slave modules. HSL_set_scan_condition: Assigns the scan rate (3/6/12 Mbps) and communication types (full or half duplex). This function needs to be set up between the function HSL_initial and HSL_start.
I16 HSL_get_scan_condition(I16 card_ID, I16 connect_index, I16 *comm_type, I16 *transfer_rate, I16 *hub_number); I16 HSL_connect_status (U16 card_ID, U16 connect_index, U16 slave_No, U8 *sts_data); I16 HSL_slave_live (U16 card_ID, U16 connect_index, U16 slave_No, U8 *live_data); void HSL_get_irq_channel (I16 card_ID, I16 *irq_no); Visual Basic (Windows 98/NT/2K/XP) HSL_initial (ByVal card_ID As Integer) As Integer HSL_close (ByVal card_ID As Integer) As Integer HSL_start (ByVal card_ID As Integer, ByVal co
connect_index: For PCI-7851, the valid value is 0. For PCI7852 and PMC-7852/G, the valid value is 0 or 1. max_slave_No: The maximum slave index connected to the HSL master card with the connect_index. The valid value is from 1 to 63. slave_No: Specifiy the slave module with slave index which want to perform this function. The valid value is from 1 to 63. comm_type: Half or Full duplex 0: Half duplex 1: Full duplex transfer_rate: transfer rate setting 1: 3M 2: 6M 3: 12M hub_number: cascaded Hub number.
@ Return Code ERR_No_Error ERR_Open_Driver_Fail ERR_Invalid_Board_Number ERR_Satellite_Number ERR_Connect_Index HSL Function Library 85
5.
In addition, the values of c1 and c2 must be greater than 1. When c1=0 or c2=0, the timer interrupt stops. HSL_set_int_timer (7853/54 only): Sets up the Timer parameter p1. The timer is used as frequency divider to generate a dedicated constant timer interrupt sampling rate. The formula is: Frequency(Hz) = 48MHz 256 ⋅ ( p1 + 1) HSL_set_int_timer_enable (7853/54 only): Enables or disables the hardware timer interrupt of this master card.
@ Syntax C/C++ (DOS, Windows 98/NT/2000/XP) I16 HSL_set_timer (I16 card_ID, I16 c1, I16 c2); I16 HSL_enable_timer_interrupt (I16 card_ID, HANDLE *phEvent); I16 HSL_disable_timer_interrupt (I16 card_ID); I16 HSL_set_int_timer(I16 card_ID, U16 p1); I16 HSL_set_int_timer_enable(I16 card_ID, I16 enable); I16 HSL_wait_timer_interrupt(I16 card_ID, I32 time_out_ms); Visual Basic (Windows 98/NT/2000/XP) HSL_set_timer (ByVal card_ID As Integer, ByVal c1 As Integer, ByVal c2 As Integer) As Integer HSL_enable_timer_i
The formula is : Frequency(Hz) = 48MHz 256 ⋅ ( p1 + 1) enable: Enables (1) or disables (0) the timer interrupt time_out_ms: Specifies the time-out interval in milliseconds. The function returns if the interval elapses, even if the interrupt is nonsignaled. If time_out_ms is zero, the function tests the Di state and returns immediately. If time_out_ms is -1, the function time-out interval does not elapse (infinite).
5.
Reads the digital input value of the discrete I/O module at a specified channel. HSL_D_write_output: Writes the digital output value of the discrete I/O module. You must specify the connect index and slave index. HSL_D_write_channel_output: Writes the digital output value of the discrete I/O module at the specified channel. HSL_D_read_ouput: Writes all digital output values to all connected discrete I/O modules. This function maps all data into memory.
Type 1: Generates hardware interrupt when any DI data transitions are detected. (Figure 5.1) Figure 5-1: Type 1 Type 2: Generates hardware interrupt when any DI data transitions are detected and when the scan cycle is completed.
Type 3: Generates hardware interrupt when any DI data transitions are detected and when the scan cycle is completed. When interrupt occurrs, the scan pauses until the driver resets the state. Figure 5-3: Type 3 Caution: Scanning is paused while user choice the type3 of renewal type. This pause time depends on the user system performance. Consequently, when using type3, constancy(always keeping scan cycle constant) will not be maintained between scans.
… // start wait ret =HSL_D_wait_di_interrupt(1, 10000); if(ret == ERR_No_Error) { // DI state trainisted and check which bits change states… }else { // time out }… @ Syntax C/C++ (DOS, Windows 98/NT/2000/XP) I16 HSL_D_write_output (I16 card_ID, I16 connect_index, I16 slave_No, U32 out_data); I16 HSL_D_write_channel_output(I16 card_ID, I16 connect_index, I16 slave_No, I16 channel, U16 out_data); I16 HSL_D_read_input (I16 card_ID, I16 connect_index, I16 slave_No, U32 *in_data); I16 HSL_D_read_channel_input (
I16 HSL_D_wait_di_interrupt(I16 card_ID, I32 time_out_ms); Visual Basic (Windows 98/NT/2000/XP) HSL_D_write_output (ByVal card_ID As Integer, ByVal connect_index As Integer, ByVal slave_No As Integer, ByVal out_data As Long) As Integer HSL_D_write_channel_output (ByVal card_ID As Integer, ByVal connect_index As Integer, ByVal slave_No As Integer, ByVal channel As Integer, ByVal out_data As Integer) As Integer HSL_D_read_input (ByVal card_ID As Integer, ByVal connect_index As Integer, ByVal slave_No As Inte
ByVal slave_No As Integer, ByVal bitsOfCheck As Long) As Integer I16 HSL_D_set_int_control(I16 card_ID, I16 connect_index, I16 enable); I16 HSL_D_wait_di_interrupt(I16 card_ID, I32 time_out_ms); @ Argument card_ID: Specifies the HSL master card index. Typically, the board index sequence is assigned by the system. The index starts from 0. connect_index: For PCI-7851, the valid value is 0. For PCI7852 and PMC-7852/G, the valid value is 0 or 1.
*in_data: The input data of slave modules. X For HSL_D_read_input: The data of channel 0 is assigned to bit 0, the data of channel 1 is assigned to bit 1, and so on. X For HSL_D_read_channel_input: The value is the digital input data of the specified channel. X oFor HSL_D_all_slave_index: An unsigned short array pointer. You must create an unsigned short array containing 63 cells. The cell index corresponds to the slave index. For example, cell index 0 corresponds to the module with slave index 1.
enable: Enables (0) or disables (1) the Di interrupt. time_out_ms: Specifies the time-out interval in milliseconds. The function returns if the interval elapses, even when the interrupt is non-signaled. If time_out_ms is zero, the function tests the Di state and returns immediately. If time_out_ms is -1, the function's timeout interval does not elapses (infinite).
5.
HSL_A_set_signal_range: Sets the input range of the specified HSL AI/O modules. HSL_A_get_signal_range: Obtains the input range of the specified HSL AI/O modules. HSL_A_get_input_mode: Obtains the signal input mode of HSL AI/O modules. This is determined by hardware jumper setting. HSL_A_set_last_channel: Sets the last number of analog input channels of HSL AI/O modules. For example, the HSL-AI16AO2 has 16 analog inputs with single-ended wiring.
@ Syntax C/C++ (DOS, Windows 98/NT/2000/XP) I16 HSL_A_start_read (I16 card_ID, I16 connect_index); I16 HSL_A_stop_read (I16 card_ID, I16 connect_index); I16 HSL_A_set_signal_range (I16 card_ID, I16 connect_index, I16 slave_No, I16 signal_range); I16 HSL_A_get_signal_range (I16 card_ID, I16 connect_index, I16 slave_No, I16 *signal_range); I16 HSL_A_get_input_mode (I16 card_ID, I16 connect_index, I16 slave_No, I16 *mode); I16 HSL_A_set_last_channel (I16 card_ID, I16 connect_index, I16 slave_No, I16 last_chann
slave_No As Integer, ByVal signal_range As Integer) As Integer HSL_A_get_signal_range (ByVal card_ID As Integer, ByVal connect_index As Integer, ByVal slave_No As Integer, signal_range As Integer) As Integer HSL_A_get_input_mode (ByVal card_ID As Integer, ByVal connect_index As Integer, ByVal slave_No As Integer, mode As Integer) As Integer HSL_A_set_last_channel (ByVal card_ID As Integer, ByVal connect_index As Integer, ByVal slave_No As Integer, ByVal last_channel As Integer) As Integer HSL_A_get_last_cha
@ Argument card_ID: Specifies the HSL master card index. Typically, the system assigns the board index sequence. The index starts from 0. connect_index: For PCI-7851, the valid value is 0. For PCI7852 and PMC-7852/G, the valid value is 0 or 1. slave_No: Specifies the slave module with slave index that wants to perform this function. The valid value is 1 to 63. signal_range: The single range of analog input setting. For HSL-AI16AO2-M-VV 0: ± 1.25 V 1: ± 2.
last_channel: For single-ended setting, the maximum last channel is 15. For differential setting, the maximum last channel is 7. *last_channel: You can get the last channel depending on what you set previously. For single-ended setting, the maximum last channel is 15. For differential setting, the maximum last channel is 7. ai_channel: Specifies the AI channel of the slave module that wants to perform this function. The valid value is described as follows.
5.6 Pulse Stretcher Function (HSL-DI16-UL Only) @ Name HSL_D_set_di_latch_function – Set DI latch function for a specified DI channel HSL_D_set_di_latch_functionA – Set DI latch function for all DI channels HSL_D_get_di_latch_function – Get DI latch function for a specified DI channel @ Description HSL_D_set_di_latch_function: The DI-latch function can be set for one single channel by this function. Note that when this function is executing, it will disable the Di input signal, and the Di state is unknown.
I16 HSL_D_get_di_latch_function(I16 card_ID, I16 connect_index, I16 slave_No, I16 channel, I16 * active_mode, I16 *duration); Visual Basic (Windows 98/NT/2K/XP) HSL_D_set_di_latch_function (ByVal card_ID As Integer, ByVal connect_index As Integer, ByVal slave_No As Integer, ByVal channel As Integer, ByVal active_mode As Integer, ByVal duration As Integer) As Integer HSL_D_set_di_latch_functionA (ByVal card_ID As Integer, ByVal connect_index As Integer, ByVal slave_No As Integer, ByVal active_mode As Intege
@ Return Code ERR_Invalid_Board_Number ERR_Connect_Index ERR_Satellite_Number ERR_Board_No_Init ERR_Channel_Number ERR_Slave_Number ERR_Set_Di_Latch_Failed ERR_Di_Latch_time ERR_No_Error HSL Function Library 107
108 HSL Function Library
6 How to Program with HSL Function Library This chapter describes how to create a program with HSL C library using a flow chart. The C library supports Windows and Redhat Linux platforms. 6.1 Programming with HSL DLL The programming flow chart illustrates the program creation with HSL DLL. Figure 6-1: Programming Flow 6.1.1 DIO Operation Inside DI/O Operation, the following function calls are for users’ reference. HSL_slave_live (…): Detects the status of the slave module (live or die).
HSL_connect_status(…): Detect the communication status of the slave module. HSL_D_read_input(…) HSL_D_read_channel_input(….) HSL_D_read_all_slave_input(….) Functions for the digital input operation of slave modules. HSL_D_write_output(…) HSL_D_write_channel_output(…) HSL_D_write_output(…) Functions for the digital output operation of slave modules. HSL_D_read_output(…) Reads the output data in memory. HSL_D_set_input_logic(…) HSL_D_set_output_logic(…) Functions for setting the DIO logic.
3. Use HSL_A_start_read(…) to initialize the AIO channels reading operation. 4. After activating the HSL AD conversion, use these functions for the HSL operation. HSL_slave_live(…) Detects the status of the slave module(Live or Die). HSL_connect_status(…) Detects the communication status of the slave module. HSL_A_read_input(…) Function for analog value reading operation of the slave modules. HSL_A_write_output(…) Function for analog value writing operation of the slave modules.
112 How to Program with HSL Function Library
Appendix A Scan Time Table A.1 Full Duplex Mode Slave Index Cycle Time Cycle Time Cycle Time Number under 3 Mbps under 6 Mbps under 12 Mbps Base Unit 60.67 µs 30.33 µs 15.17 µs < 3(*) 182.00µs 91.00 µs 45.50 µs 5 303.33 µs 151.67 µs 75.83 µs 10 606.67µs 303.33 µs 151.67 µs 20 1.213 ms 606.67 µs 303.33 µs 30 1.820 ms 910.00 µs 455.00 µs 40 2.427 ms 1.213 ms 606.67 µs 50 3.033 ms 1.516 ms 758.33 µs 60 3.640 ms 1.820 ms 910.00 µs 63 3.822 ms 1.911 ms 955.
A.2 Half Duplex Mode Slave Index Cycle Time Cycle Time Cycle Time Number under 3 Mbps under 6 Mbps under 12 Mbps Base Unit 118 µs 59 µs 29.5 µs < 3(*) 354 µs 177 µs 88.5 µs 5 590 µs 295 µs 147.5 µs 10 1.180 ms 590 µs 295 µs 20 2.360 ms 1.180 ms 590 µs 30 3.540 ms 1.770 ms 885 µs 40 4.720 ms 2.360 ms 1.180 ms 50 5.900 ms 2.950 ms 1.475 ms 60 7.080 ms 3.540 ms 1.770 ms 63 7.434 ms 3.717 ms 1.
Appendix B Mapping Table HSL has two types of function library in the HSL.h. The following is the mapping table for new and old versions of the codes. B.1 Initialization and System Information New Version Old Version HSL_initial W_HSL_Initial HSL_close W_HSL_Close HSL_start W_HSL_Start HSL_auto_start W_HSL_Auto_Start HSL_stop W_HSL_Stop HSL_connect_status W_HSL_Connect_Status HSL_slave_live W_HSL_Slave_Live HSL_get_irq_channel W_HSL_Get_IRQ_Channel B.
B.3 Discrete I/O New Version Old Version HSL_D_read_input W_HSL_DIO_In HSL_D_read_channel_input W_HSL_DIO_Channel_In HSL_D_write_output W_HSL_DIO_Out HSL_D_write_channel_output W_HSL_DIO_Channel_Out HSL_D_read_ouput W_HSL_Read_DIO_Out HSL_D_read_all_slave_input W_HSL_DIO_Memory_In HSL_D_write_all_slave_output W_HSL_DIO_Memory_Out HSL_D_set_input_logic HSL_D_set_output_logic W_HSL_Set_In_Out_Logic B.
Appendix C HSL-AI16AO2 Calibration C.1 Before you proceed Before calibrating the HSL-AI16AO2-M-VV and HSL-AI16AO2-MAV, take note of the following: 1. Make sure that the signal type is single-ended. You may set this via the jumper. 2. Use a precise calibrator that can generate a precise 5 V. 3. Check the status text to know if the calibration is successful or not. 4. Refer to the analog input field configuration below.
C.2 Calibrating the modules To calibrate the modules: 1. Press the Calibration button from the HSL-AI16AO2 utility. A dialog box appears. 2. Connect AI channel 1 to AGND. The AI channel index is from 0 to 15. Take note of the index. After wiring, press the AI Offset Calibration button. 3. Connect AI channel 0 to the calibrator, then, press the AI Span Calibration button. 4. Connect AI channel 12 to AO channel 0, and AI channel 14 to AO channel 1, then press the AO Offset Calibration button. 5.
Appendix D HSL-HUB/Repeater Information D.1 Recommended transfer rates, total extension distance, and number of installed HSL-HUB/Repeater Transmission rate Number of inserted Hubs (Repeater) Basic configuration 1 2 3 4 5 6 7 3Mbps 300 m 600 m 900 m 1.2 km 1.5 km 1.8 km 2.1 km 2.4 km 6Mbps 200 m 400 m 600 m 800 m 12Mbps 100 m 200 m 300 m 400 m 500 m 600 m 700 m 800 m 1 km 1.2 km 1.4 km 1.6 km D.2 Scan time table D.2.
D.2.2 Full duplex/6 Mbps Slave Index Number Number of inserted Hubs (Repeater) 3 (Min.) 30 63 (max) Basic configuration (0) 91.00 us 910.00 us 1911.00 us 1 164.00 us 1640.00 us 3444.00 us 2 236.00 us 2360.00 us 4956.00 us 3 308.00 us 3080.00 us 6468.00 us 4 380.00 us 3800.00 us 7980.00 us 5 452.00 us 4520.00 us 9492.00 us 6 524.00 us 5240.00 us 11004.00 us 7 596.00 us 5960.00 us 12516.00 us D.2.
D.2.4 Half duplex/12 Mbps Slave Index Number Number of inserted Hubs (Repeater) 1 (Min.) 30 63 (max) Basic configuration (0) 29.50 us 885.00 us 1858.50 us 1 39.33 us 1180.00 us 2478.00 us 2 51.33 us 1540.00 us 3234.00 us 3 63.33 us 1900.00 us 3990.00 us 4 75.33 us 2260.00 us 4746.00 us 5 87.33 us 2620.00 us 5502.00 us 6 99.33 us 2980.00 us 6258.00 us 7 111.33 us 3340.00 us 7014.00 us D.2.5 Half duplex/6 Mbps Slave Index Number Number of inserted Hubs (Repeater) 1 (Min.
122 HSL-HUB/Repeater Information
Warranty Policy Thank you for choosing ADLINK. To understand your rights and enjoy all the after-sales services we offer, please read the following carefully. 1. Before using ADLINK’s products please read the user manual and follow the instructions exactly. When sending in damaged products for repair, please attach an RMA application form which can be downloaded from: http:// rma.adlinktech.com/policy/. 2.
3. Our repair service is not covered by ADLINK's guarantee in the following situations: X Damage caused by not following instructions in the User's Manual. X Damage caused by carelessness on the user's part during product transportation. X Damage caused by fire, earthquakes, floods, lightening, pollution, other acts of God, and/or incorrect usage of voltage transformers. X Damage caused by unsuitable storage environments (i.e. high temperatures, high humidity, or volatile chemicals).