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...
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’...
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...
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.
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.
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.
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.
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.
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.
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.
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...
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...
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.
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.
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.
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.
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.
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...
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.
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...
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...
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...
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...
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.
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.
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.
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 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).
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.
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.
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.
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...
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.
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.
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.
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...
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.
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.
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...
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).
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).
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.
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...
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.
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’...
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.
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.
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...
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.
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.
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’.
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...
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 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...
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.
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.
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.
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.
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.
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.
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:...
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...
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 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.
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.
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.
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.
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...
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 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.
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 •...
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:...
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.
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.
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);...
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.
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)
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.
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...
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.
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.
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 ..
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.
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)
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).
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);...
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...
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.
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.
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.
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...
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.
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.
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.
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.
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.
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.
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...
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...
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.
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...
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.
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.
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...
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.
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)
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).
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.
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.
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.
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.
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.
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.
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.
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...
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.
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.
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.
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.
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.
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.
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...
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.
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.
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...
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 •...
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...
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...
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...
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)
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.
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 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...
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.
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.
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 •...
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...
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...
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...
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...
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...
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.
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)
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.
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>...
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.
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.
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.
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 :...
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...
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-...
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.
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.
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. •...
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 .
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: •...
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...
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...
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 •...
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)
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.
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.
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...
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...
Need help?
Do you have a question about the Modular Computers RS485 and is the answer not in the manual?
Questions and answers