background image

APPENDIX D: PCI-AC51 TECHNICAL REFERENCE

PCI-AC51 User’s Guide

39

39

Register Description 

Reset Status Register (0x00) 

The Reset Status Register reports the reset state (Reset Level, 

bit 0) and the status of a 150 ms timer (Reset Busy, bit 7). The timer provides the application a way to 
ensure a minimum reset duration for all Pamux brains. The timer is reset (and the Reset Busy Bit set 
to 1) when register 0x00 (Reset Control Register) is written. When the duration expires, the Reset 
Busy Bit is set to 0.

Reset Control Register (0x00)  

Bit 0 drives the reset signal on the Pamux bus. Writing a 1 

asserts the reset signal to the “high level.” Writing a 0 asserts the reset signal to the “low level.”

Bank Address Register (0x01)  

The Pamux address for the next Pamux read/write cycle is 

stored in this register. This register must not be modified while the Busy Bit of the Status Register is 
set to 1.

Data Register (0x02)  

Do not access this register while a Pamux operation is in progress.

Writing

: The data to be written in the next Pamux write cycle should be stored in this register before 

the Pamux write cycle is finished.

Reading

: After the Pamux read cycle is complete, this register holds the data that was read from the 

Pamux brain.

Start Read Register (0x03)  

A read initiates a Pamux read bus cycle. Reading from this register 

initiates a Pamux read. The bank Address Register must be configured before reading from this 
register. A value of 0xAB is always returned in this register and can be ignored. The data read from 
the Pamux brain is returned in the Data Register. Do not access this register while a Pamux operation 
is in progress.

Start Write Register (0x03)  

Writing to this register initiates a Pamux write cycle. The Bank 

Address Register and the Data Register must be configured before writing to this register. Do not 
access this register while a Pamux operation is in progress.

Status Register (0x04)  

This register contains the Busy bit (busy = 1), to indicate if a Pamux bus 

cycle is in progress. The ID bits hold the value of the last brain communicated with. These bits are 
valid only after the Busy bit is 0. The Write Status bit is 1 if the current or last Pamux bus cycle was a 
Pamux write cycle. The Read Status bit is 1 if the current or last Pamux bus cycle was a Pamux read.

Switch Register (0x05)  

Provides state of the switches on the PCI-AC51. Custom driver 

applications may use S1 through S4 in any desired fashion. S5 and S6 may be verified for proper 
hardware settings.

Version Register (0x06)  

Returns the version of the state machine architecture.

Summary of Contents for PCI-AC51

Page 1: ...siness Park Drive Temecula CA 92590 3614 Phone 800 321 OPTO 6786 or 951 695 3000 Fax 800 832 OPTO 6786 or 951 695 2712 www opto22 com Product Support Services 800 TEK OPTO 835 6786 or 951 695 3080 Fax 951 695 3017 Email support opto22 com Web support opto22 com ...

Page 2: ...1142245 French Patent No 1142245 British Patent No 1142245 Japanese Patent No 2002535925A German Patent No 60011224 Opto 22 FactoryFloor Optomux and Pamux are registered trademarks of Opto 22 Generation 4 ioControl ioDisplay ioManager ioProject ioUtilities mistic Nvio Nvio net Web Portal OptoConnect OptoControl OptoDataLink OptoDisplay OptoEMU OptoEMU Sensor OptoEMU Server OptoOPCServer OptoScript...

Page 3: ...Windows 7 and Vista 14 Using the SDK on Windows 2000 XP 14 SDK Contents 14 Pamux Functions 15 Required Function Calls 15 Naming Conventions 15 Banks and Points 15 Common Function Parameters and Return Values 15 Developing an I O Application 16 Special Directions for Visual Basic Programmers 16 Special Directions for Visual C Programmers 16 Function Reference for Windows 2000 XP 17 PCI AC51 Operati...

Page 4: ...35 Converting Applications that Use Inp and Outp 35 Appendix D PCI AC51 Technical Reference 37 Architecture 38 PCI Identification 38 PCI Base Address Configuration 38 BAR1 Register Table 38 Register Description 39 Powerup Conditions 40 Controlling the Reset Line 40 Controlling the Reset Line Using the Pamux Driver 40 Controlling the Reset Line When Not Using the Pamux Driver 40 Default Power Up St...

Page 5: ...ss up to 32 remote brains Each Pamux bus supports up to 512 points Free with these adapter cards is the PCI AC51 Pamux SDK included on the CD that came with the card and also available on our website www opto22 com The PCI AC51 Pamux SDK supports up to 32 PCI AC51 adapter cards This file includes two SDKs Windows 7 and Vista operating systems samples source code and the driver This SDK supports C ...

