PEP Modular Computers Modular Computers RS485 User Manual

8 channel ac input unit micro plcs and real-time computers
Table of Contents

Advertisement

SMART I/O User's Manual
8 Channel AC Input Unit
Micro PLCs and Real-Time Computers
Manual ID 09901, Rev. Index 0500 of 08 Jan. 98

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Modular Computers RS485 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for PEP Modular Computers Modular Computers RS485

  • Page 1 SMART I/O User’s Manual 8 Channel AC Input Unit Micro PLCs and Real-Time Computers Manual ID 09901, Rev. Index 0500 of 08 Jan. 98...
  • Page 2 This page was intentionally left blank.
  • Page 3: Table Of Contents

    Preface Preface Revision History ... 0-4 For Your Safety ... 0-5 Special Handling and Unpacking In- structions ... 0-6 HV Safety Instructions ... 0-6 Two Years Warranty... 0-7 Table of Contents ... 0-9 08 Jan. 98 Manual ID 09901, Rev. Index 0500 SMART I/O User’s Manual Page 0 - 3...
  • Page 4: Revision History

    Preface Revision History Manual/Product Title: SMART I/O User’s Manual Manual ID Number: 09901 Rev. Brief Description of Changes Index 0100 Initial Issue 0200 General Update, SM-DAD1 & Software Library Added 0300 New MS Modules Added, D5 Format 0400 New MS Modules Added, Corrections Including Update of SM-DAD1 ’C’...
  • Page 5: For Your Safety

    SMART I/O User’s Manual For your safety This PEP product is carefully designed for a long, fault-free life. However, its life expectancy can be drastically reduced by improper treatment during unpacking and installation. Therefore, in the interest of your own safety and of correct operation of your new PEP product, please take care of the following guidelines: Before installing your new PEP product into a system, please, always...
  • Page 6: Special Handling And Unpacking Instructions

    Preface Special Handling and Unpacking Instructions Electronic boards are sensitive to static electricity. Therefore, care must be taken during all handling operations and inspections with this product, in order to ensure product integrity at all times. Do not handle this product out of its protective enclosure while it is not being worked with, or unless it is otherwise protected.
  • Page 7: Two Years Warranty

    SMART I/O User’s Manual Preface Two Years Warranty PEP Modular Computers grants the original purchaser of PEP products a as described in the following. How- YEARS LIMITED HARDWARE WARRANTY ever, no other warranties that may be granted or implied by anyone on behalf of PEP are valid unless the consumer has the expressed written consent of PEP Modular Computers.
  • Page 8 Preface SMART I/O User’s Manual goodwill, and will be defined in the “Repair Report” issued by PEP with the repaired or replaced item. PEP Modular Computers will not accept liability for any further claims result- ing directly or indirectly from any warranty claim, other than the above speci- fied repair, replacement or refunding.
  • Page 9: Table Of Contents

    SMART I/O User’s Manual Table of Contents Chapter General Information ... 1-3 1.1 Product Overview ... 1-8 1.2 Ordering Information ... 1-9 1.3 Product Information ... 1-10 1.4 Installation ... 1-13 1.5 ISaGRAF Installation ... 1-18 Chapter SMART-BASE ... 2-3 2.1 Specifications ...
  • Page 10 Preface 2.5 Pinouts ... 2-9 2.6 ‘C’ Programming ... 2-17 2.7 ISaGRAF Programming ... 2-32 2.8 Flash Utility ... 2-37 Chapter SMART-EXT ... 3-3 3.1 Specifications ... 3-3 3.2 Board Overview ... 3-4 3.3 Functional Description ... 3-5 3.4 Pinouts ... 3-6 Chapter Digital Modules ...
  • Page 11 SMART I/O User’s Manual 4.3 SM-REL1... 4-33 4.4 SM-ACI1... 4-51 Chapter Analog Modules ... 5-7 5.1 SM-DAD1 ... 5-7 5.2 SM-PT100 ... 5-29 5.3 SM-THERM ... 5-59 5.4 SM-ADC1 ... 5-89 5.5 SM-DAC1 ... 5-107 Chapter Communications Modules ... 6-5 6.1 SM-RS232...
  • Page 12 This page was intentionally left blank.
  • Page 13 Introduction Table of Contents General Information...1-3 Weights & Measures ... 1-4 1.1 Product Overview ... 1-8 1.2 Ordering Information ... 1-9 1.3 Product Information ... 1-10 1.4 Installation ... 1-13 1.4.1 Overview ... 1-13 1.4.2 SMART I/O Module Installation ... 1-15 1.4.3 RJ45 Telephone Connector Installation ...
  • Page 14 Introduction SMART I/O User’s Manual This page has been left blank intentionally. March 12, 1996 Page 1 - 2 ©1996 PEP Modular Computers GmbH...
  • Page 15: General Information

    Introduction General Information All PEP products are intended for use in industrial climates where extreme environments exist. Dirt, temperature extremes, varying humidity levels, vibration, noise, shock and electromagnetic signals must all be considered. Only when certain precautions have been followed can PEP guarantee the performance of the product stated in the data sheet.
  • Page 16: Weights & Measures

    Weights & Measures The following line drawings serve to illustrate the method of fixing the controller to a DIN rail or brackets for wall/cabinet mounting. Note that all measurements are in millimetres. Page 1 - 4 ©1996 PEP Modular Computers GmbH DIN Rail Mounting March 12, 1996...
  • Page 17 Introduction SMART I/O User’s Manual Optional Bracket Mounting March 12, 1996 ©1996 PEP Modular Computers GmbH Page 1 - 5...
  • Page 18 Introduction SMART I/O User’s Manual March 12, 1996 Page 1 - 6 ©1996 PEP Modular Computers GmbH...
  • Page 19 Introduction SMART-BASE 650g SMART-EXT 250g SM-DIN1 SM-DOUT1 SM-REL1 SM-DAD1 SM-PT100 March 12, 1996 SMART I/O User’s Manual Unit Weight Unit SM-THERM SM-ADC1 SM-DAC1 SM-SSI SM-CNT1 SM-RS232 ©1996 PEP Modular Computers GmbH Weight Page 1 - 7...
  • Page 20: Product Overview

    1.1 Product Overview SMART I/O is based on a cost effective open system for industrial automa- tion and industrial computing. By programming the SMART I/O using the standard ISaGRAF workbench for IEC 1131-3 PLC programming languages and the Ultra-C compiler (DOS, OS-9) for ANSI-C real-time programming, the SMART I/O can be used as a micro PLC and as a real-time computer system.
  • Page 21: Ordering Information

    Introduction 1.2 Ordering Information Product Micro PLC & real-time computer, 1 MByte EPROM, 512 kByte DRAM, 64kByte SRAM, OS-9 v3.0, ISaGRAF v3.0x, PROFIBUS v3.12, Layer SMART-BASE 2 & 7, RTC, full modem RS232 (8-pin RJ45 connector), 190 mAh battery, housing and terminal block for the 24V DC power supply As product 13843 but with additional 1 MByte Flash memory (TSOP) on SMART-BASE solder side...
  • Page 22: Product Information

    Product ROM kit v3.x for SMART I/O enables the generation of custom ISaGRAF- firmware EPROMs. Platform can be a PC or OS-9 development ROM-START system OS9TRG-RG- Target CPU kit for SMART I/O (OS-9 v3.x/Ix.x disks) SMART OS-9/68000 FasTrak for Windows development pack for SMART I/O. OS9DEVFT- Contains extended OS-9 v3.x/Ix.x, PEP utilities and I/O drivers with WIN-SMART...
  • Page 23 Introduction The attachment of both units is achieved by sliding them over the DIN rail with the clip assembly pulled out and then releasing it when correctly posi- tioned. The 24V supply source should possess the following characteristics: Because of power limitations, it should be noted that although up to 11 SMART-Modules are possible in a complete configuration, attention should be paid to the following tables that show the individual component power requirements.
  • Page 24 An on-board fuse protects the 24V DC input circuitry from damage through higher voltages than those expected or AC voltages being inadvertently applied to the system. This fuse, should it be assumed defect (the Power In LED on the housing will not be illuminated), may be accessed by removing the cover of the SMART-BASE and accessing the holder on the left-hand side as shown in the illustration below.
  • Page 25: Installation

    Introduction SMART I/O User’s Manual 1.4 Installation 1.4.1 Overview The SMART-BASE and SMART-EXT units are supplied without screw terminal blocks for the I/O slots, SMART Module piggybacks or blank panels. These must be ordered separately to meet the requirements of indi- vidual specifications.
  • Page 26 Introduction SMART I/O User’s Manual Up to 4 SMART-EXT units can be cascaded depending on the power con- sumption of the individual SMART Modules. SMART I/O Modules or blank panels must be ordered separately to the SMART-BASE or SMART-EXT units. Blank panels come in packs of 20. Two RS232 cables are available.
  • Page 27: Smart I/O Module Installation

    Introduction SMART I/O User’s Manual Screw terminal connectors are available in packs of 5. 1.4.2 SMART I/O Module Installation The SMART I/O Modules are fitted into the relevant sockets (ST1 - ST6; 3 slots) on the SMART-BASE or in sockets on the SMART-EXT unit. It is important that the Modules are inserted the correct way.
  • Page 28: Rj45 Telephone Connector Installation

    Introduction SMART I/O User’s Manual 1.4.3 RJ45 Telephone Connector Installation The RJ45 connector is fitted into the RS232 Telephone connector (BU1) on the SMART-BASE. This is illustrated in the Figure below. Figure 1.4.3.1 : RJ45 Telephone Connector Installation SMART-BASE SCR2 RJ45 Connector 1.4.4 Screw Terminal Block Installation The Screw Terminal Blocks are easily fitted to the SMART-BASE or...
  • Page 29: Battery Installation

    Introduction 1.4.5 Battery Installation The battery piggyback SMPBBAT is fitted into the socket BU3 on the SMART-BASE. It is important that the piggyback is inserted in the correct way. The figure below illustrates this procedure. Figure 1.4.5.1: Battery Piggyback Installation Battery Type Battery Capacity Typical Data Retention Time *140 Days...
  • Page 30: Isagraf-Installation

    1.5 ISaGRAF-Installation 1.5.1 Before Installing ISaGRAF is a Windows™ 3.xx based software development tool requiring a minimum of 10 MB of hard disk space and 4 MB of available memory. Before installing ISaGRAF, make a backup copy of each DOS disk in the package and write-protect them to prevent accidental overwriting of files.
  • Page 31: Installation Of The Isagraf For Windows Workbench

    Introduction SMART I/O User’s Manual 1.5.2 Installation of the ISaGRAF for Windows Workbench The following steps should be followed to ensure successful installation of the ISaGRAF software. Initially the disk labelled Workbench Disk 1/4 will be required. • Start Windows •...
  • Page 32 Introduction SMART I/O User’s Manual Having checked the installation directory (default is C:\ISAWIN) and selected Install, the program progresses by asking whether the complete system should be installed or just certain sections. The selection possibilities are shown in figure 1.5.2.2. Figure 1.5.2.2 Installation Selection The default is for a complete installation, i.e.
  • Page 33: Installation Of Pep Library Functions

    Introduction SMART I/O User’s Manual Figure 1.5.2.3 ISaGRAF Program Group 1.5.3 Installation of PEP Library Functions The library functions are adapted to suit the SMART I/O and other PEP products and should be installed using the two diskettes labelled LIB/ APPLI/HELP.
  • Page 34 These libraries for projects, I/O boards, ’C’ functions and common data are extracted by following the described procedure: • Start Windows if not already started • Insert diskette Lib/Appli/Help Disk 1/2 into the floppy drive • Select File from the Windows Program Manager and select Run ... •...
  • Page 35 Introduction SMART I/O User’s Manual It should be noted that the standard ISA-Terminal is configured for COM2. If another port is required then the switch to the new one is made by firstly starting the ISA-Terminal program and then selecting the Settings from the Communication pull-down menu.
  • Page 36 In order to verify that the hardware and software have been correctly setup, the following procedure should be followed. • Connect the D-Sub connector end of the terminal cable to the chosen COM port of the computer. The other end, with the telephone type connector should be pushed into place in the RS232-port of the SMART I/O base (see figure 1.4.3.1) •...
  • Page 37 Introduction The error messages that are shown in figure 1.5.3.2 are normal as the system is trying to create files or directories in the RAM disk that are already present. If no further messages appear, then the installation is complete. Should the terminal result in anything different than shown then check through the installation steps again before contacting PEP for help.
  • Page 38: Demo Application

    1.5.4 Demo Application Several demonstration applications are delivered with the ISaGRAF set of disks and are installed automatically. The applications suitable for use with the SMART I/O are prefixed SM- and serve to show how the SMART I/O can be used through practical examples. Two such programs, the SM- DEMO1 and 2 are discussed here : SM_DEMO1 should be used if the SMART I/O has the SM_DOUT1 module in the first of the SMART Module slots and has SM_DIN1 in slot 2...
  • Page 39 Introduction SMART I/O User’s Manual • Finally, from the Files/Download pull-down menu, select Motorola Target Code. The chosen SM_DEMO will be downloaded to the SMART I/O (target system) and the application will begin automatically. This is a simple SFC-program which will activate channel 7 of the SM- DOUT1 when the first SFC-step (init) is encountered thereby illuminating the diode.
  • Page 40 Introduction SMART I/O User’s Manual This page has been left blank intentionally. March 12, 1996 Page 1 - 28 ©1996 PEP Modular Computers GmbH...
  • Page 41 Chapter 2 SMART-BASE Table of Contents 2. SMART-BASE...2-3 2.1 Specifications ... 2-4 2.2 Board Overview ... 2-5 2.3 Functional Description ... 2-6 2.4 Configuration ... 2-8 2.4.1 Jumper J1: Boot Selection (Pin Connector) ... 2-8 2.4.2 Jumper J6: LED Function (Pin Connector) ... 2-9 2.5 Pinouts ...
  • Page 42 2.7 ISaGRAF Programming ... 2-32 2.7.1 The ISaGRAF Board Parameters ... 2-32 2.7.2 The ISaGRAF Operate Calls ... 2-33 2.8 Flash Utility ... 2-37 Page 2 - 2 ©1996 PEP Modular Computers GmbH March 12, 1996...
  • Page 43: Smart-Base

    Chapter 2 SMART-BASE SMART I/O User’s Manual 2. SMART-BASE The SMART-BASE is the main unit to which up to three SMART-Modules may be connected to fulfil a given I/O task with I/O enhancement being provided through the connection of a SMART-EXT unit which itself may accommodate up to 2 SMART-Modules.
  • Page 44: Specifications

    2.1 Specifications Nominal Input Voltage Input Voltage Range Input Current Main Output Voltage Auxiliary Output Voltage Switching Frequency Main Output Ripple Max. Efficiency Galvanic Isolation EPROM or FLASH* FLASH* DRAM SRAM EEPROM Galvanic Isolation Temperature Range - Storage - Operating - Extended Operating Humidity Weight...
  • Page 45: Front View

    Chapter 2 SMART-BASE 2.2 Board Overview Front view RS485 Isolated (PROFIBUS) DC/DC Battery Piggyback SMPBBAT 24V DC RS232 SCR2 Rear View March 12, 1996 SMART I/O User’s Manual DRAM EPROM/FLASH 68302FC20 EPROM/FLASH (SRAM) I/O Slot #0 Timer SCR1 SCR5 RTC Quartz Optional FLASH ©1996 PEP Modular Computers GmbH...
  • Page 46: Functional Description

    2.3 Functional Description Figure 2.3.0.1: SMART I/O Block Diagram Clock Generators Serial Interfaces RS485 RS232 I/O Controller DC/DC Timer/Counter The MCU, an MC68302 microprocessor operating at 20 MHz is responsible for handling all communication between the various interfaces and on-board memory.
  • Page 47 Chapter 2 SMART-BASE SMART I/O User’s Manual The isolated DC/DC converter is based on a switched mode regulating system operating at 100 kHz and supplies power to both the system and the isolated RS485 (PROFIBUS) interface. The SPI interface, a 3-wire communication protocol providing SCLK, RxD and TxD is embedded within a larger 10-wire interface for handling commu- nication between the base unit and SMART-Modules attached either directly or on extension units.
  • Page 48: Configuration

    2.4 Configuration The SMART BASE has 2 configurable jumpers which are explained in the following sections. The jumper settings marked in italics in the tables are default. Figure 2.4.0.1: SMART BASE Jumper Layout (Front View) RS485 Isolated (PROFIBUS) DRAM EPROM/FLASH DC/DC EPROM/FLASH Battery...
  • Page 49: Jumper J6: Led Function (Pin Connector)

    Chapter 2 SMART-BASE 2.4.2 Jumper J6: LED Function (Pin Connector) This jumper selects the function of the red LED; halt or user defined. The user defined function that is supported in software will only take effect if this jumper is set accordingly. Jumper J6 2.5 Pinouts Figure 2.5.0.1: SMART-BASE Connector Overview...
  • Page 50: Smart Module Piggyback Connectors

    Slot# numbers are counted from #0 up to #10 while the ISaGRAF logic counts from #1 to #11! 2.5.1 SMART Module Piggyback Connectors There are three sets of SMART Module piggyback connectors available on the SMART-BASE, each divided into two sets of 2x8 standard pin rows. Pinouts digital side (ST1, ST3 and ST5) SMART-Module location #0 (ST5) pinouts Pin Nr.
  • Page 51 Chapter 2 SMART-BASE SMART-Module location #2 (ST1) pinouts Pin Nr. Signal PITA0 I/O Controller Port A0 PITA2 I/O Controller Port A2 PITA4 I/O Controller Port A4 PITA6 I/O Controller Port A6 System GND GND System VCC 5V VCC CS-SM3 Port Select (Module 2) Reset Reset (Power ON/OFF) Pinouts process side (ST6, ST4 and ST2) for Modules #0 to #2...
  • Page 52: Screw Terminal Pinouts

    2.5.2 Screw Terminal Pinouts The following shows the pinout for a screw terminal block suited for use with SMART-Modules. The pinouts of these blocks depends on the SMART Modules that are fitted. Pin 1 2.5.3 Timer I/O Screw Terminal (SCR1) Pin Nr.
  • Page 53 Chapter 2 SMART-BASE To understand the functionality of the counter/timer, it is necessary to understand the purpose of TIN, TOUT and TGATE. Figure 2.5.3.1 shows the block diagram of TIN. Figure: 2.5.3.1 Timer I/O (TIN) Schematic +Vcc (24V) Gnd (common) +Vcc (24V) Gnd (common) The I/O Controller timer is used for the generation of the TOUT and TIN...
  • Page 54: Supply Screw Terminals (Scr2)

    Figure 2.5.3.2 shows the TOUT block diagram. Here, the output is only active when an interrupt on level 4 has been acknowledged by the I/O controller or a previously set timer has decremented to 0. The driving stage of the output consists of a Darlington connected transistor pair protected from inductive loads by a clamp diode.
  • Page 55: Rs232 Telephone Connector (Bu1)

    Chapter 2 SMART-BASE 2.5.5 RS232 Telephone Connector (BU1) In order to meet the needs of widespread standards, the RS232 connector is selected as a telephone connector, an 8-pin RJ12 telephone jack with full MODEM support. Pin Nr. System GND System GND 2.5.6 RS485 D-Sub Connector (BU2) for Half-Duplex Operation (Profibus) Pin Nr.
  • Page 56: Spi Connector (St7)

    The full-duplex description may be found in the SMART-I/O Advanced User’s Guide. There is no internal line termination as laid down in DIN 19245 Part 1 and must be performed externally. The line termination is achieved as shown in the figure. Assuming a power supply voltage of +5V emanating from the PROFIBUS connector (pin 6), the following resistor values are recommended.
  • Page 57: C' Programming

    Chapter 2 SMART-BASE 2.6 ‘C’ Programming 2.6.1 SMART-BASE Library The SMART-BASE library of functions smartio.l provide a convenient way of accessing various features of the SMART-BASE. • All functions are written in ANSI C; • Prototypes are to be found in the file BSP/SMART/DEFS/SMAC.h. Hardware Requirements •...
  • Page 58: Smtselin

    2.6.2 SMTselIn Syntax error_code SMTselIn(u_int8 mode); Description This function selects one of four possible counter/timer input (TIN) configu- rations utilizing the 6MHz internal counter/timer clock. Input u_int8 mode Page 2 - 18 ©1996 PEP Modular Computers GmbH This represents the four input configurations. They are: The Simple I/O/TIN input pin carries MODE00...
  • Page 59 Chapter 2 SMART-BASE Output error_code Example RetVal = SMTselIn(MODE00); The counter/timer contains a 24-bit synchronous down counter that is loaded from three 8-bit counter preload registers. The 24-bit counter may be clocked by the output of a 5-bit (divide by 32) prescaler or by an external timer input (TIN).
  • Page 60: Smtsettout

    2.6.3 SMTsettout Syntax error_code SMTsettout(u_int8 mode); Description This function sets the timer output (TOUT) control. Input u_int8 mode Output error_code Example RetVal = SMTsettout(MODE_SQUARE); The high state of TOUT illustrated in the above diagram shows that the output is deactivated i.e. OFF. Only when TOUT is in the low state can a load be driven.
  • Page 61: Smtpre

    Chapter 2 SMART-BASE 2.6.4 SMTpre Syntax error_code SMTpre(u_int32 *value); Description This function reads / sets the timer preload register. Input u_int32 *value Output error_code Example RetVal = SMTpre(0); March 12, 1996 SMART I/O User’s Manual Pointer to a variable that holds the value to set. The previous value is returned to the variable.
  • Page 62 Example for a Square Wave Generator The Timer Control Register TOUT/TIAC Control In this configuration, the timer produces a square wave at the TOUT pin which is connected to the user’s circuitry. The TIN pin may be used as a clock input.
  • Page 63: Smtstasto

    Chapter 2 SMART-BASE 2.6.5 SMTstasto Syntax error_code SMTstasto(u_int8 mode); Description This function starts / stops the timer; the zero-detect control bit is set at the start; the counter rolls over on reaching zero or is loaded with the value set in the preload register and continues counting down.
  • Page 64: Smtrd

    2.6.6 SMTrd Syntax error_code SMTrd(u_int32 *value); Description This function reads the actual timer count value. A stable read value can only be achieved if the timer is not running. There- fore, a read request to the running timer terminates with E_DEVBSY. Input u_int32 *value Output...
  • Page 65: Smttin

    Chapter 2 SMART-BASE 2.6.7 SMTtin Syntax error_code SMTtin(u_int8 *value); Description This function reads the current level present on TIN/PC2. Input u_int8 *value Output error_code Example RetVal = SMTin(buffer); March 12, 1996 SMART I/O User’s Manual Pointer to a variable in which to place the read value.
  • Page 66: Smtstat

    2.6.8 SMTstat Syntax error_code SMTstat(u_int8 *value); Description This function reads the timer status register and clears it if set. Input u_int8 *value Output error_code Example RetVal = SMTstat(buffer); Description of the Timer Status Register (TSR) • • The timer status register contains one bit from which the zero detect status can be determined.
  • Page 67: Smtout

    Chapter 2 SMART-BASE 2.6.9 SMTout Syntax error_code SMTout(u_int8 *value); Description This function reads the actual status of the TOUT pin. Input u_int8 *value Output error_code Example RetVal = SMTout(buffer); March 12, 1996 SMART I/O User’s Manual Pointer to a variable in which to place the read value.
  • Page 68: Smled

    2.6.10 SMLed Syntax error_code SMLed(u_int8 led, u_int8 value); Description This function switches on / off user LED’s. Input u_int8 led u_int8 value Output error_code Example RetVal = SMLed(USERL1, 0); Page 2 - 28 ©1996 PEP Modular Computers GmbH Two options are available. They are: Yellow LED on piggyback USERL1 Red LED on piggyback (only...
  • Page 69: Smwdon

    Chapter 2 SMART-BASE 2.6.11 SMwdon Syntax error_code SMwdon(u_int32 *time); Description This function activates the watchdog timer of the 68302. If timeout is reached, the system is reset; in normal operating mode, this must be avoided by periodically triggering the watchdog using the function SMwdtrig. Input u_int32 *time Output...
  • Page 70: Smwdtrig

    2.6.12 SMwdtrig Syntax error_code SMwdtrig(void); Description This function re-triggers the watchdog of the 68302 preventing a timeout and subsequent system reset. Output error_code Example RetVar = SMwdtrig(); Page 2 - 30 ©1996 PEP Modular Computers GmbH SUCCESS or standard OS-9 error code (refer to the OS-9 Technical Manual Error Codes Section).
  • Page 71: Smwdoff

    Chapter 2 SMART-BASE 2.6.13 SMwdoff Syntax error_code SMwdoff(void); Description This function deactivates the watchdog timer. Output error_code Example RetVar = SMwdoff(); March 12, 1996 SMART I/O User’s Manual SUCCESS or standard OS-9 error code (refer to the OS-9 Technical Manual Error Codes Section). ©1996 PEP Modular Computers GmbH Page 2 - 31...
  • Page 72: Isagraf Programming

    2.7 ISaGRAF Programming 2.7.1 The ISaGRAF Board Parameters Information on board parameters may be found in the PEP online help and ISaGRAF online help or user’s manual. Figure 2.7.1.1 Typical Screen Section for the SMART-BASE Because the communication to the timer/counter is performed using Operate Calls, there is no need for manual selection of such things as a logical address etc.
  • Page 73: The Isagraf Operate Calls

    Chapter 2 SMART-BASE SMART I/O User’s Manual 2.7.2 The ISaGRAF Operate Calls Operate calls are built into a program using ST or FBD languages when defining the project. A typical use could be at the initialization stage to check that the SMART-Modules are in fact located where they have been programmed to be.
  • Page 74 A complete list of the operate COMMANDS may be obtained by selecting a project from the ISaGRAF projects group, opening an application and observing the Common defines in the Dictionary pull-down menu. Note that not all calls in the list may be used within the SMART I/O environment however, the calls applicable to this module are : O_INIT_CODE O_POWERFAIL_SET : The purpose of this operate call is to detect when...
  • Page 75 Chapter 2 SMART-BASE O_START_COUNTER : This call starts the counter; it’s syntax is as follows : <RetVar> := OPERATE(<iovar>, O_START_COUNTER, <null>); O_READ_COUNTER <RetVar> := OPERATE(<iovar>, O_READ_COUNTER, <null>); O_STOP_COUNTER <RetVar> := OPERATE(<iovar>, O_STOP_COUNTER, <null>); The counter/timer is configured automatically as MODE10 (refer to the ‘C’ Programming section) and from within ISaGRAF there is no ability to alter this configuration.
  • Page 76 O_PRELOAD <RetVar> := OPERATE(<iovar>, O_PRELOAD, <prevar>); O_START_CNTDWN <RetVar> := OPERATE(<iovar>,O_START_CNTDWN,<prevar>); Page 2 - 36 ©1996 PEP Modular Computers GmbH : With this call the counter preload register can be set. The syntax is as follows : where the <iovar> is typically t_in and <prevar>...
  • Page 77: Flash Utility

    Chapter 2 SMART-BASE 2.8 Flash Utility The flash utility allows ISaGRAF applications, a new ISaGRAF kernel or other OS-9 modules to be loaded into FLASH memory. The SMART I/O may be equipped with 1 MByte of memory depending on the version or- dered.
  • Page 78 Example to download ISA11 module and store in FLASH Start the isa terminal in MS Windows: Press the <ENTER> key three times to display the following screen prompt: Isa: Start kermit on the target system Isa: kermit ri <ENTER> Select the menu item transfers-send binary file from the windows terminal and select the file flash on the PC to transfer Load flash into memory Isa: load -ld/dd/APL/flash...
  • Page 79 Chapter 3 SMART-EXT Table Of Contents 3. SMART-EXT ...3-3 3.1 Specifications ... 3-3 3.2 Board Overview ... 3-4 3.3 Functional Description ... 3-5 3.4 Pinouts ... 3-6 3.4.1 SMART Module Piggyback Connectors ... 3-7 3.4.2 Parallel I/O Screw Terminals (SCRA and SCRB) ... 3-8 3.4.3 SPI Connectors (ST5 and BU1) ...
  • Page 80 Chapter 3 SMART-EXT SMART I/O User’s Manual This page has been left blank intentionally March 12, 1996 Page 3 - 2 ©1996 PEP Modular Computers GmbH...
  • Page 81: Smart-Ext

    Chapter 3 SMART-EXT 3. SMART-EXT The SMART-EXT is a carrier unit enabling the connection of a further 2 SMART-Modules thereby enhancing the I/O capacity of the SMART I/O system. Up to 4 of these extensions may be cascaded via a 10-wire flat-band cable with integrated 3-wire SPI (Serial Peripheral Interface).
  • Page 82: Board Overview

    3.2 Board Overview From SMART-BASE or other SMART-EXT Modules Page 3 - 4 ©1996 PEP Modular Computers GmbH 68HC05C4 SMART Modules I/O Slot A I/O Slot B SCRA SCRB To further SMART-EXT Modules March 12, 1996...
  • Page 83: Functional Description

    Chapter 3 SMART-EXT 3.3 Functional Description Figure 3.3.1: SMART-EXT Block Diagram Interface Connector with Integrated The SMART-EXT is a carrier board for up to 2 SMART-Modules with data transfer between SMART-BASE and EXT units being performed by the interface connector incorporating the Motorola synchronous Serial Peripheral Interface (SPI).
  • Page 84: Pinouts

    3.4 Pinouts Figure 3.4.0.1: SMART-EXT Pinout Overview Pin 1 Pin 2 Pin 10 Pin 9 Pin 1 Pin 2 Slot #3,5,7,9 Dangerous voltages may be present at the terminals. Page 3 - 6 ©1996 PEP Modular Computers GmbH Pin 16 Pin 16 Pin 15 Pin 2...
  • Page 85: Smart Module Piggyback Connectors

    Chapter 3 SMART-EXT 3.4.1 SMART Module Piggyback Connectors There are two sets (one for each module) of SMART-Module piggyback connectors present on the SMART-EXT, each divided into two sets of 2x8 standard pin rows. The communication to these connectors is achieved in part via the 10-wire flat-band interface cable and directly by the MCU.
  • Page 86: Parallel I/O Screw Terminals (Scra And Scrb)

    Pinouts process side (ST2 and ST4) Refer to figure 3.4.0.1 for the correct location of these pin-row connectors. Slots A and B (ST2 and ST4) Pin Nr. Screw Terminal 13 Screw Terminal 1 Screw Terminal 3 Screw Terminal 5 Screw Terminal 7 Screw Terminal 9 Screw Terminal 11 Screw Terminal 14...
  • Page 87: Spi Connectors (St5 And Bu1)

    Chapter 3 SMART-EXT 3.4.3 SPI Connectors (ST5 and BU1) On both sides of the board are standard 2x5 pinrow connectors (BU1, ST5), that provide the interface connection between SMART-EXT units and the SMART-BASE. A 10-wire flat cable is soldered directly on the left-hand side of the board (BU1), that interfaces the SMART-BASE module or other (earlier cascaded) SMART-EXT modules.
  • Page 88 Chapter 3 SMART-EXT SMART I/O User’s Manual This page has been left blank intentionally. March 12, 1996 Page 3 - 10 ©1996 PEP Modular Computers GmbH...
  • Page 89: Jan. 98 Manual Id 09901, Rev. Index 0500 Page

    Digital Modules SMART I/O User’s Manual Digital Modules 08 Jan. 98 Manual ID 09901, Rev. Index 0500 Page 4 - 1...
  • Page 90 SMART I/O User’s Manual Table of Contents Chapter 4.1 SM-DIN1 ... 4-5 4.1.1 Introduction ... 4-5 4.1.2 Specifications ... 4-5 4.1.3 Front Panel Layout ... 4-6 4.1.4 Board Overview ... 4-7 4.1.5 Functional Description ... 4-8 4.1.6 Configuration ... 4-9 4.1.7 Pinouts ...
  • Page 91 Digital Modules 4.2.7 Pinouts ... 4-22 4.2.9 ISaGRAF Programming ... 4-29 4.3 SM-REL1... 4-33 4.3.1 Introduction ... 4-33 4.3.2 Specifications ... 4-33 4.3.3 Front Panel Layout ... 4-34 4.3.4 Board Overview ... 4-34 4.3.5 Functional Description ... 4-35 4.3.6 Configuration ... 4-36 4.3.7 Pinouts ...
  • Page 92 This page was intentionally left blank.
  • Page 93: Sm-Din1

    Chapter 4 Digital Modules 4. Digital Modules 4.1 SM-DIN1 4.1.1 Introduction The SM-DIN1 provides 8 optoisolated 24V DC digital inputs arranged in 6 independent groups with respect to the ground connections. The maximum input switching frequency is set to 200Hz with the system registering a logical ‘1’...
  • Page 94: Front Panel Layout

    Chapter 4 Digital Modules SMART I/O User’s Manual 4.1.3 Front Panel Layout User Descriptor Fields Green LEDs March 12, 1996 Page 4 - 6 ©1996 PEP Modular Computers GmbH...
  • Page 95: Board Overview

    Chapter 4 Digital Modules 4.1.4 Board Overview Component Side Solder Side March 12, 1996 SMART I/O User’s Manual LED 7 Optoisolation Register Pass Input Filter Circuit Pin 15 Pin 1 Pin 1 Pin 2 Pin 2 Pin 16 LED 0 LED 7 Pin 16 Pin 16...
  • Page 96: Functional Description

    4.1.5 Functional Description Figure 4.1.5.1: SM-DIN1 Schematic Diagram User/Input Interface +Vcc (24V) Input Circuit Gnd (common) The input circuit comprises a Zener diode requiring 3mA to drive it beyond the ‘knee’ that borders between ‘OFF’ and ‘ON’. More simply, input voltages between 8V and 10V DC produce an unknown digital result.
  • Page 97: Configuration

    Chapter 4 Digital Modules 4.1.6 Configuration Although two solder jumpers exist on the board (J1 and J2), they should remain at their factory settings unless a user-specific filter is required that cuts off at higher frequencies for example. If a user-specific filter is required then contact PEP Modular Computers for further advice and refer to the illustration shown in figure 4.1.6.1 of the filtering components.
  • Page 98: Screw Terminal Pinouts

    4.1.7 Pinouts Screw Terminal Pinouts The following shows the pinout/signal relationship for the SM-DIN1 when connected to a particular screw terminal block. Pin Nr. Signal Description G0EXT GND for channel 0 Input Channel 0 Input Channel 1 G1EXT GND for channel 1 Input Channel 2 Input Channel 3 G23EXT GND for channels 2&3...
  • Page 99: Input Circuit

    Chapter 4 Digital Modules Connection Input Circuit +Vcc (24V) Gnd (0V) March 12, 1996 SMART I/O User’s Manual Digital Sensors Pin 1 Pin 2 User/Input Interface System Interface LL4448 G0EXT ©1996 PEP Modular Computers GmbH +Vcc (24V) Pin 13 Pin 14 Gnd (0V) Typ: Common GND Page 4 - 11...
  • Page 100: C' Programming

    4.1.8 ‘C’ Programming 4.1.8.1 SM-DIN1 Library The SM-DIN1 library of functions smartio.l provide a convenient way of accessing the SM-DIN1 module. • All functions are written in ANSI C; • Prototypes are to be found in the file din1lib.h. Hardware Requirements •...
  • Page 101 Chapter 4 Digital Modules 4.1.8.2 SMDIN1Init Syntax error_code SMDIN1Init(u_int8 PortNr); Description This function initialises the SM-DIN1 Module on port PortNr by allocating space in memory for resources and resetting all inputs. Input u_int8 PortNr Output error_code Example RetVal = SMDIN1Init(0); March 12, 1996 SMART I/O User’s Manual SM-Port number to initialise...
  • Page 102 4.1.8.3 SMDIN1DeInit Syntax error_code SMDIN1DeInit(u_int8 PortNr); Description This function de-initialises the SM-DIN1 Module on port PortNr by releas- ing all resources assigned to it thereby freeing memory for other uses. Input u_int8 PortNr Output error_code SUCCESS or standard OS-9 error code (refer to the OS-9 Technical Manual Error Codes Section).
  • Page 103 Chapter 4 Digital Modules 4.1.8.4 SMDIN1Get Syntax error_code SMDIN1Get(u_int8 PortNr, u_int8 *buffer); Description This function fetches the status of ALL 8 input lines of the port PortNr and writes it to the address pointed to by buffer with bit 0 of the buffer represent- ing input 0 of the module.
  • Page 104: Isagraf Programming

    Chapter 4 Digital Modules SMART I/O User’s Manual 4.1.9 ISaGRAF Programming 4.1.9.1 The ISaGRAF Board Parameters Information on board parameters may be found in the PEP online help and ISaGRAF online help or user’s manual. Figure 4.1.9.1.1 a Typical Screen Section for the SM-DIN1 Module Logical Address The 8 inputs of this module may be clearly seen together with the logical address at which this particular board is residing.
  • Page 105 Chapter 4 Digital Modules SMART I/O User’s Manual 4.1.9.2 The ISaGRAF Operate Calls Operate calls are built into a program using ST or FBD languages when defining the project. A typical use could be at the initialization stage to check that the SMART-Modules are in fact located where they have been programmed to be.
  • Page 106 Chapter 4 Digital Modules SMART I/O User’s Manual A complete list of the operate COMMANDS may be obtained by selecting a project from the ISaGRAF projects group, opening an application and observing the Common defines in the Dictionary pull-down menu. Note that not all calls in the list may be used within the SMART I/O environment however, the calls applicable to this module are : : The syntax and usage have already been explained.
  • Page 107: Sm-Dout1

    Chapter 4 Digital Modules 4.2 SM-DOUT1 4.2.1 Introduction The SM-DOUT1 provides eight optoisolated 24V DC (typ.) digital outputs arranged in 2 independent groups. The maximum output switching fre- quency is limited to 1 kHz (square wave) with the output in the ON state when the system issues a logical ‘0’.
  • Page 108: Front Panel Layout

    4.2.3 Front Panel Layout Yellow LEDs 4.2.4 Board Overview Component Side Output Transistors Pin 1 Pin 2 Page 4 - 20 ©1996 PEP Modular Computers GmbH User Descriptor Fields LED 7 LED 0 Optoisolation LED Driver ID Register Digital Output Network Pin 15 Pin 15...
  • Page 109: Functional Description

    Chapter 4 Digital Modules 4.2.5 Functional Description Figure 4.2.5.1: SM-DOUT1 Schematic Diagram Digital System Output Interface The system interface is low active which means that a logical ‘0’ activates the LED and optoisolation stage causing the output to switch the 24V Vcc to power the load.
  • Page 110 4.2.6 Configuration There are no jumpers to configure on the SM-DOUT1. 4.2.7 Pinouts Screw Terminal Pinouts The following shows the pinout/signal relationship for the SM-DOUT1 when connected to a particular screw terminal block. Pin Nr. Signal Description V01EXT Vcc for channels 0 & 1 OUT0 Output 0 OUT1...
  • Page 111: Output Circuit

    Chapter 4 Digital Modules Connection Pin 1 Pin 2 Digital Actuators Output Circuit Typ: PNP Opto TLP521 March 12, 1996 SMART I/O User’s Manual +Vcc (24V) Pin 13 Pin 14 Gnd (0V) System Interface User Interface V01EXT 6.8 k TIP125 OUT0 BYM05-100 G03EXT...
  • Page 112 4.2.8 ‘C’ Programming 4.2.8.1 SM-DOUT1 Library The SM-DOUT1 library of functions smartio.l provide a convenient way of accessing the SM-DOUT1 module. • All functions are written in ANSI C; • Prototypes are to be found in the file dout1lib.h. Hardware Requirements •...
  • Page 113 Chapter 4 Digital Modules If the same SM-DOUT1 Module is to be accessed from different tasks, the user must make sure that the actual output status is ensured by using for example, semaphores within OS-9. 4.2.8.2 SMDOUT1Init Syntax error_code SMDOUT1Init(u_int8 PortNr); Description This function initializes the SM-DOUT1 Module on port PortNr and sets all output lines to OFF.
  • Page 114 4.2.8.3 SMDOUT1DeInit Syntax error_code SMDOUT1DeInit(u_int8 PortNr); Description This function de-initializes the SM-DOUT1 Module on port PortNr by releasing all resources assigned to it thereby freeing memory for other uses. Input u_int8 PortNr Output error_code Example RetVal = SMDOUT1DeInit(0); Page 4 - 26 ©1996 PEP Modular Computers GmbH SM-Port number to de-initialize SUCCESS...
  • Page 115 Chapter 4 Digital Modules 4.2.8.4 SMDOUT1Get Syntax error_code SMDOUT1Get(u_int8 PortNr, u_int8 *buffer); Description This function fetches the output status of the port PortNr and writes it to the memory location pointed to by buffer. This buffer shows the status of all 8 outputs with bit 0 representing output 0 of the module.
  • Page 116 4.2.8.5 SMDOUT1Set Syntax error_code SMDOUT1Set(u_int8 PortNr, u_int8 *buffer); Description This function sets the output of the port PortNr with the contents of the address pointed to by buffer. When writing to this buffer, observe that all 8 outputs are set at the same time. Input u_int8 PortNr u_int8 *buffer...
  • Page 117: Isagraf Programming

    Chapter 4 Digital Modules 4.2.9 ISaGRAF Programming 4.2.9.1 The ISaGRAF Board Parameters Information on board parameters may be found in the PEP online help and ISaGRAF online help or user’s manual. Figure 4.2.9.1.1 a Typical Screen Section for the SM-DOUT1 Module Logical Address The 8 outputs of this module may be clearly seen together with the logical address at which this particular board is residing.
  • Page 118 Chapter 4 Digital Modules SMART I/O User’s Manual 4.2.9.2 The ISaGRAF Operate Calls Operate calls are built into a program using ST or FBD languages when defining the project. A typical use could be at the initialization stage to check that the SMART-Modules are in fact located where they have been programmed to be.
  • Page 119 Chapter 4 Digital Modules SMART I/O User’s Manual A complete list of the operate COMMANDS may be obtained by selecting a project from the ISaGRAF projects group, opening an application and observing the Common defines in the Dictionary pull-down menu. Note that not all calls in the list may be used within the SMART I/O environment however, the calls applicable to this module are : : The syntax and usage have already been explained.
  • Page 120 Chapter 4 Digital Modules SMART I/O User’s Manual This page has been left blank intentionally. March 12, 1996 Page 4 - 32 ©1996 PEP Modular Computers GmbH...
  • Page 121: Sm-Rel1

    Chapter 4 Digital Modules 4.3 SM-REL1 4.3.1 Introduction The SM-REL1 provides power switching up to 250V AC or 220V DC with surge protection and the ability to switch inductive loads being built-in features of this versatile module. A freely programmable LED on the front panel provides the user interface together with 6 relay status LEDs and an external 24V supply signal LED.
  • Page 122: Front Panel Layout

    4.3.3 Front Panel Layout Yellow LEDs Green LED Yellow LED 4.3.4 Board Overview Component Side Relays Page 4 - 34 ©1996 PEP Modular Computers GmbH User Descriptor Fields SM-REL1 6 N/O Relay Outputs LED 7 LED 0 Relay Optocouplers Filters EEPROM Relay Relay Driver...
  • Page 123: Functional Description

    Chapter 4 Digital Modules SMART I/O User’s Manual 4.3.5 Functional Description Figure 4.3.5.1: SM-REL1 Schematic Diagram Com. Ext. Vcc Load Digital System 24V DC Relay Output Interface Driver Com. Ext. Gnd The individual relays are low active which means that a digital ‘0’ delivered by the system closes the relay and illuminates the LED on the front-panel corresponding to the required channel.
  • Page 124: Configuration

    4.3.6 Configuration Jumper J1 - EEPROM Protection Jumper S e t t i n g s open 4.3.7 Pinouts Screw Terminal Pinouts The following shows the pinout/signal relationship for the SM-REL1 when connected to a particular screw terminal block. Pin 1 Pin Nr.
  • Page 125 Chapter 4 Digital Modules Connection Input Circuit 6.8 K PC829 ULN2002 March 12, 1996 SMART I/O User’s Manual VCCEXT 10 nF COM1 GNDEXT ©1996 PEP Modular Computers GmbH 24V DC +Vcc (24V) Load Gnd (0V) Page 4 - 37...
  • Page 126: C' Programming

    4.3.8 ‘C’ Programming 4.3.8.1 SM-REL1 Library The SM-REL1 library of functions smartio.l provide a convenient way of accessing the SM-REL1 module. • All functions are written in ANSI C; • Prototypes are to be found in the file rel1lib.h. Hardware Requirements •...
  • Page 127 Chapter 4 Digital Modules If the same SM-REL1 Module is to be accessed from different tasks, the user must make sure that the actual output status is ensured by using for example, semaphores within OS-9. 4.3.8.2 SMREL1Init Syntax error_code SMREL1Init(u_int8 PortNr); Description This function initializes the SM-REL1 Module on port PortNr by setting the relays to OPEN, relay LED status to OFF and the external Vcc as input.
  • Page 128 4.3.8.3 SMREL1DeInit Syntax error_code SMREL1DeInit(u_int8 PortNr); Description This function deinitializes the SM-REL1 Module on the port PortNr by freeing the resources tied up with this module and setting all relays to OPEN, all LEDs to OFF and setting the ext. Vcc line to input. Input u_int8 PortNr Output...
  • Page 129 Chapter 4 Digital Modules 4.3.8.4 SMREL1Reset Syntax error_code SMREL1Reset(u_int8 PortNr); Description This function resets the SM-REL1 Module by setting all relays to OPEN and all LEDs to OFF. This function does not free the resources as with the SMRELl1DeInit function call but it does ensure that the relay status (and LEDs) is as expected.
  • Page 130 4.3.8.5 SMREL1GetRly Syntax error_code SMREL1GetRly(u_int8 PortNr, Description This function gets the input of the port PortNr and writes it to the buffer. Bits 0-5 of the buffer reflect the Relay setting: 0 = relay closed 1 = relay open Bits 6 and 7 are cleared. Input u_int8 PortNr u_int8 *buffer...
  • Page 131 Chapter 4 Digital Modules 4.3.8.6 SMREL1SetRly Syntax error_code SMREL1SetRly(u_int8 PortNr, Description This function sets the output of the port PortNr with the buffer contents. Bits 0-5 of the buffer are used to set the Relays: 0 = close relay 1 = open relay Bits 6 and 7 have no function.
  • Page 132 4.3.8.7 SMREL1GetLed Syntax error_code SMREL1GetLed(u_int8 PortNr, Description This function gets the status of the User LED on the port PortNr and writes it to the buffer. If the LED is OFF then it returns 0, otherwise it returns 1. This function of the LED is for the user to decide. Input u_int8 PortNr u_int8 *buffer...
  • Page 133 Chapter 4 Digital Modules 4.3.8.8 SMREL1SetLed Syntax error_code SMREL1SetLed(u_int8 PortNr, Description This function sets the status of the User LED on the port PortNr with the contents of the buffer. If a bit is set to 0 then the LED is OFF otherwise it is Input u_int8 PortNr u_int8 *buffer...
  • Page 134 4.3.8.9 SMREL1GetExtVcc Syntax error_code SMREL1GetExtVcc(u_int8 PortNr, Description This function gets the input of the port PortNr and writes it to buffer. If there is no external Vcc, then it returns 0, otherwise it returns 1. Input u_int8 PortNr u_int8 *buffer Output error_code Example...
  • Page 135 Chapter 4 Digital Modules SMART I/O User’s Manual 4.3.9 ISaGRAF Programming 4.3.9.1 The ISaGRAF Board Parameters Information on board parameters may be found in the PEP online help and ISaGRAF online help or user’s manual. Figure 4.3.9.1.1 a Typical Screen Section for the SM-REL1 Module Logical Address The 6 outputs of this module may be clearly seen together with the logical address at which this particular board is residing.
  • Page 136 Chapter 4 Digital Modules SMART I/O User’s Manual 4.3.9.2 The ISaGRAF Operate Calls Operate calls are built into a program using ST or FBD languages when defining the project. A typical use could be at the initialization stage to check that the SMART-Modules are in fact located where they have been programmed to be.
  • Page 137 Digital Modules A complete list of the operate COMMANDS may be obtained by selecting a project from the ISaGRAF projects group, open- ing an application and observing the Common defines in the Dic- tionary pull-down menu. Note that not all calls in the list may be used within the SMART I/O environment.
  • Page 138 SMART I/O User’s Manual O_EXT_POWER, 0); where <analog var> represents the analog return variable and can <iovar> Page 4 - 52 Manual ID 09901, Rev. Index 0500 Digital Modules be zero, if the operate call is supported and the correct <var> is passed, or non-zero, if an error occurred.
  • Page 139: Sm-Aci1

    Digital Modules 4.4 SM-ACI1 4.4.1 Introduction The SM-ACI1 provides eight optoisolated 80 V AC to 264 V AC inputs arranged in six independent groups with respect to common neutral connections. The input frequency range is 47- 63 Hz, with the system registering a logical ’1’ when the input is active.
  • Page 140: Specifications

    SMART I/O User’s Manual 4.4.2 Specifications Table 4-1: Specifications Isolation 2.5 kV optoisolated towards the system Input 8 channels (80 V AC - 264 V AC) Common neutral < 0.5 mA input current Input frequency range Overvoltage protection (continu- ous): Switch-ON delay: Switch-OFF delay: High level:...
  • Page 141: Front Panel Layout

    Digital Modules SMART I/O User’s Manual 4.4.3 Front Panel Layout Figure 4-1: Front Panel Layout 08 Jan. 98 Manual ID 09901, Rev. Index 0500 Page 4 - 55...
  • Page 142: Board Overview

    SMART I/O User’s Manual Digital Modules 4.4.4 Board Overview Figure 4-2: Component Side Page 4 - 56 Manual ID 09901, Rev. Index 0500 08 Jan. 98...
  • Page 143 Digital Modules SMART I/O User’s Manual Figure 4-3: Solder Side 08 Jan. 98 Manual ID 09901, Rev. Index 0500 Page 4 - 57...
  • Page 144: Functional Description

    Digital Modules SMART I/O User’s Manual 4.4.5 Functional Description Figure 4-4: SM-ACI1 Schematic Diagram 08 Jan. 98 Manual ID 09901, Rev. Index 0500 Page 4 - 58...
  • Page 145: Configuration

    Digital Modules Downstream the optoisolation part of the circuit, an RC first- order, low-pass filter converts signals greater than 40 Hz into logically suitable values before they enter the system’s digital input. The LED driver activates the relevant LED when the input increases to more than 30 V AC.
  • Page 146 Digital Modules SMART I/O User’s Manual Figure 4-5: SM-ACI1 Configurable Filter 08 Jan. 98 Manual ID 09901, Rev. Index 0500 Page 4 - 60...
  • Page 147: Screw Terminal Pinouts

    Digital Modules Surface-Mounted Devices (SMDs) are used in the production of SM-ACI1 modules. The components to be changed, marked with an asterisk in figure 4-5, need not necessarily be SMDs. Please, refer to the board overview figure (solder side, figure 4- 3) for the approximate position of the jumpers.
  • Page 148 SMART I/O User’s Manual Table 4-3: Pinout/Signal Relationship Sign Page 4 - 62 Manual ID 09901, Rev. Index 0500 Digital Modules Sign Description Neutral channel 0 Phase channel 0 Phase channel 1 Neutral channel 1 Phase channel 2 Phase channel 3 Neutral channels 2, 3 Description...
  • Page 149 Digital Modules SMART I/O User’s Manual Figure 4-7: Connection 08 Jan. 98 Manual ID 09901, Rev. Index 0500 Page 4 - 63...
  • Page 150 SMART I/O User’s Manual Figure 4-8: Example: Input Circuit (Only One Channel Shown) 4.4.8 ANSI ’C’ Programming 4.4.8.1 SM-ACI1 Library The SM-ACI1 library of functions smartio.l provide a conve- nient way of accessing the SM-ACI1 module. • All functions are written in ANSI C; •...
  • Page 151 Digital Modules Software Requirements The compiler belonging to one of the following environments: • Ultra C Version 1.1.2 or higher; • FasTrak for Windows version 2.02 or higher. Attention: As far as programming is concerned, to the SM-Module on the very left the figure ’0’ is assigned, although physically it is slot 1.
  • Page 152 SMART I/O User’s Manual Input u_int8 PortNr SM-Port number to initialize. Output error_code SUCCESS E_BMODE If the module is unknown, or standard OS-9 error code (refer to the OS-9 Technical Manual Error Codes Section). Example RetVal = SMACI1Init(0); 4.4.8.3 SMACI1DeInit Syntax error_code SMACI1DeInit(u_int8 PortNr);...
  • Page 153 Digital Modules Example RetVal = SMACI1DeInit(0); 4.4.8.4 SMACI1Get Syntax error_code SMACI1Get(u_int8 PortNr, u_int8 *buffer); Description This function fetches the status of ALL 8 input lines of the port PortNr and writes it to the address pointed to by buffer with bit 0 of the buffer representing input 0 of the module.
  • Page 154: Isagraf Programming

    SMART I/O User’s Manual Buffer Explanation: Ch. 7 Ch. 6 Bit Value: 0 = No input or not connected 1 = Input Active 4.4.9 ISaGRAF Programming 4.4.9.1 ISaGRAF Board Parameters Information on board parameters may be found in the PEP on- line help and ISaGRAF on-line help or user’s manual.
  • Page 155 Digital Modules Logical Address The 8 inputs of this module may be clearly seen together with the logical address at which this particular board is residing. Remember, this logical address is the same as the physical slot position! In the example shown here, the board being addressed is in slot 2 i.e.
  • Page 156 SMART I/O User’s Manual Channel provides channel specific information and in the exam- ple shown here, any of the 8 input channels may be used. The last parameter is not usually used by PEP implementations and is set to 0 (zero). The error.code returns a value of zero if no error was detected, otherwise it returns a non-zero value depending on the error encountered.
  • Page 157 Chapter 5 Analog Modules SMART I/O User’s Manual Analog Modules SMART I/O March 12, 1996 ©1996 PEP Modular Computers GmbH Page 5 - 1...
  • Page 158 Table of Contents 5. Analog Modules ...5-7 5.1 SM-DAD1 ... 5-7 5.1.1 Introduction ... 5-7 5.1.2 Specifications ... 5-7 5.1.3 Front Panel Layout ... 5-8 5.1.4 Board Overview ... 5-9 5.1.5 Functional Description ... 5-10 5.1.5.1 Input Circuitry ... 5-10 5.1.5.2 Output Circuitry ...
  • Page 159 Chapter 5 Analog Modules 5.2.7 Pinouts ... 5-33 5.2.8 ‘C’ Programming ... 5-35 5.2.8.1 SM-PT100 Library ... 5-35 5.2.8.2 SMADCInit ... 5-39 5.2.8.3 SMADCCalibrate ... 5-40 5.2.8.4 SMADCSetCyclicCalib ... 5-41 5.2.8.5 SMADCSetSensorType ... 5-42 5.2.8.6 SMADCGetSensorType ... 5-43 5.2.8.7 SMADCSetPrecision ... 5-44 5.2.8.8 SMADCGetPrecision ...
  • Page 160 5.3.8.5 SMADCSetSensorType ... 5-71 5.3.8.6 SMADCGetSensorType ... 5-72 5.3.8.7 SMADCSetPrecision ... 5-73 5.3.8.8 SMADCGetPrecision ... 5-74 5.3.8.9 SMADCSetMode ... 5-75 5.3.8.10 SMADCGetMode ... 5-76 5.3.8.11 SMADCSetSignal ... 5-77 5.3.8.12 SMADCSetGain ... 5-78 5.3.8.13 SMADCGetGain ... 5-79 5.3.8.14 SMADCEnableRead ... 5-80 5.3.8.15 SMADCEnableConversion ...
  • Page 161 Chapter 5 Analog Modules 5.4.9.2 The ISaGRAF Operate Calls ... 5-102 5.5 SM-DAC1 ... 5-107 5.5.1 Introduction ... 5-107 5.5.2 Specifications ... 5-107 5.5.3 Front Panel Layout ... 5-108 5.5.4 Board Overview ... 5-108 5.5.5 Functional Description ... 5-109 5.5.5.1 Output Circuitry ... 5-109 5.5.6 Configuration ...
  • Page 162 Chapter 5 Analog Modules SMART I/O User’s Manual This page has been left blank intentionally. March 12, 1996 Page 5 - 6 ©1996 PEP Modular Computers GmbH...
  • Page 163: Analog Modules

    Chapter 5 Analog Modules 5. Analog Modules 5.1 SM-DAD1 5.1.1 Introduction The SM-DAD1 provides a fast, 12-bit, bipolar ( 10V DC), 4-channel analog to digital converter and, apart from its ADC role, may also be used as a fast 12-bit, 2-channel unipolar/bipolar digital to analog converter. Two configurable red LEDs on the front panel form the user interface while an on-board EEPROM stores unique calibration data (obtained in steady-state conditions at 25 C STP) required by the signal converters.
  • Page 164: Front Panel Layout

    Chapter 5 Analog Modules SMART I/O User’s Manual 5.1.3 Front Panel Layout Red LEDs User Descriptor Fields March 12, 1996 Page 5 - 8 ©1996 PEP Modular Computers GmbH...
  • Page 165 Chapter 5 Analog Modules 5.1.4 Board Overview Component Side Solder Side LED 0 March 12, 1996 SMART I/O User’s Manual LED 1 DC/DC Input Multiplexer EEPROM Input Amplifier Reference Output Amplifier LED 1 Pin 16 Pin 16 Pin 2 ©1996 PEP Modular Computers GmbH LED 0 Pin 2 Page 5 - 9...
  • Page 166: Functional Description

    Chapter 5 Analog Modules SMART I/O User’s Manual 5.1.5 Functional Description The SM-DAD1 has 4 differential voltage inputs and 2 unipolar/bipolar voltage outputs. An on-board EEPROM contains board specific calibration data, module ID byte and production data. An on-board switched-mode regulator provides 15V for the analog I/O and an additional linear regulator provides the -5V required by the ADC.
  • Page 167: Output Circuitry

    Chapter 5 Analog Modules 5.1.5.2 Output Circuitry The digital to analog converter (DAC) section consists of a twin output 12- bit DAC with external (on-board) 10.0V reference and an operational amplifier for unipolar/bipolar outputs. Figure 5.1.5.2: SM-DAD1 Output Schematic Diagram System Interface The DAC is a complete dual 12-bit multiplying DAC without the need for...
  • Page 168: Configuration

    5.1.6 Configuration The SM-DAD1 has 5 solder jumpers which may be configured as follows: Jumpers J1 and J2 These jumpers are reserved for PEP use only. Jumper J3 - EEPROM Protection Jumper S e t t i n g s open Jumper J4 and J5 - DAC Output Jumper S e t t i n g s...
  • Page 169 Chapter 5 Analog Modules 5.1.7 Pinouts Screw Terminal Pinouts The following shows the pinout/signal relationship for the SM-DAD1 when connected to a particular screw terminal block. Pin Nr. Signal IN0P (+) Analog Input Ch. 0+ IN0N (-) AGND IN1P (+) Analog Input Ch. 1+ IN1N (-) VOUT0 AGND...
  • Page 170: Analog Sensors

    Connection Pin 1 Pin 2 A/D Circuit 4.7 k IN0P 1 nF 4.7 k IN0N AGND Page 5 - 14 ©1996 PEP Modular Computers GmbH Analog Sensors Pin 13 Pin 14 Analog Actuators +15V +15V 220 k MAX427 220 k -15V 220 k -15V...
  • Page 171 Chapter 5 Analog Modules D/A Circuit +15V -15V +15V 10 V Jumpers J4 and J5 should be set if the DAC should operate in bipolar mode. It should be noted that the D/A circuit shown above represents only one of the two output channels.
  • Page 172: C' Programming

    5.1.8 ‘C’ Programming 5.1.8.1 SM-DAD1 Library The SM-DAD1 library of functions smartio.l provide a convenient way of accessing the SM-DAD1 module. • All functions are written in ANSI C; • Prototypes are to be found in the file dad1lib.h. Hardware Requirements •...
  • Page 173: Smdad1Init

    Chapter 5 Analog Modules If the same SM-DAD1 Module is to be accessed from different tasks, the user must make sure that the actual output status is ensured by using for example, semaphores within OS-9. 5.1.8.2 SMDAD1Init Syntax error_code SMDAD1Init(u_int8 PortNr); Description This function initializes the resources needed to use the SM-DAD1 on port PortNr, including:...
  • Page 174: Smdad1Deinit

    5.1.8.3 SMDAD1DeInit Syntax error_code SMDAD1DeInit(u_int8 PortNr); Description This function de-initializes the SM-DAD1 Module on the port PortNr by freeing the resources tied up with it and setting all outputs and inputs to zero. Input u_int8 PortNr Output error_code Example RetVal = SMDAD1DeInit(0); Page 5 - 18 ©1996 PEP Modular Computers GmbH SM-Port number to de-initialize...
  • Page 175: Smdad1Getvraw

    Chapter 5 Analog Modules 5.1.8.4 SMDAD1GetVRaw Syntax error_code SMDAD1GetVRaw(u_int8 PortNr, u_int8 Description This function fetches the conversion result of a selected channel without performing a gain or offset correction. The result is always a signed integer value. If bipolar mode is selected, the function returns the 2’s complement value of the original read.
  • Page 176: Smdad1Getv

    5.1.8.5 SMDAD1GetV Syntax error_code SMDAD1GetV(u_int8 PortNr, u_int8 Channel, Description This function fetches the conversion result of a selected channel. A gain and offset correction is done with the use of the selected conversion table. The result is always a signed integer value. If bipolar mode is selected, the function returns the 2’s complement value of the original read.
  • Page 177: Smdad1Putvraw

    Chapter 5 Analog Modules 5.1.8.6 SMDAD1PutVRaw Syntax error_code SMDAD1PutVRaw(u_int8 PortNr, u_int8 Description This function sets the selected DAC channel to the chosen value. No gain or offset correction is performed. Input u_int8 PortNr u_int8 Channel u_int16 Value Output error_code Example RetVal = SMDAD1PutVRaw(0, 1, 0x0FFF);...
  • Page 178: Smdad1Putv

    5.1.8.7 SMDAD1PutV Syntax error_code SMDAD1PutV(u_int8 PortNr, u_int8 Channel, Description This function sets the selected DAC channel to the chosen value. A gain and offset correction is performed with the use of the automatically selected conversion table depending whether a user-defined table has been specified or not.
  • Page 179: Smdad1Setled

    Chapter 5 Analog Modules 5.1.8.8 SMDAD1SetLed Syntax error_code SMDAD1SetLed(u_int8 PortNr, u_int8 LedNr); Description This function switches on one of the two LEDs fitted to the SM-DAD1. Input u_int8 PortNr u_int8 LedNr Output error_code Example RetVal = SMDAD1SetLed(0, 2); March 12, 1996 SMART I/O User’s Manual SM-Port number to be accessed Number of the LED to switch on (1-2)
  • Page 180: Smdad1Clrled

    5.1.8.9 SMDAD1ClrLed Syntax error_code SMDAD1ClrLed(u_int8 PortNr, u_int8 LedNr); Description This function switches off one of the two LEDs fitted to the SM-DAD1. Input u_int8 PortNr u_int8 LedNr Output error_code Example RetVal = SMDAD1ClrLed(0, 2); Page 5 - 24 ©1996 PEP Modular Computers GmbH SM-Port number to be accessed Number of the LED to switch off (1-2) SUCCESS...
  • Page 181: Isagraf Programming

    Chapter 5 Analog Modules 5.1.9 ISaGRAF Programming 5.1.9.1 The ISaGRAF Board Parameters Information on board parameters may be found in the PEP online help and ISaGRAF online help or user’s manual. Figure 5.1.9.1.1 Typical Screen Sections for the SM-DAD1 Module Logical Address The 4 inputs and 2 outputs of this module may be clearly seen together with the logical address at which this particular board is residing.
  • Page 182: The Isagraf Operate Calls

    Chapter 5 Analog Modules SMART I/O User’s Manual 5.1.9.2 The ISaGRAF Operate Calls Operate calls are built into a program using ST or FBD languages when defining the project. A typical use could be at the initialization stage to check that the SMART-Modules are in fact located where they have been programmed to be.
  • Page 183 Chapter 5 Analog Modules A complete list of the operate COMMANDS may be obtained by selecting a project from the ISaGRAF projects group, opening an application and observing the Common defines in the Dictionary pull-down menu. Note that not all calls in the list may be used within the SMART I/O environment however, the calls applicable to this module are : O_INIT_CODE O_SET_LED...
  • Page 184 O_DISABLE_CONV <analog var> := OPERATE(<iovar>, O_DISABLE_CONV, 0); where <analog var> represents the analog return variable and can <iovar> Page 5 - 28 ©1996 PEP Modular Computers GmbH : This operate call tells ISaGRAF to disable the conversion of a particular channel of a connected SM-DAD1 module.
  • Page 185: Sm-Pt100

    Chapter 5 Analog Modules 5.2 SM-PT100 5.2.1 Introduction The SM-PT100 is used for 2, 3 or 4-wire temperature measurement using PT100 sensors driven by an on-board constant current source. Temperature measurements between -200 C and + 850 C are possible with corrective calibration for the two possible PT100 4-wire classes being provided in driver software for OS-9 operation.
  • Page 186: Front Panel Layout

    5.2.3 Front Panel Layout 5.2.4 Board Overview Component Side Page 5 - 30 ©1996 PEP Modular Computers GmbH Red LEDs User Descriptor Fields SM-PT100 4 Ch. (4-wire) PT100 Inputs LED 1 Optocouplers DC/DC Optocouplers Multiplexers EEPROM LED 0 Logic March 12, 1996...
  • Page 187: Functional Description

    Chapter 5 Analog Modules 5.2.5 Functional Description Figure 5.2.5.1: SM-PT100 Schematic Diagram User Interface PT100 Sensor , 4-wire Input 400 A 400 A The SM-PT100 has provision for 4 sets of 4-wire PT100 sensors driven by an on-board generated 400 A constant current source. The differential analog input consists of a channel multiplexer, operational amplifier voltage feedback impedance converter and a high-resolution 16-bit delta-sigma converter.
  • Page 188 The two- and three-wire measurement methods shown in figure 5.2.5.2 are not compensated and will experience errors due to line-resistances. The best and recommended method is the 4-wire system shown in figure 5.2.5.1. which eliminates all line resistances automatically. The sense lines, being connected to a high impedance differential amplifier (10M ), introduce almost zero error resulting from line-resistances.
  • Page 189 Chapter 5 Analog Modules 5.2.6 Configuration Jumper J1 - EEPROM Protection Jumper S e t t i n g s 5.2.7 Pinouts Screw Terminal Pinouts The following shows the pinout/signal relationship for the SM-PT100 when connected to a particular screw terminal block. Pin Nr.
  • Page 190: Input Circuit

    Connection CUR0 CUR1 Input Circuit Cur0 68 k - 5V 10 M In0+ In0- 10 M - 5V 47 k AGND Page 5 - 34 ©1996 PEP Modular Computers GmbH PT100 PT100 IN0+ IN0- AGND IN2+ IN2- CUR2 IN1+ IN1- AGND IN3+ IN3-...
  • Page 191: C' Programming

    Chapter 5 Analog Modules 5.2.8 ‘C’ Programming 5.2.8.1 SM-PT100 Library The SM-PT100 library of functions smartio.l provide a convenient way of accessing the SM-PT100 module. • All functions are written in ANSI C; • Prototypes are to be found in the file adclib.h. Hardware Requirements •...
  • Page 192 Chapter 5 Analog Modules SMART I/O User’s Manual To compile the source, execute the following commands at the shell prompt: > chd /<dev>/APPLIC/SMART > make all To execute the example: * load HW task load /<dev>/BSP/SMART/SMADC/adc_task load /<dev>/APPLIC/SMART/CMDS/demoadc * load example demoadc [slot] Slot = 0,1 ..
  • Page 193: Other Functions

    Chapter 5 Analog Modules Read Temperature Values The HW task is prepared with a function that converts RAW values of a channel to degrees Celsius. To enable this facility, the function SMADCEnableConversion must be called after calling SMADCEnableRead. If the HW task has calculated these converted values, the function SMADCReadConverted can be used to get the value.
  • Page 194: Smadcinit

    Figure 5.2.8.1. illustrates a typical programming structure for the correct operation of an SM-PT100 SMART-Module. Figure 5.2.8.1 SM-PT100 Programming Flow Diagram START SMADCInit() Install Signal Handler - OS-Intercept SMADCSetSensorType() (for a channel) SMADCEnableRead() (for a channel) SMADCEnableConversion() (for a channel) SMADCSetSignal() (for a channel) Page 5 - 38...
  • Page 195 Chapter 5 Analog Modules 5.2.8.2 SMADCInit Syntax error_code SMADCInit(u_int8 PortNr); Description This function initializes the SM-PT100 Module on port PortNr, and: - identifies boards supported by this library - provides an internal list of known sensors (contact PEP Modular Computers for advice on sensors not included in this list) - creates or links the data module for communication with HW task (the module name is ‘ADC_Data’) - starts the task accessing the Hardware (HW task)
  • Page 196: Smadccalibrate

    5.2.8.3 SMADCCalibrate Syntax error_code SMADCCalibrate(u_int8 PortNr); Description This function signals the HW task that a calibration cycle has to be started for the SM-PT100 at slot PortNr. It is performed automatically when the module is initialized and may be called at any time (if the sensor for example is moved to a different location with different temperature ranges).
  • Page 197: Smadcsetcycliccalib

    Chapter 5 Analog Modules 5.2.8.4 SMADCSetCyclicCalib Syntax error_code SMADCSetCyclicCalib(u_int8 PortNr, u_int Description This function sets the time between two calibration cycles in seconds. If secs=0, then cyclic calibration is disabled. Input u_int8 PortNr u_int16 secs Output error_code Example RetVal = SMADCSetCyclicCalib(0 , 120); March 12, 1996 SMART I/O User’s Manual secs);...
  • Page 198: Smadcsetsensortype

    5.2.8.5 SMADCSetSensorType Syntax error_code SMADCSetSensorType(u_int8 PortNr, u_int8 Description This function checks if an SM-PT100 board is fitted on the specified port, if the channel is valid, if the sensorCode is known and sets the gain, precision and mode to their default values for the type of sensor connected. Input u_int8 PortNr u_int8 channel...
  • Page 199: Smadcgetsensortype

    Chapter 5 Analog Modules 5.2.8.6 SMADCGetSensorType Syntax error_code SMADCGetSensorType(u_int8 PortNr, u_int8 Description This function checks if an SM-PT100 board is fitted on the specified port and if the channel is valid. It gets the code of the sensor type of the specified channel and stores it in a user defined buffer.
  • Page 200: Smadcsetprecision

    5.2.8.7 SMADCSetPrecision Syntax error_code SMADCSetPrecision(u_int8 PortNr, u_int8 Description This function checks if an SM-PT100 board is fitted on the specified port and if the channel is valid. It sets the precision of the AD Converter. The valid precision values are defined in the file smadc.h. Note that large precision/ filter values cause longer AD conversion times.
  • Page 201: Smadcgetprecision

    Chapter 5 Analog Modules 5.2.8.8 SMADCGetPrecision Syntax error_code SMADCGetPrecision(u_int8 PortNr, u_int8 Description This function checks if an SM-PT100 board is fitted on the specified port and if the channel is valid. It gets the precision/filter setting of the AD Converter and stores the value in a user defined buffer.
  • Page 202: Smadcsetmode

    5.2.8.9 SMADCSetMode Syntax error_code SMADCSetMode(u_int8 PortNr, u_int8 channel, Description This function checks if an SM-PT100 board is fitted on the specified port and if the channel is valid and sets the mode of the AD Converter. The valid values (BIPOLAR, UNIPOLAR) are defined in the file smadc.h. Input u_int8 PortNr u_int8 channel...
  • Page 203: Smadcgetmode

    Chapter 5 Analog Modules 5.2.8.10 SMADCGetMode Syntax error_code SMADCGetMode(u_int8 PortNr, u_int8 channel, Description This function checks if an SM-PT100 board is fitted on the specified port and if the channel is valid. It gets the mode setting of the channel and stores the value in a user defined buffer.
  • Page 204 5.2.8.11 SMADCSetSignal Syntax error_code SMADCSetSignal(u_int8 PortNr, u_int8 channel, process_id procID, signal_code sigCode); Description This function defines the code of the signal that is sent by the HW task when the conversion of the channel is ready. The signal is sent to the process with the ID procID.
  • Page 205: Smadcsetgain

    Chapter 5 Analog Modules 5.2.8.12 SMADCSetGain Syntax error_code SMADCSetGain(u_int8 PortNr, u_int8 channel, Description This function checks if an SM-PT100 board is fitted on the specified port and if the channel is valid and sets the value of the gain amplifier. The valid values for gain are defined in the file smadc.h.
  • Page 206: Smadcgetgain

    5.2.8.13 SMADCGetGain Syntax error_code SMADCGetGain(u_int8 PortNr, u_int8 channel, Description This function checks if an SM-PT100 board is fitted on the specified port and if the channel is valid. It gets the gain amplifier setting of the ADC and stores the value in a user defined buffer where the user has to take care that the buffer is large enough to store the data.
  • Page 207: Smadcenableread

    Chapter 5 Analog Modules 5.2.8.14 SMADCEnableRead Syntax error_code SMADCEnableRead(u_int8 PortNr, u_int8 Description This function checks if an SM-PT100 board is fitted on the specified port and if the channel is valid. It forces the HW task to read raw values from the enabled channels of the device one after the other.
  • Page 208: Smadcenableconversion

    5.2.8.15 SMADCEnableConversion Syntax error_code SMADCEnableConversion(u_int8 PortNr, u_int8 Description This function checks if an SM-PT100 board is fitted on the specified port and if the channel is valid and forces the HW task to convert the raw values. If the flag enable is TRUE (<>0), then conversion of raw values to degrees Celsius is executed, else if (enable=FALSE) no conversion takes place.
  • Page 209: Smadcreadraw

    Chapter 5 Analog Modules 5.2.8.16 SMADCReadRaw Syntax error_code SMADCReadRaw(u_int8 PortNr, u_int8 channel, Description This function checks if an SM-PT100 board is fitted on the specified port and if the channel is valid. It reads the raw value of the last conversion and stores it in a user defined buffer.
  • Page 210: Smadcreadconverted

    5.2.8.17 SMADCReadConverted Syntax error_code SMADCReadConverted(u_int8 PortNr, u_int8 Description This function reads the converted value of the last AD Conversion and stores the value in degrees Celcius in a user defined buffer. The user has to take care that the buffer is large enough to store the data. Input u_int8 PortNr u_int8 channel...
  • Page 211: Smadcdeinit

    Chapter 5 Analog Modules 5.2.8.18 SMADCDeinit Syntax error_code SMADCDeinit(u_int8 PortNr); Description This function frees the resources attached to this module if it was initialised. Input u_int8 PortNr Output error_code Example RetVal = SMADCDeinit(0); March 12, 1996 SMART I/O User’s Manual Number of the port to deinitialise SUCCESS or standard OS-9 error code (refer to the OS-9...
  • Page 212: Isagraf Programming

    5.2.9 ISaGRAF Programming 5.2.9.1 The ISaGRAF Board Parameters Information on board parameters may be found in the PEP online help and ISaGRAF online help or user’s manual. Figure 5.2.9.1.1 a Typical Screen Section for the SM-PT100 Module Logical Address The 4 inputs of this module may be clearly seen together with the logical address at which this particular board is residing.
  • Page 213: The Isagraf Operate Calls

    Chapter 5 Analog Modules 5.2.9.2 The ISaGRAF Operate Calls Operate calls are built into a program using ST or FBD languages when defining the project. A typical use could be at the initialization stage to check that the SMART-Modules are in fact located where they have been pro- grammed to be.
  • Page 214 A complete list of the operate COMMANDS may be obtained by selecting a project from the ISaGRAF projects group, opening an application and observing the Common defines in the Dictionary pull-down menu. Note that not all calls in the list may be used within the SMART I/O environment however, the calls applicable to this module are : O_INIT_CODE O_ENABLE_CONV...
  • Page 215: Sm-Therm

    Chapter 5 Analog Modules 5.3 SM-THERM 5.3.1 Introduction The SM-THERM supports up to four groups of thermoelement sensors together with a cold junction (ext. PT100) for accurate temperature measure- ment. The sensor types shown in the table below may be connected with corrective calibration for all sensor classes being provided by driver software running under OS-9.
  • Page 216: Front Panel Layout

    5.3.3 Front Panel Layout Red LEDs 5.3.4 Board Overview Component Side Multiplexers Page 5 - 60 ©1996 PEP Modular Computers GmbH User Descriptor Fields SM-THERM 4 Channel Thermocouple Inputs LED 1 LED 0 Optocouplers Logic DC/DC Optocouplers EEPROM March 12, 1996...
  • Page 217: Functional Description

    Chapter 5 Analog Modules 5.3.5 Functional Description Figure 5.3.5.1: SM-THERM Schematic Diagram Thermo Sensor SHIELD LINE SENSE LINE SENSE LINE External PT100 Sensor, 2-wire Cold Junction Input The SM-THERM allows four sets of three-wire thermocouples to be con- nected together with one additional PT100 element used as a cold junction point reference.
  • Page 218: Screw Terminal Pinouts

    5.3.6 Configuration Jumper J1 - EEPROM Protection Jumper S e t t i n g s open 5.3.7 Pinouts Screw Terminal Pinouts The following shows the pinout/signal relationship for the SM-PT100 when connected to a particular screw terminal block. Pin Nr. Signal Description AGND Analog Shield...
  • Page 219: Input Circuit

    Chapter 5 Analog Modules Connection Input Circuit In0+ In0- AGND March 12, 1996 SMART I/O User’s Manual AGND IN0+ IN0- TMP+ IN2+ IN2- AGND AGND IN1+ IN1- TMP- IN3+ IN3- AGND 68 k 47 k - 5V + 5V +12V 10 M MUX 8:1 AD508F...
  • Page 220: C' Programming

    5.3.8 ‘C’ Programming 5.3.8.1 SM-THERM Library The SM-THERM library of functions smartio.l provide a convenient way of accessing the SM-THERM module. • All functions are written in ANSI C; • Prototypes are to be found in the file adclib.h. Hardware Requirements •...
  • Page 221 Chapter 5 Analog Modules SMART I/O User’s Manual To compile the source, execute the following commands at the shell prompt: > chd /<dev>/APPLIC/SMART > make all To execute the example: * load HW task load /<dev>/BSP/SMART/SMADC/adc_task load /<dev>/APPLIC/SMART/CMDS/demoadc * load example demoadc [slot] Slot = 0,1 ..
  • Page 222 Read Temperature Values The HW task is prepared with a function that converts RAW values of a channel to degrees Celsius. To enable this facility, the function SMADCEnableConversion must be called after calling SMADCEnableRead. If the HW task has calculated these converted values, the function SMADCReadConverted can be used to get the value.
  • Page 223: Smadcinit

    Chapter 5 Analog Modules Figure 5.3.8.1. illustrates a typical programming structure for the correct operation of an SM-THERM SMART-Module. Figure 5.3.8.1 SM-THERM Programming Flow Diagram START SMADCInit() Install Signal Handler - OS-Intercept SMADCSetSensorType() (for a channel) SMADCEnableRead() (for a channel) SMADCEnableConversion() (for a channel) SMADCSetSignal()
  • Page 224 5.3.8.2 SMADCInit Syntax error_code SMADCInit(u_int8 PortNr); Description This function initializes the SM-THERM Module on port PortNr, and: - identifies boards supported by this library - provides an internal list of known sensors (contact PEP Modular Computers for advice on sensors not included in this list) - creates or links the data module for communication with HW task (the module name is ‘ADC_Data’) - starts the task accessing the Hardware (HW task)
  • Page 225: Smadccalibrate

    Chapter 5 Analog Modules 5.3.8.3 SMADCCalibrate Syntax error_code SMADCCalibrate(u_int8 PortNr); Description This function signals the HW task that a calibration cycle has to be started for the SM-THERM at slot PortNr. It is performed automatically when the module is initialised and may be called at any time (if the sensor for example is moved to a different location with different temperature ranges).
  • Page 226: Smadcsetcycliccalib

    5.3.8.4 SMADCSetCyclicCalib Syntax error_code SMADCSetCyclicCalib(u_int8 PortNr, Description This function sets the time between two calibration cycles in seconds. If secs=0, then cyclic calibration is disabled. Input u_int8 PortNr u_int16 secs Output error_code Example RetVal = SMADCSetCyclicCalib(0 , 120); Page 5 - 70 ©1996 PEP Modular Computers GmbH u_int secs);...
  • Page 227: Smadcsetsensortype

    Chapter 5 Analog Modules 5.3.8.5 SMADCSetSensorType Syntax error_code SMADCSetSensorType(u_int8 PortNr, u_int8 Description This function checks if an SM-THERM board is fitted on the specified port, if the channel is valid, if the sensorCode is known and sets the gain, preci- sion and mode to their default values for the type of sensor connected.
  • Page 228: Smadcgetsensortype

    5.3.8.6 SMADCGetSensorType Syntax error_code SMADCGetSensorType(u_int8 PortNr, u_int8 Description This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid. It gets the code of the sensor type of the specified channel and stores it in a user defined buffer. The user has to take care that there is enough place to store the data.
  • Page 229: Smadcsetprecision

    Chapter 5 Analog Modules 5.3.8.7 SMADCSetPrecision Syntax error_code SMADCSetPrecision(u_int8 PortNr, u_int8 Description This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid. It sets the precision of the AD Converter. The valid precision values are defined in the file smadc.h.
  • Page 230: Smadcgetprecision

    5.3.8.8 SMADCGetPrecision Syntax error_code SMADCGetPrecision(u_int8 PortNr, u_int8 Description This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid. It gets the precision/filter setting of the AD Converter and stores the value in a user defined buffer. The user has to take care that there is enough space to store the data.
  • Page 231: Smadcsetmode

    Chapter 5 Analog Modules 5.3.8.9 SMADCSetMode Syntax error_code SMADCSetMode(u_int8 PortNr, u_int8 channel, Description This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid and sets the mode of the AD Converter. The valid values (BIPOLAR, UNIPOLAR) are defined in the file smadc.h.
  • Page 232: Smadcgetmode

    5.3.8.10 SMADCGetMode Syntax error_code SMADCGetMode(u_int8 PortNr, u_int8 channel, Description This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid. It gets the mode setting of the channel and stores the value in a user defined buffer. The user has to take care that the buffer is large enough to store the data.
  • Page 233: Smadcsetsignal

    Chapter 5 Analog Modules 5.3.8.11 SMADCSetSignal Syntax error_code SMADCSetSignal(u_int8 PortNr, u_int8 channel, process_id procID, signal_code sigCode); Description This function defines the code of the signal that is sent by the HW task when the conversion of the channel is ready. The signal is sent to the process with the ID procID.
  • Page 234: Smadcsetgain

    5.3.8.12 SMADCSetGain Syntax error_code SMADCSetGain(u_int8 PortNr, u_int8 channel, Description This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid and sets the value of the gain amplifier. The valid values for gain are defined in the file smadc.h. The default values for the attached sensor are substituted here when the sensor type is selected! Input u_int8 PortNr...
  • Page 235: Smadcgetgain

    Chapter 5 Analog Modules 5.3.8.13 SMADCGetGain Syntax error_code SMADCGetGain(u_int8 PortNr, u_int8 channel, Description This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid. It gets the gain amplifier setting of the ADC and stores the value in a user defined buffer where the user has to take care that the buffer is large enough to store the data.
  • Page 236: Smadcenableread

    5.3.8.14 SMADCEnableRead Syntax error_code SMADCEnableRead(u_int8 PortNr, u_int8 Description This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid. It forces the HW task to read raw values from the enabled channels of the device one after the other. The HW task writes the results to the data module.
  • Page 237: Smadcenableconversion

    Chapter 5 Analog Modules 5.3.8.15 SMADCEnableConversion Syntax error_code SMADCEnableConversion(u_int8 PortNr, u_int8 Description This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid and forces the HW task to convert the raw values. If the flag enable is TRUE (<>0), then conversion of raw values to degrees Celsius is executed, else if (enable=FALSE) no conversion takes place.
  • Page 238: Smadcreadraw

    5.3.8.16 SMADCReadRaw Syntax error_code SMADCReadRaw(u_int8 PortNr, u_int8 channel, Description This function checks if an SM-THERM board is fitted on the specified port and if the channel is valid. It reads the raw value of the last conversion and stores it in a user defined buffer. The user has to take care that the buffer is large enough to store the data.
  • Page 239: Smadcreadconverted

    Chapter 5 Analog Modules 5.3.8.17 SMADCReadConverted Syntax error_code SMADCReadConverted(u_int8 PortNr, u_int8 Description This function reads the converted value of the last AD Conversion and stores the value in degrees Celcius in a user defined buffer. The user has to take care that the buffer is large enough to store the data.
  • Page 240: Smadcdeinit

    5.3.8.18 SMADCDeinit Syntax error_code SMADCDeinit(u_int8 PortNr); Description This function frees the resources attached to this module if it was initialized. Input u_int8 PortNr Output error_code Example RetVal = SMADCDeinit(0); Page 5 - 84 ©1996 PEP Modular Computers GmbH Number of the port to de-initialize SUCCESS or standard OS-9 error code (refer to the OS-9 Technical Manual Error Codes Section).
  • Page 241: Isagraf Programming

    Chapter 5 Analog Modules 5.3.9 ISaGRAF Programming 5.3.9.1 The ISaGRAF Board Parameters Information on board parameters may be found in the PEP online help and ISaGRAF online help or user’s manual. Figure 5.3.9.1.1 a Typical Screen Section for the SM-THERM Module Logical Address The 4 inputs of this module may be clearly seen together with the logical address at which this particular board is residing.
  • Page 242: The Isagraf Operate Calls

    Chapter 5 Analog Modules SMART I/O User’s Manual 5.3.9.2 The ISaGRAF Operate Calls Operate calls are built into a program using ST or FBD languages when defining the project. A typical use could be at the initialization stage to check that the SMART-Modules are in fact located where they have been programmed to be.
  • Page 243 Chapter 5 Analog Modules A complete list of the operate COMMANDS may be obtained by selecting a project from the ISaGRAF projects group, opening an application and observing the Common defines in the Dictionary pull-down menu. Note that not all calls in the list may be used within the SMART I/O environment however, the calls applicable to this module are : O_INIT_CODE O_ENABLE_CONV...
  • Page 244 Chapter 5 Analog Modules SMART I/O User’s Manual This page has been left blank intentionally. March 12, 1996 Page 5 - 88 ©1996 PEP Modular Computers GmbH...
  • Page 245: Sm-Adc1

    Chapter 5 Analog Modules 5.4 SM-ADC1 5.4.1 Introduction The SM-ADC1 provides a fast, 12-bit, bipolar ( 10V DC), 6-channel analog to digital converter. Two configurable red LEDs on the front panel form the user interface while an on-board EEPROM stores unique calibra- tion data required by the signal converter.
  • Page 246: Front Panel Layout

    5.4.3 Front Panel Layout 5.4.4 Board Overview Component Side Multiplexers Page 5 - 90 ©1996 PEP Modular Computers GmbH Red LEDs User Descriptor Fields LED 1 LED 0 Optocouplers Logic Impedance Converter DC/DC EEPROM Optocouplers October 01, 1996...
  • Page 247: Functional Description

    Chapter 5 Analog Modules 5.4.5 Functional Description The SM-ADC1 has 6 differential voltage or current inputs depending on the ordered type. An on-board EEPROM contains board specific calibration data, module ID byte, sub ID byte and production data. A DC/DC converter generates the 5V to 15V power requirements for the ADC converter and provides additional system isolation.
  • Page 248: Screw Terminal Pinouts

    5.4.6 Configuration Although the SM-ADC1 has one solder jumper (J2) for EEPROM configura- tion, the user should not interfere with it. Jumper J4 likewise should not be interfered with as it is factory set at the time of ordering and controls the unipolar/bipolar mode of ADC operation . 5.4.7 Pinouts Screw Terminal Pinouts The following shows the pinout/signal relationship for the SM-ADC1 when...
  • Page 249 Chapter 5 Analog Modules Connection: Pin 1 Input Circuit: IN0P IN0N AGND October 01, 1996 SMART I/O User’s Manual Analog Sensors Pin 13 Pin 2 Pin 14 +15V 4.7 k MAX358 220 k MUX 1:8 1 nF +15V -15V 4.7 k MAX358 220 k MUX 1:8...
  • Page 250: C' Programming

    5.4.8 ‘C’ Programming 5.4.8.1 SM-ADC1 Library The SM-ADC1 library of functions smartio.l provide a convenient way of accessing the SM-ADC1 module. • All functions are written in ANSI C; • Prototypes are to be found in the file adc1lib.h. Hardware Requirements •...
  • Page 251: Smadc1Init

    Chapter 5 Analog Modules 5.4.8.2 SMADC1Init Syntax error_code SMADC1Init(u_int8 PortNr); Description This function initialises the SM-ADC1 Module on port PortNr, and: - tests the module’s ID - test the module’s sub-ID for the determination of bipolar or unipolar operation (voltage/current input) - reads the conversion table held in EEPROM - allocates space for the fetched resources Input...
  • Page 252: Smadc1Getvraw

    5.4.8.3 SMADC1GetVRaw Syntax error_code SMADC1GetVRaw(u_int8 PortNr, u_int8 Description This function fetches the conversion result of a selected channel without performing a gain or offset correction. The result is always a signed integer value. Input u_int8 PortNr u_int8 Channel int16 *pValue Output error_code Example...
  • Page 253: Smadc1Getv

    Chapter 5 Analog Modules 5.4.8.4 SMADC1GetV Syntax error_code SMADC1GetV(u_int8 PortNr, u_int8 Channel, Description This function fetches the conversion result of a selected channel. A gain and offset correction is performed and the result stored as a signed integer value. Input u_int8 PortNr u_int8 Channel int16 *pValue...
  • Page 254: Smadc1Setled

    5.4.8.5 SMADC1SetLed Syntax error_code SMADC1SetLed(u_int8 PortNr, u_int8 LedNr); Description This function switches on one of the two LEDs fitted to the SM-ADC1. Input u_int8 PortNr u_int8 LedNr Output error_code Example RetVal = SMADC1SetLed(0, 2); Page 5 - 98 ©1996 PEP Modular Computers GmbH SM-Port number to be accessed Number of the LED to switch on (1-2) SUCCESS...
  • Page 255: Smadc1Clrled

    Chapter 5 Analog Modules 5.4.8.6 SMADC1ClrLed Syntax error_code SMADC1ClrLed(u_int8 PortNr, u_int8 LedNr); Description This function switches off one of the two LEDs fitted to the SM-ADC1. Input u_int8 PortNr u_int8 LedNr Output error_code Example RetVal = SMADC1ClrLed(0, 2); October 01, 1996 SMART I/O User’s Manual SM-Port number to be accessed Number of the LED to switch off (1-2)
  • Page 256: Smadc1Deinit

    5.4.8.7 SMADC1DeInit Syntax error_code SMADC1DeInit(u_int8 PortNr); Description This function deinitialises the SM-ADC1 Module on the port PortNr by freeing the resources tied up with it and setting all outputs and inputs to zero. Input u_int8 PortNr Output error_code Example RetVal = SMADC1DeInit(0); Page 5 - 100 ©1996 PEP Modular Computers GmbH SM-Port number to de-initialise...
  • Page 257: Isagraf Programming

    Chapter 5 Analog Modules 5.4.9 ISaGRAF Programming 5.4.9.1 The ISaGRAF Board Parameters Information on board parameters may be found in the PEP online help and ISaGRAF online help or user’s manual. Figure 5.4.9.1.1 Typical Screen Section for the SM-ADC1 Module Logical Address The 6 inputs of this module may be clearly seen together with the logical address at which this particular board is residing.
  • Page 258: The Isagraf Operate Calls

    Chapter 5 Analog Modules SMART I/O User’s Manual 5.4.9.2 The ISaGRAF Operate Calls Operate calls are built into a program using ST or FBD languages when defining the project. A typical use could be at the initialization stage to check that the SMART-Modules are in fact located where they have been pro- grammed to be.
  • Page 259 Chapter 5 Analog Modules A complete list of the operate COMMANDS may be obtained by selecting a project from the ISaGRAF projects group, opening an application and observing the Common defines in the Dictionary pull-down menu. Note that not all calls in the list may be used within the SMART I/O environment however, the calls applicable to this module are : O_INIT_CODE O_ENABLE_CONV...
  • Page 260 O_ENABLE_LINE_CHECK: <analog var> := OPERATE(<iovar>, O_ENABLE_LINE_CHECK, where <analog var> represents the analog return variable and can <iovar> <var> O_DISABLE_LINE_CHECK: <analog var> := OPERATE(<iovar>, O_DISABLE_LINE_CHECK, where <analog var> represents the analog return variable and can <iovar> <var> Page 5 - 104 ©1996 PEP Modular Computers GmbH This operate call allows the user to enable open- loop checking on the current version of the SM-...
  • Page 261 Chapter 5 Analog Modules O_SET_LINE_LIMIT: <analog var> := OPERATE(<iovar>, O_SET_LINE_LIMIT, where <analog var> represents the analog return variable and can <iovar> <var> O_GET_LINE_STATE: <analog var> := OPERATE(<iovar>, O_GET_LINE_STATE, where <analog var> represents the analog return variable and is <iovar> <var> October 01, 1996 SMART I/O User’s Manual This operate call allows the user to set the open loop...
  • Page 262 Chapter 5 Analog Modules SMART I/O User’s Manual This page has been left blank intentionally. October 01, 1996 Page 5 - 106 ©1996 PEP Modular Computers GmbH...
  • Page 263: Sm-Dac1

    Chapter 5 Analog Modules 5.5 SM-DAC1 5.5.1 Introduction The SM-DAC1 provides a fast, 12-bit, bipolar ( 10V DC), 2/6-channel digital to analog converter. Two configurable red LEDs on the front panel form the user interface while an on-board EEPROM stores unique calibra- tion data required by the signal converter.
  • Page 264: Front Panel Layout

    5.5.3 Front Panel Layout Red LEDs 5.5.4 Board Overview Component Side Page 5 - 108 ©1996 PEP Modular Computers GmbH User Descriptor Fields LED 1 Current Sense DC/DC Circuitary LED 0 October 01, 1996...
  • Page 265: Functional Description

    Chapter 5 Analog Modules 5.5.5 Functional Description The SM-DAC1 has 2, 4 or 6 differential voltage or current outputs depending on the ordered type. An on-board EEPROM contains board specific calibra- tion data, module ID byte, sub ID byte and production data. A DC/DC converter generates the 5V to 15V power requirements for the D/A con- verter and provides additional system isolation.
  • Page 266 5.5.6 Configuration Although the SM-DAC1 has one solder jumper for EEPROM configuration, the user should not interfere with it. 5.5.7 Pinouts Screw Terminal Pinouts The following shows the pinout/signal relationship for the SM-DAC1 when connected to a particular screw terminal block. Pin 1 Pin Nr.
  • Page 267 Chapter 5 Analog Modules Connection: Pin 1 Pin 2 Current Output Circuit: October 01, 1996 SMART I/O User’s Manual Analog Sensors Pin 13 Pin 14 1/4 DG413 1/2 LT1112 ©1996 PEP Modular Computers GmbH +Vcc (24V) Gnd (0V) 0..20mA AGND Page 5 - 111...
  • Page 268 Voltage Output Circuit: Software Controlled Switch 1/4 DG413 -2.04V reference source for bipolar operation Page 5 - 112 ©1996 PEP Modular Computers GmbH 1/2 LT112 49k9 10V DC AGND October 01, 1996...
  • Page 269: C' Programming

    Chapter 5 Analog Modules 5.5.8 ‘C’ Programming 5.5.8.1 SM-DAC1 Library The SM-DAC1 library of functions smartio.l provide a convenient way of accessing the SM-DAC1 module. • All functions are written in ANSI C; • Prototypes are to be found in the file dac1lib.h. Hardware Requirements •...
  • Page 270: Smdac1Init

    5.5.8.2 SMDAC1Init Syntax error_code SMDAC1Init(u_int8 PortNr); Description This function initialises the SM-DAC1 Module on port PortNr, and: - tests the module’s ID - reads the conversion table held in EEPROM - allocates space for the fetched resources Input u_int8 PortNr Output error_code Example...
  • Page 271: Smdac1Openloop

    Chapter 5 Analog Modules 5.5.8.3 SMDAC1OpenLoop Syntax error_code SMDAC1OpenLoop(u_int8 PortNr, u_int8 Description This function should only be used for the current version of the SM-DAC1 module and checks the wires for open loop in a 4..20mA environment. The result is stored in a register with the following definition. Register value: 111110 101111 Input...
  • Page 272: Smadac1Operate

    5.5.8.4 SMADAC1Operate Syntax error_code SMDAC1Operate(u_int8 PortNr); Description This function powers up the outputs as they are disconnected from the screw terminals by default. This is the software control of the software switch shown in the schematics earlier in this section of the manual. Input u_int8 PortNr Output...
  • Page 273: Smdac1Standby

    Chapter 5 Analog Modules 5.5.8.5 SMDAC1StandBy Syntax error_code SMDAC1StandBy(u_int8 PortNr); Description This function places the module connected on Port PortNr in standby mode where the outputs are disconnected from the screw terminal block. Input u_int8 PortNr Output error_code Example RetVal = SMDAC1StandBy(0); October 01, 1996 SMART I/O User’s Manual SM-Port number to be accessed...
  • Page 274: Smdac1Putvraw

    5.5.8.6 SMDAC1PutVRaw Syntax error_code SMDAC1PutVRaw(u_int8 PortNr, u_int8 Description This function sets the selected DAC channel to the chosen value. No gain or offset correction is performed and the given value will always be masked to a 12-bit value. Input u_int8 PortNr u_int8 Channel u_int16 Value Output...
  • Page 275: Smdac1Putv

    Chapter 5 Analog Modules 5.5.8.7 SMDAC1PutV Syntax error_code SMDAC1PutV(u_int8 PortNr, u_int8 Channel, Description This function sets the selected DAC channel to the chosen value. A gain and offset correction is performed with the use of the automatically selected conversion table depending whether a user-defined table has been specified or not.
  • Page 276: Smdac1Setled

    5.5.8.8 SMDAC1SetLed Syntax error_code SMDAC1SetLed(u_int8 PortNr, u_int8 LedNr); Description This function switches on one of the two LEDs fitted to the SM-DAC1. Input u_int8 PortNr u_int8 LedNr Output error_code Example RetVal = SMDAC1SetLed(0, 2); Page 5 - 120 ©1996 PEP Modular Computers GmbH SM-Port number to be accessed Number of the LED to switch on (1-2) SUCCESS...
  • Page 277: Smdac1Clrled

    Chapter 5 Analog Modules 5.5.8.9 SMDAC1ClrLed Syntax error_code SMDAC1ClrLed(u_int8 PortNr, u_int8 LedNr); Description This function switches off one of the two LEDs fitted to the SM-DAC1. Input u_int8 PortNr u_int8 LedNr Output error_code Example RetVal = SMDAC1ClrLed(0, 2); October 01, 1996 SMART I/O User’s Manual SM-Port number to be accessed Number of the LED to switch off (1-2)
  • Page 278: Smdac1Deinit

    5.5.8.10 SMDAC1DeInit Syntax error_code SMDAC1DeInit(u_int8 PortNr); Description This function deinitialises the SM-DAC1 Module on the port PortNr by freeing the resources tied up with it and shuts down the outputs. Input u_int8 PortNr Output error_code Example RetVal = SMDAC1DeInit(0); Page 5 - 122 ©1996 PEP Modular Computers GmbH SM-Port number to de-initialise (from 0 to 10)
  • Page 279: Isagraf Programming

    Chapter 5 Analog Modules 5.5.9 ISaGRAF Programming 5.5.9.1 The ISaGRAF Board Parameters Information on board parameters may be found in the PEP online help and ISaGRAF online help or user’s manual. Figure 5.5.9.1.1 Typical Screen Section for the SM-DAC1 Module Logical Address One of the outputs of this module may be clearly seen together with the logical address at which this particular board is residing.
  • Page 280: The Isagraf Operate Calls

    Chapter 5 Analog Modules SMART I/O User’s Manual 5.5.9.2 The ISaGRAF Operate Calls Operate calls are built into a program using ST or FBD languages when defining the project. A typical use could be at the initialization stage to check that the SMART-Modules are in fact located where they have been programmed to be.
  • Page 281 Chapter 5 Analog Modules A complete list of the operate COMMANDS may be obtained by selecting a project from the ISaGRAF projects group, opening an application and observing the Common defines in the Dictionary pull-down menu. Note that not all calls in the list may be used within the SMART I/O environment however, the calls applicable to this module are : O_INIT_CODE O_SET_LED...
  • Page 282 O_DISABLE_CONV: This operate call tells ISaGRAF to disable the <analog var> := OPERATE(<iovar>, O_DISABLE_CONV, 0); where <analog var> represents the analog return variable and can <iovar> O_GET_LINE_STATE: <analog var> := OPERATE(<iovar>, O_GET_LINE_STATE, where <analog var> represents the analog return variable and is <iovar>...
  • Page 283: Communications Modules

    Chapter 6 Communications Modules SMART I/O User’s Manual Communications Modules SMART I/O March 12, 1996 ©1996 PEP Modular Computers GmbH Page 6 - 1...
  • Page 284 Table of Contents 6. Communications Modules ...6-5 6.1 SM-RS232 ... 6-5 6.1.1 Introduction ... 6-5 6.1.2 Specifications ... 6-5 6.1.3 Front Panel Layout ... 6-6 6.1.4 Board Overview ... 6-6 6.1.5 Functional Description ... 6-7 6.1.6 Configuration ... 6-8 6.1.7 Pinouts ... 6-8 6.1.8 ISaGRAF Programming ...
  • Page 285 Chapter 6 Communications Modules 6.2.8 MATCH Function ... 6-26 6.2.9 Tested Sensors ... 6-26 6.2.10 Configuration ... 6-27 6.2.11 Pinouts ... 6-27 6.2.12 ‘C’ Programming ... 6-29 6.2.12.1 SM-SSI Library ... 6-29 6.2.12.2 SMSSIInit ... 6-30 6.2.12.3 SMSSIDeInit ... 6-31 6.2.12.4 SMSSISetSetPoint ...
  • Page 286 Chapter 6 Communications Modules SMART I/O User’s Manual This page has been left blank intentionally. March 12, 1996 Page 6 - 4 ©1996 PEP Modular Computers GmbH...
  • Page 287: Communications Modules

    Chapter 6 Communications Modules 6. Communications Modules 6.1 SM-RS232 6.1.1 Introduction The SM-RS232 provides serial communication observing a true RS232 interface definition. Interface parameters such as baud rate, stop bits, data bits and parity are defined by software. The hardware itself supports baud- rates up to 120 kbaud but the delivered software only allows rates up to 19200 baud.
  • Page 288: Board Overview

    6.1.3 Front Panel Layout Yellow LED Green LED 6.1.4 Board Overview Component Side Transceiver Page 6 - 6 ©1996 PEP Modular Computers GmbH User Descriptor Fields SM-RS232 1 Serial Interface LED 1 Inverter EEPROM LED 0 March 12, 1996...
  • Page 289: Functional Description

    Chapter 6 Communications Modules SMART I/O User’s Manual 6.1.5 Functional Description Figure 4.3.5.1: SM-RS232 Schematic Diagram System Driver Interface The serial interface is realized using the TxD3 and RxD3 lines of the 68302 SCC3 port on the SMART-BASE and for this reason this module can only be used in the first slot on the SMART-BASE.
  • Page 290: Configuration

    6.1.6 Configuration Jumper J1 - EEPROM Protection Jumper S e t t i n g s open 6.1.7 Pinouts Screw Terminal Pinouts The following shows the pinout/signal relationship for the SM-RS232 when connected to a particular screw terminal block. Pin 1 Pin Nr.
  • Page 291 Chapter 6 Communications Modules Connection Interface System Interface March 12, 1996 SMART I/O User’s Manual DTR CTS User Interface Connector ©1996 PEP Modular Computers GmbH Page 6 - 9...
  • Page 292: Isagraf Programming

    6.1.8 ISaGRAF Programming 6.1.8.1 The ISaGRAF Board Parameters Information on board parameters may be found in the PEP online help and ISaGRAF online help or user’s manual. Figure 6.1.8.1.1 Typical Screen Sections for the SM-RS232 Module Logical Address This particular module is accessed over an OS-9 device descriptor and driver which are already present in EPROM on the SMART-BASE.
  • Page 293 Chapter 6 Communications Modules char_length : stop_bits : parity : baud_rate : xon_char : xoff_char : eor_char : The input and output devices are represented by keyboard and display respectively. March 12, 1996 SMART I/O User’s Manual This represents the number of data-bits within a transmitted character and may be 5, 6, 7 or 8 The number of stop-bits supported by the communi- cation protocol may be :...
  • Page 294: The Isagraf Operate Calls

    Chapter 6 Communications Modules SMART I/O User’s Manual 6.1.8.2 The ISaGRAF Operate Calls Operate calls are built into a program using ST or FBD languages when defining the project. A typical use could be at the initialization stage to check that the SMART-Modules are in fact located where they have been programmed to be.
  • Page 295 Chapter 6 Communications Modules A complete list of the operate COMMANDS may be obtained by selecting a project from the ISaGRAF projects group, opening an application and observing the Common defines in the Dictionary pull-down menu. Note that not all calls in the list may be used within the SMART I/O environment however, the calls applicable to this module are : O_INIT_CODE O_SERIAL_READ...
  • Page 296: Programming

    6.1.9 OS-9 Programming Due to the fact that the device descriptor for the serial I/O is burnt into EPROM, it cannot be over-written with new values. Therefore a copy has to be generated in RAM where the parameters may be manipulated. This procedure is only useful for those users who wish to alter the default param- eter settings.
  • Page 297 Chapter 6 Communications Modules modify the settings, for example:- $ xmode baud=19200 cs=7 par=none /scc3 check that the system has taken the parameters:- $ xmode/scc3 /scc3 noupc bsp bsl echo if null=0 pause pag=24 bsp=08 del=18 eor=0D eof=1B reprint=04 dup=01 psc=17 abort=03 quit=05 bse=08 bell=07 type=00 baud=19200 xon=11 xoff=13 tabc=09 tabs=4 refer to the OS-9 help page for parameter descriptions by using the follow-...
  • Page 298 Chapter 6 Communications Modules SMART I/O User’s Manual This page has been left blank intentionally. March 12, 1996 Page 6 - 16 ©1996 PEP Modular Computers GmbH...
  • Page 299: Sm-Ssi

    Chapter 6 Communications Modules 6.2 SM-SSI 6.2.1 Introduction The SM-SSI is an optoisolated single-channel, 24-bit RS422 interface for absolute encoders. Configurable data input together with flexibility afforded by software configurable encoder types transforms this SMART Module into an intelligent interface suitable for the most demanding applications. Data flow is indicated by the presence of two red LEDs on the front panel.
  • Page 300: Front Panel Layout

    6.2.3 Front Panel Layout Red LEDs 6.2.4 Board Overview Component Side EEPROM Page 6- 18 ©1996 PEP Modular Computers GmbH User Descriptor Fields An option to install a 12-bit DAC on a special piggyback is reserved for future use. LED 1 Crystal PROM Optocouplers...
  • Page 301: Functional Description

    Chapter 6 Communications Modules 6.2.5 Functional Description Figure 6.2.5.1: SM-SSI Schematic Diagram EEPROM STXD SRXD SCLK SPI Bus P1-5 Lines NRESET Reset Line NINT Line The Synchronous Serial Interface working together with a photographically etched encoder disk allows absolute codes (positions) of rotating axis to be continuously monitored.
  • Page 302: Ssi Operation

    6.2.6 SSI Operation With reference to figures 6.2.6.1 and 6.2.6.2, the operation of the SSI inter- face will be discussed. • The position of the encoder disk is continuously clocked. • Position data is ready for conversion by the parallel -> serial converter. •...
  • Page 303 Chapter 6 Communications Modules • The first HIGH to LOW clock edge (1) in figure 6.2.6.1, triggers the monoflop and allows the current parallel data word present in the parallel -> serial converter to be processed. The monoflop prevents other data transfers to this parallel to serial converter. •...
  • Page 304: Register Description

    6.2.7 Register Description The SM-SSI SMART-Module connected to a SMART I/O slot uses the SPI transparent mode for on-board data reading and writing and 5 parallel lines for data selection. On board are a set of registers and peripherals shown in the table below: N o .
  • Page 305: Ctrl1 Register

    Chapter 6 Communications Modules 6.2.7.2 CTRL1 Register CTRL1-7 CTRL1-6 ENIO-P enable / disable (1 / 0) interrupt on parity error ENI1-TC enable / disable (1 / 0) interrupt on transmission complete ENI2-EOR enable / disable (1 / 0) interrupt on end-of-range switch 1 / 2 ENI3-MH enable / disable (1 / 0) interrupt on comparison match direction control (‘1’...
  • Page 306: Compare Register

    6.2.7.5 Compare Register This 24-bit register indicates the comparison value and is cleared after a power-on reset. 6.2.7.6 Identification Register The identification register is read only and fixed at a value of $81. 6.2.7.7 Status Register The 16-bit status register is divided into two sub-registers which are partly cleared after a power-on reset and show: •...
  • Page 307: Stat2 Register

    Chapter 6 Communications Modules Interrupt pending flags (IP0 - IP4) are set by the interrupt source if the corresponding line is not masked in the CTRL1 register. All flags are cleared when the STAT1 register is read. 6.2.7.9 STAT2 Register S T 2 - 7 S T 2 - 6 unused...
  • Page 308: Match Function

    6.2.8 MATCH Function The match output, which is useful for detecting when an event occurs, is set using an A > B comparator where: A = the SSI data B = the compare register The MATCH output is set on an edge transition of the comparator output as follows: When counting up: When counting down: MATCH is set when A passes from (A>B) to (A<=B)
  • Page 309 Chapter 6 Communications Modules 6.2.10 Configuration Jumper J1 - EEPROM Protection Jumper 6.2.11 Pinouts Screw Terminal Pinouts The following shows the pinout/signal relationship for the SM-SSI when connected to a particular screw terminal block. Pin Nr. Signal CLK+ DATA- COM+ RESET- EORC EOR1...
  • Page 310: Input Circuit

    Connection Pin 1 Pin 2 Input Circuit Encoder Schmitt- Parallel-Serial Wheel Trigger Converter Photo Photo Parallel Transmitter Receiver Data Page 6- 28 ©1996 PEP Modular Computers GmbH Pin 13 Pin 14 Input Monoflop Switch Clock Shift Serial Data Driver +Vcc (24V) Gnd (0V) SM-SSI October 01, 1996...
  • Page 311: C' Programming

    Chapter 6 Communications Modules 6.2.12 ‘C’ Programming 6.2.12.1 SM-SSI Library The SM-SSI library of functions smartio.l provide a convenient way of accessing the SM-SSI module. • All functions are written in ANSI C; • Prototypes are to be found in the file ssilib.h. Hardware Requirements •...
  • Page 312: Smssiinit

    6.2.12.2 SMSSIInit Syntax error_code SMSSIInit(u_int8 PortNr); Description This function initializes the SM-SSI Module on port PortNr, resetting and clearing the status of registers and allocating resource memory. Input u_int8 PortNr Output error_code Example RetVal = SMSSIInit(0); Page 6- 30 ©1996 PEP Modular Computers GmbH SM-Port to initialize (from 0 to 10) SUCCESS...
  • Page 313: Smssideinit

    Chapter 6 Communications Modules 6.2.12.3 SMSSIDeInit Syntax error_code SMSSIDeInit(u_int8 PortNr); Description This function deinitializes the SM-SSI Module on the port PortNr by freeing the resources tied up with this module. Input u_int8 PortNr Output error_code Example RetVal = SMSSIDeInit(0); October 01, 1996 SMART I/O User’s Manual SM-Port number to de-initialize (from 0 to 10)
  • Page 314: Smssisetsetpoint

    6.2.12.4 SMSSISetSetPoint Syntax error_code SMSSISetSetPoint(u_int8 PortNr, Description This function copies the setpoint to an internal register which will only be sent to the SM-SSI when the function SMSSISetCtrlReg() is called. This function is used to set the preset value for the comparator if testing for a match.
  • Page 315: Smssisetctrlreg

    Chapter 6 Communications Modules 6.2.12.5 SMSSISetCtrlReg Syntax error_code SMSSISetCtrlReg(u_int8 PortNr, long CtrlReg1, long CtrlReg2, long CtrlReg3, u_int32 *pData); Description This function sets the internal register images of all 3 parts of the 24-bit control register with values <> -1 and sends them to the SM-SSI. Simultane- ously, the contents of the data register holding the last value is read back to the address pointed to by pData.
  • Page 316: Smssigetstatus

    6.2.12.6 SMSSIGetStatus Syntax error_code SMSSIGetStatus(u_int8 PortNr, Description This function reads the status of the module selected on port PortNr. Input u_int8 PortNr u_int8 *pStatus1 u_int8 *pStatus2 Output error_code Example RetVal = SMSSIGetStaus(0, &Status1, &Status2); Page 6- 34 ©1996 PEP Modular Computers GmbH u_int8 *pStatus1, u_int8 *pStatus2);...
  • Page 317: Smssigetdata

    Chapter 6 Communications Modules 6.2.12.7 SMSSIGetData Syntax error_code SMSSIGetData(u_int8 PortNr, Description This function returns the absolute position data from the SM-SSI. If auto- matic mode is selected then a wait will not be performed otherwise SOT will be set and the read performed only when TC has been set. Input u_int8 PortNr u_int32 *pData...
  • Page 318: Isagraf Programming

    6.2.13 ISaGRAF Programming 6.2.13.1 The ISaGRAF Board Parameters Because this module has not been defined as a physical board in the ISaGRAF project, it has been created as a function block as shown in figure 6.2.13.1.1. Figure 6.2.13.1.1 Function block of the SM-SSI Module Command One of: FB_SSI_INIT...
  • Page 319 Chapter 6 Communications Modules FB_SSI_READ As can be seen from figure 6.2.11.1.1, the inputs to the module are displayed on the left-hand side of the SSI block and the outputs are indicated on the right-hand side. setpoint port ctrx error position statusx October 01, 1996...
  • Page 320 Chapter 6 Communications Modules SMART I/O User’s Manual This page has been left blank intentionally. October 01, 1996 Page 6- 38 ©1996 PEP Modular Computers GmbH...

This manual is also suitable for:

Modular computers rs232Smart i/o

Table of Contents