Page 6: ...the PCI AC51 adapter card It also shows the location and function of the card s LEDs Appendix C Converting Applications to the PCI AC51 describes how to convert applications that used the AC28 and PCI AC28 adapter cards Appendix D PCI AC51 Technical Reference provides technical information for authoring a device driver for an unsupported operating system or a Windows kernel mode driver For Help If...

Page 7: ...CHAPTER 1 INTRODUCTION PCI AC51 User s Guide 3 3 third party devices installed for example barcode readers Software and version being used Specific error messages and or numbers seen ...

Page 8: ...FOR HELP PCI AC51 User s Guide 4 ...

Page 9: ...e you install the SDK software The PCI AC51 adapter card installs into any PCI expansion slot of a computer Note the power requirements listed in the Specifications table on page 32 1 Turn off the computer Remove the power cord and the computer s cover The power cord must be removed as a sudden spike may cause the computer to boot 2 Before handling the card discharge excess static electricity by t...

Page 10: ...ed by the BIOS when the card is installed If you are using Windows Vista or an earlier version of Windows and a Found New Hardware message appears simply click Cancel The setup program will install the device driver automatically If you have been using an AC28 adapter card for the ISA bus you will need to make some changes to your application because of the new PCI adapter card See Appendix C Conv...

Page 11: ...dapter cards Running the SDK Setup Program The PCI AC51 SDK comes on a CD with the card If you do not have the CD you can order it through Product Support or you can download the SDK free from our website www opto22 com This PCI AC51 Pamux SDK includes a sample application Windows drivers and user documentation NOTE If you are using a different operating system or a non PC hardware platform you wi...

Page 12: ...UP PROGRAM PCI AC51 User s Guide 8 There is a 64 bit version and a 32 bit version for Windows 7 and Vista 4 If a Windows Security dialog box appears click the Run or Install button to continue Select the operating system ...

Page 13: ...cture The SDK supports C VB NET and other NET languages NOTE Version 2 0 and higher support only the PCI AC51 not the AC28 and PCI AC28 adapter cards Using the PamScan Utility The PamScan utility is available on the Windows Start menu It demonstrates turning digital points on and off and configuring points as either input or output In addition analog point values can be displayed and output values...

Page 14: ...result on the card s LEDs The program flashes the LEDs five times If no flashing occurs you may have selected the wrong card Select the next card in the list and click the Flash LEDs button again 6 Click OK to close the dialog box In the PamScan graphical user interface GUI click Open PCI AC51 This screen shows all four banks available on a 32 channel Pamux board Each bank has eight I O points and...

Page 15: ...ank s address on the mounting rack In the following example 5 is entered as the address to match the address on the mounting rack 8 Select the I O type either Analog or Digital 9 For output modules select each point that is an output then click Configure Selected Points As Outputs The first bank on the attached rack has an address of 0 Match the bank s address on the rack Select the I O type ...

Page 16: ... selected click Turn Selected Output Points On Notice that the selected output points change from Off to On 11 Continue to experiment as you like with selecting points configuring points as inputs or outputs and turning points on and off Developing an I O Application Your application should include the following basic steps Select outputs Click here Theselectedpoints change to Output Click here Th...

Page 17: ...oints using the WriteConfig function Inspect the error code from the configuration function 5 Start an application loop that continuously reads or writes points At the same time continue to inspect the error codes from the PCIAC51 dll 6 When the application loop is complete call ReleaseCard to close the card properly Function Reference for Windows 7 and Vista The function reference for the Windows...

Page 18: ...your existing application 5 For Deployment To run the old program on Windows 7 or Vista use the files as follows OptoPM32 dll Put this file in the same directory as your application wdapi1031 dll Put this file in the same directory as your application NOTE for VB Applications Be sure to register any OCX files For example to register the file COMCT232 OCX open a command prompt with run as administr...

Page 19: ...re PamuxDigPoint the object is first and Read the operation follows Utility functions provided primarily for Visual Basic start with PamuxUtil Example PamuxUtilBitEqual Specific PCI AC51 functions start with PamuxPCI Banks and Points Some I O points can be addressed in multiple ways A 16 channel I O board has two banks Point 0 the first point is accessed using a bank number of 0 and a point number...

Page 20: ...L 5 When the application loop is complete close the handle to the board using PamuxPCICardClose Special Directions for Visual Basic Programmers Include the OptoPM32 bas file as a module in your project This file includes subroutine declarations function declarations and access paths to the OptoPM32 dll These files may be found in the SDK under Vb VB dll header Special Directions for Visual C Progr...

Page 21: ... card phHandle gets a handle BoardID is the PCI AC51 ID The first PCI AC51 is at ID 0 ResetLevel 1 high reset 0 low reset Set the reset level to match the reset level configured on the Pamux brains This function does not reset the Pamux bus long BoardID long ResetLevel long PamuxPCICardClose long hHandle Releases the handle to the PCI AC51 and turns on LEDs 1 and 2 long PamuxCardReset long hHandle...

Page 22: ...ter in PamuxDig BankConfig indicates how many banks to configure Byte Qty 4 for 32 points long Bank long OutputMask long Byte Qty long PamuxDigBank16Config long hHandle long Bank long OutputMask long PamuxDigBank32Config long hHandle long Bank long OutputMask long PamuxDigBankRead long int hHandle Reads inputs and outputs and places the result in pData Use PamuxDig BankRead for reading eight point...

Page 23: ...he value in pData The value is either 1 for on or 0 for off long Bank long Point long pData long PamuxDigPointWrite long hHandle Writes to a point using the value in Data A non zero value for Data turns the point on long Bank long Point long Data Note for Visual Basic users indicates a by reference argument Function Type Function Parameter Type Parameter Description long PamuxDigIoPortGet long hHa...

Page 24: ...long PamuxAnaBank16Write long hHandle Writes values to a bank of analog points channel 0 value in element 0 long Bank long DataArray16 Note for Visual Basic users indicates a by reference argument Function Type Function Parameter Type Parameter Description long PamuxAnaPointConfig long hHandle Configures an analog point as either an input or output A non zero value to bOutput configures the point ...

Page 25: ...reset the watchdog error flag if it has tripped This and any other ana log function can be used to tickle the watchdog to prevent it from tripping long Bank long Time100 Note for Visual Basic users indicates a by reference argument Function Type Function Parameter Type Parameter Description long PamuxAnaStatusGetAsError long hHandle Gets an analog board s status and returns an equivalent error Ana...

Page 26: ... end of the parameter name BitNumber0 serves as a reminder of this fact for anyone looking through the function definitions in either the BAS file or the H header files PamuxUtilBitTest returns true if bit number BitNumber0 in Data is set long BitNumber0 long bBitValue void PamuxUtilBitSet long pData long BitNumber0 void PamuxUtilBitClr long pData long BitNumber0 long PamuxUtilBitTest long Data lo...

Page 27: ...n 0 and FFF hex 4 095 decimal These values typically correspond to engineering units such as pH and psi For example to convert raw counts from 0 to FFF hex to a percentage use float fPercent PamuxUtilScaleI2F 0 0xFFF 0 0 100 0 RawCount long X2 long Y1 long Y2 long Xin float PamuxUtilScaleI2F long X1 long X2 float Y1 float Y2 long Xin float PamuxUtilScaleF2F float X1 float X2 float Y1 float Y2 floa...

Page 28: ...the reset line is LOW 0 VDC The reset line is considered to be HIGH when the voltage on the reset line is HIGH 3 5 to 5 0 VDC Brain Reset Configuration Active HIGH and Active LOW Each Pamux brain has a jumper to configure whether the brain will reset when the reset line is HIGH or LOW This is referred to as reset Active HIGH or reset Active LOW If the brains are jumpered for reset Active HIGH then...

Page 29: ... to 32 PCI AC51 cards to be used Only a single handle to a card is permitted If you use a multiple threaded application implement a mutex on the handle to avoid thread collision If multiple applications are required to access the hardware another application is required to synchronize the access Multiple applications cannot access the PCI AC51s simultaneously ...

Page 30: ...SPECIAL PRECAUTIONS FOR THE SOFTWARE DEVELOPER PCI AC51 User s Guide 26 ...

Page 31: ...n Remedy 0 0x0000 No Error Occurred Not an error 8192 0x2000 Invalid Handle The handle that was passed to the OptoPM32 DLL is invalid The handle may represent a closed handle or the value of the handle may be corrupted Inspect when the handle flaw is first detected and ensure that the handle was allocated with a successful open Also trace a sudden change in the value of the handle The handle shoul...

Page 32: ... This may represent corruption of the handle failure to success fully open the handle or a PamuxPCICardClose may have been previously executed on this handle 8205 0x200D A handle number out of range tried to be used The handle submitted is invalid as it is beyond the number of handles the OptoPM32 DLL supports Inspect the han dle for corruption Also validate that the handle number does not change ...

Page 33: ...requested PCI board doesn t exist or the device layer is improp erly configured With a DOS prompt box try the command wdreg install If this command fails reinstall the SDK Otherwise call Prod uct Support 8390 0x20C6 The PCI board failed to register with the PCI BIOS Try on a system with a newer PCI BIOS or see if the manu facturer has a PCI BIOS or BIOS ugrade for the system Code Decimal Code Hex ...

Page 34: ...ERROR CODES FOR WINDOWS 2000 XP PCI AC51 User s Guide 30 ...

Page 35: ...e location and function of the card s LEDs System Requirements Here s what you need to install and run the software provided for the PCI AC51 A computer with x86 compatible processor 1 GHz or higher The most recent version of BIOS must be installed Microsoft Windows 7 Professional 32 bit or 64 bit Windows Vista Business 32 bit or Windows XP Professional 32 bit with Service Pack 2 or higher ...

Page 36: ...bit 33 MHz PCI bus SDK compatibility Microsoft Windows 2000 XP supports Visual Basic 6 and Visual C 6 Windows 7 and Vista 32 bit and 64 bit supports C VB NET and other NET languages PCI compliance PCI Specification Revision 2 2 Opto 22 brain compatibility B4 B5 B6 SNAP B4 SNAP B6 LEDs Four indicating board access reset level read and write Operating temperature 0 to 70 C Storage temperature 30 to ...

Page 37: ...he state of the reset line which can be either High or Low On High LED2 Blinks when the PCI AC51 is accessed LED3 Blinks when a Pamux write is executed LED4 Blinks when a Pamux read is executed NOTE IfthePCI AC51israpidlyorcontinuallyaccessed theblinkingindicatorsmayappeartostickon will not blink This is normal LED 1 Reset line state On High LED 2 Hardware accessed LED 3 Write LED 4 Read ...

Page 38: ...LEDS PCI AC51 User s Guide 34 ...

Page 39: ...erting Applications that Use Inp and Outp This PCI SDK library provides a consistent application code model for Windows 2000 and Windows XP operating systems Inp and Outp function calls at the user level are unsupported because of the Windows hardware abstraction layer The PCI AC51 interfaces to the existing Pamux interface by mimicking the 50 wire IDC connector and the Pamux timing interface The ...

Page 40: ...CONVERTING APPLICATIONS THAT USE INP AND OUTP PCI AC51 User s Guide 36 ...

Page 41: ...you use this information at your own risk Opto 22 does not support any kernel layer or drivers other than those we provide In this appendix Architecture page 38 PCI Identification page 38 PCI Base Address Configuration page 38 Register Description page 39 Powerup Conditions page 40 Controlling the Reset Line page 40 DIP Switches page 41 Strobe Duration page 42 High and Low Latency Modes page 42 Pe...

Page 42: ...ddress Register 1 BAR1 is memory mapped It is configured as a 16 consecutive byte only array Only the first 7 bytes are used Accessing unmapped registers may cause the computer to bus lock BAR1 Register Table An X indicates that data is ignored Offset Direction Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 0x00 R Reset Status Register Reset Busy X X X X X X Reset Level 0x00 W Reset Control ...

Page 43: ...lds the data that was read from the Pamux brain Start Read Register 0x03 A read initiates a Pamux read bus cycle Reading from this register initiates a Pamux read The bank Address Register must be configured before reading from this register A value of 0xAB is always returned in this register and can be ignored The data read from the Pamux brain is returned in the Data Register Do not access this ...

Page 44: ... You can also reset the brains in the system and take the brains back out of reset using a single function which does a 150 mSec rest ResetBrainsAndReturnToNormal Controlling the Reset Line When Not Using the Pamux Driver Bit 0 of the Reset Control Register on the PCI AC51 is used to control the reset line When bit 0 is set to 0 the reset line will be HIGH and LED 1 will be ON When bit 0 is set to...

Page 45: ... establish communication with the PCI AC51 card and brains DIP Switches The PCI AC51 has six DIP switches the DS1 bank The DIP switches may be modified on a system that is powered however the applications that use the PCI AC51 must be stopped A switch in the ON position will read as a zero and OFF will read as a one Switches 1 through 4 are provided for custom implementation One common use will be...

Page 46: ...ble Performing Pamux Operations Issuing Pamux Reset The PCI AC51 provides a level oriented reset control feature 1 Assert the Pamux Reset by writing a value to the Reset Control Register BAR1 offset 0x00 bit 0 A zero sets the Pamux reset level to low A one sets the Pamux reset level to high 2 Poll the status register and inspect the state of Reset Busy Wait for the bit to negate return to zero The...

Page 47: ...tten to the register is ignored 5 Read the Status Register BAR1 offset 4 and inspect the Busy Bit Bit 0 If the bit is one a Pamux cycle is in progress Do not modify the Bank Address Register Data Register or the Start Cycle Register while the busy status is asserted Wait until the Busy Bit negates 6 To read the Pamux brain identification read the Status Register BAR1 offset 4 and mask bits 1 and 2...

Page 48: ...before the next register operation occurs 3 For PCIAC51 dll use Set Slow Mode Delay and Enable Slow Mode to control the timing of operations If you are using the OptoPM32 dll for the PCI AC51 use the Pamux_Set_Slow_Bank_Range function 4 If high speed digital is required use a SNAP B4 and separate the analog and digital I O Alternate Method OptoPM32 dll only Create a text file named o22_pamux_slow_...

Reviews: