Home

Single-Slot PC Interface Module (PCIM) User`s Manual

image

Contents

1. low hex digit 8 1 46354 Ax me gi switches high switches middle switches low digit digit digit 12 3456 7 8 0 0 2 go 1 1 s 6 og 2 d 2 od A 3 Ho 7 o7 3 Be E d 4 ge Ue xb oc 5 HB 05 E 6 Hoo TT 7 8 means down toward board ogg gon 9 means up away from board ogg oogR A CE m B moo wd od C d ate UN D a ME E PCIM Installation Power OFF the Host computer and unplug from power source Install the PCIM according to the computer manufacturer s instructions for option cards Connect the bus see next page to the PCIM DO NOT m 0 qe cd m Mount the PCIM where air flow across it is obstructed Mount the PCIM nearer than 1 8 318cm to any other boards or rack components m Use adhesives or conformal coatings on any part of the PCIM 3 2 Single Slot PCIM User s Manual January 1994 GFK 0881 Connecting the Bus Devices can be placed in any physical sequence on the bus Each connector on the PCIM has four terminals for the bus cable Serial 1 Serial 2 Shield In and Shield Out Note that the sequence of these terminals on a PCIM connector is not the same as on other bus devices for example I Oblocks 46355 oo Lt Shield Out ES e Bus Connector for I Daughterboard A Shie
2. oo BB LEDs for Daughterboard B Daughterboard OK Bus Connector for Communications OK gt Daughterboard B E Co Openings in the faceplate accommodate the serial bus connectors for the PCIM daughterboard s E ul LJ shown 50 actual size Chapter 1 Introduction 1 3 Genius I O System Overview The Genius I O is a system of inherently distributed inputs and outputs which consists of Genius I O Blocks AC DC Isolated Analog and others mounted at the point of control A Bus Controller which serves as the interface between the Genius I O system and a programmable controller and or A PCIM for interface with IBM PC ATs XTs or CIMSTARI A Hand Held Monitor the portable diagnostic and configuration tool used for addressing trouble shooting monitoring scaling and configuring the I O Blocks And the Genius Serial Bus which provides communications between the Bus Controller Hand Held Monitor and up to 30 I O Blocks over a single shielded twisted wire pair Normally Genius I O will be controlled by a PLC in machine control and fast closed loop control applications There are various applications however where systems based on Genius I O blocks will be utilized with IBM PC products Genius I O Blocks provide superior built in Diagnostics which detect open circuits short circuits overloads and a v
3. 0 0 000 c cece ee eens 4 3 C Software Driver Function Call Parameters 0 000 eee 4 4 InitIM Setup and Activate PCIM 00 cee eee eee 4 15 ChgIMSetup Change PCIM Configuration 0 20 4 18 GFK 0881 Single Slot PCIM User s Manual January 1994 vil Contents GetIMState Get Configuration and Status Information 4 20 GetBusConfig Get Serial Bus Configuration 0 0c cea 4 22 GetDevConfig Get Device Configuration llslsssseseessss 4 24 DisableOut Disable Enable Device Outputs eeeessessses 4 26 GetBusIn Read all Input Values 0 coe 4 28 PutBusOut Write all Output Values 0 0 eee 4 30 GetDevIn Read Device Data Only 0 06 cece nee 4 32 PutDevOut Write Device Data Only 0 60 c cece 4 34 GetIMIn Read Directed Input Table 0 00 o eee eee 4 36 PutIMOut Write the Global Output Table 0 0 0 c cee 4 37 GetCir Read Input Circuit Value 2 0 4 38 PutCir Write Output Circuit Value 2 eee 4 40 GetWord Read Input Word Value 2 eee 4 42 PutWord Write Output Word Value 0 occ eee 4 44 SendMsg Send a Message 6 eens 4 46 SendMsgReply Send a Message Requesting a Reply 4 4 48 ChkMsgStat Read Message Progress Status 0 00 cc cece 4 50 GetMsg Read Received Mess
4. Make sure cabling is not in proximity to high voltage runs Look for a broken cable Single slot PCIM User s Manual January 1994 If both LEDs off Check to see if the PCIM is plugged in seated properly and receiving power Check voltage receiving level of RST It must remain at 2 4 volts or higher TTL logic 1 If both LEDs flashing together Two devices on the same bus have probably been configured with the same device number serial bus address Check using the HHM m Repeated bus errors Ensure that cable shielding is properly installed and grounded see Genius I O System and Communciations User s Manual GEK 90486 1 Unplug bus communications cable from PCIM refer to the Device number sheets from which you configured the system and use the HHM to read configuration compare device numbers and I O reference numbers If all appears to be in order replace PCIM m System shuts down with parity errors Duplicate or overlapping PCIM I O References Input duplicated on same bus Input references from other PCIMs overlap m Bus Errors cannot get PCIM up and running Serial 1 Serial2 crossed W Intermittent or total lack of communications Mixed Baud Rates Power up blocks one at a time and confirm baud rate Any change to baud rate in block will not take effect until block power is cycled
5. January 1994 GFK 0881 Status Value GETMSG will return SUCCESS if a memory or non memory message is returned to you Otherwise one of the following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 IMBUSY The PCIM is otherwise engaged and cannot accept the command NOMSG No message is available to be received at this time TXERR A message transmission has failed or response to SendMsgReply has not arrived after 10 seconds PCIMERR There may be a problem with the PCIM firmware BADPARM Syntax error from previous SendMsgReply See Also SENDMSGREPLY SENDMSG and CHKMSGSTAT GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 51 GETINTR CALL Statement 5 52 Syntax CALL GETINTR STATUS IMNUM INTR 0 Action Read Interrupt Status Table Description The Get Interrupt call allows you to read the selected PCIMs Interrupt Status Table You can read this table to m See why an interrupt in the Host system has occurred m Report the event in a non interrupt environment as is the default state of the Software Driver concept the PCIM will still report the event even though the interrupt is disabled Thus the Interrupt Status Table can be polled by reading and interpreting it to determine what is causing an interrupt from the PCIM
6. When GETINTR is called it transfers the data from the PCIMs Interrupt Status Table to the Host memory INTR parameter The format of the Interrupt Status Table is shown below IMNUM defines the PCIM as configured during initialization from which the Interrupt Status Table is to be read The INTR parameter is the buffer where the Interrupt Status Table information is stored The values in the table below are 0 No interrupt occurred 1 Interrupt occurred The format of the INTR table is Position Explanation INTR Summary if interrupt occurred INTR Received memory datagram INTR PCIM Status Change usually fatal 0 1 2 INTR 3 Device Status Change 4 Outputs sent end of bus access 5 Command Block completed 6 Received Datagram After data transfer to the Host is complete GETINTR clears all of the PCIMs Interrupt Status Table bytes each time it is called This way you can see the latest event that has occurred each call Parameters are summarized as follows Parameter Value Function IMNUM 1 64 Relative number of PCIM INTR see above Buffer where the table data will be stored Status Success fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value GETINTR will return SUCCESS if the device specified by IMNUM is present on the serial bus If the target device is not present or is out of range GETINTR will return FAIL The following FAIL in
7. m No Global Data Destination device off line Verify destination on line m Unsuccessful Datagram completion Destination device off line Verify destination on line GFK 0881 Chapter 7 Troubleshooting 7 3 Appendix A Example Application 1 Example Applications This programming example uses the InitIM and GetDevConfig function calls Example devices include two PCIMs connected to a serial bus The PCIMs have the following Configurations The IMPARMS Structure is defined in PCIM H PCIM 2 Serial Bus Address IMPARMS Segment IMPARMS IOPort IMPARMS IMRef IMPARMS OutputLength IMPARMS InputLength IMPARMS Active PCIM 1 Serial Bus Address IMPARMS Segment IMPARMS IOPort IMPARMS IMRef IMPARMS OutputLength IMPARMS InputLength IMPARMS Active 30 Dec D000 Hex 3E4 Hex 3434 Hex 0 0 ON 31 Dec CC00 Hex 3E0 Hex 1212 Hex 0 0 ON These are the only two devices on our example Genius bus The GetBusConfig function can be used for any device on the bus by giving the Serial Bus Address device number of the device desired If the Device given is not online GetDevConfig will return OFFLINE 11 This example can be built using MicroSoft C Compiler Ver 4 0 or greater with the following syntax C MSC gdctst Zp C LINK gdctst pcim include lt stdio h gt include lt pcim h gt PCIM header file extern int InitIM ChglIMSetup
8. parameter is a buffer data read will be located The size of this buffer is determined by the InputLength parameter located in the device s configuration data Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM DEVICENUM 0 31 Specifies device on serial bus from which input data will be read LENGTH 0 128 Size of data buffer DEVDATA variable Buffer where data in Host stored see above STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value GETDEVIN will return SUCCESS if the device specified by IMNUM is present on the serial bus and after the data is transferred to the DEVDATA buffer If the target device is not present or is out of range the following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus de vices 0 31 decimal or is that of the PCIM NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The device requested is currently not on the bus and data is NOT transferred Coding Example Get the inputs from device 8 on PCIM 1 2300 IMNUM 1 2310 DEVICENUM 8 2320 Call GETDEVCONFIG STATUS IMNUM DEVICENUM DEVDATA 0 2330 LENGTH DEVCONFIG 4 2340 Call GETDEVIN STATUS IMNUM DEVICENUM LENGTH DEVCONFIG 0 GFK 0881 Chapter 5 BASIC Program
9. unsigned int IMnum unsigned int Devicenum DEVICE Config Description The Get Device Configuration call allows you to read device configuration information about a specific device on the serial bus GetDevConfig reads this information from the PCIM selected by IMnum into the Host memory Config parameter which should point to a character buffer with the format of one DEVICE structure Again the format of Config is unsigned char Model Model Number of device unsigned char OutputDisable Output disable flag unsigned char Present Device Present flag unsigned int Reference Status Table or Reference Address unsigned char InputLength Control Input Data Length unsigned char OutputLength Control Output Data Length unsigned char Config Device Configuration 1 all inputs 2 all outputs 3 combination Device Configuration Not Used Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Devicenum 0 31 Specifies device on serial bus Config 8 bytes Device configuration information about all devices on a serial bus see above Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status GetDevConfig will almost always return SUCCESS If the target PCIM is currently offline has not been initialized or is out of range the following FAIL indications will be returned B
10. 0 1 Enable Disableutputs char Datalngth 0 128 Character pointer to size of data buffer char DevData 0 128 Character pointer to a buffer where data to be written will be located char State 0 1 ON or OFF condition of circuit read from PCIM GFK 0881 Chapter 4 C Programming for the PCIM 4 13 4 14 Macros for Return Values for All Calls The following Macros are used as as return values for all calls Macro Value Explanation define SUCCESS 0 Successful completion of function define INITFAIL 1 InitializationFailure define IMFAIL 2 PCIM Failure define BADSEG 3 InvalidSegmentaddress define BADPORT 4 InvalidI OPort Address define BADCFG 5 InvalidConfigurationparameter define NOCFG 6 No Configuration changes found define NOINIT 7 PCIM selected is not initialized define NODATA 8 No data found define UNDERFLOW 9 Insufficient device data length define OVERFLOW 10 Exceeds device data length define OFFLINE 11 Device is offline define IMBUSY 12 PCIMbusy define BADPARM 13 Invalidmessageparameter define TXERR 14 Messagetransmitfailure define NOMSG 15 NoMessageavailable define IMFREE 16 Nomessage activity define BADSBA 17 Invalid Serial Bus Address define BADIMNUM 18 Invalid PCIM Number define PCIMERR 19 PCIM firmwareproblem define DUPSEG 20 Duplicatesegments given define DUPPORT 21 DuplicateI Oportvalues giv
11. 2140 IF MSGSTATUS lt gt 0 THEN 2170 Ilf MSGSTATUS is anything else go to 2170 pn and decode 2170 CALL CHKMSGSTAT STATUS IMNUM MSGSTATUS Did SENDMSG get on the bus 2180 IF STATUS lt gt 0 THEN 2170 If STATUS is anything other than 0 go to 2190 2170 and decode 2200 IF MSGSTATUS 12 THEN 2110 PCIM is busy stay in this loop and go 2210 sback to 2110 2220 If MSGSTATUS lt gt 0 THEN 2170 If MSGSTATUS is anything other than O 2230 go to 2170 and decode 2240 RETURN The SENDMSG call was executed properly If 2250 SENDMSGREPLY the reply msg is ready to 2260 read with GETMSG 2270 CLS Clear Screen 2280 PRINT STATUS MSGSTATUS Interpret the code for STATUS and or 2290 message status Single Slot PCIM User s Manual January 1994 GFK 0881 GFK 0881 A Address selection DIP switches in software Auxiliary Request Queue B 10 B BASIC programming 5 1 Baud Rate 3 12 7 3 Broadcast Control Output Table 2 5 Bus EE on reading p a j f connection to 1 2 1 3 B 3 errors overview Bus controller termination 8 4 C C programming Catalog numbers Changing the setup parameters l2 1 18 5 2 5 14 ChgIMSetup 4 2 4 18 5 2 ChkMsgStat 4 3 4 50 5 3 5 48 Clear Reset Request COMM OK status Command Block Compiling a C program Computer compatible types Configuration example 8 13 Configuration choices Configurati
12. 8001 h IMparms 1 OutputLength 20 No Global Data IMparms 1 InputLength 0 No Directed Input data IMparms 1 Active ON Turn PCIM 2 ON by default status InitIM COUNT IMparms IMflags GFK 0881 Chapter 4 C Programming for the PCIM 4 17 ChglMSetup Change PCIM Configuration Code Summary include lt pcim h gt int ChgIMSetup IMnum IMparms unsigned int IMnum IMPARMS IMparms Description Following initialization any changes you make to the configuration of a specific PCIM must use the Change PCIM Setup call This call allows you to make configuration changes to a specific PCIM Setup Table by writing the IMparms parameter from Host memory to it The IMnum parameter is an index to the IMparms array which after initialization indicates the specific PCIM in the host system for which configuration changes are intended Note Configuration changes to any PCIM while online causes that PCIM to stop transmitting on the serial bus for 1 5 seconds The format of IMPARMS is IM1 Segment Address of PCIM shared RAM two bytes LSB MSB IM1 TI O Port Address two bytes LSB MSB IM1 PCIM Global Reference two bytes LSB MSB IM1 Global data length one byte IM1 Input data length reserved one byte always set to 0 IM1 Active one byte 1 ON 0 OFF IM2 Segment Address of PCIM shared RAM two bytes LSB MSB IM2 TI O Port Addr
13. BUSCONFIG 6 Config Device Configuration 1 all inputs 2 all outputs 3 combination 46365 Device Configuration Not Used Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM BUSCONFIG 224 entries Device configuration information about all 7 per device devices on the bus see above STATUS Success Fail 5 20 Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value GETBUSCONFIG will almost always return SUCCESS If the target IM is currently offline has not been initialized or is out of range the following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE None of the devices specified are currently active on the bus However the appropriate buffer is still returned and will con tain configuration data for devices once logged in Zeros will be returned if no device has logged in to a particular slot Coding Example Examine the configuration of the devices on PCIM 1 1100 IMNUM 1 1110 Call GETBUSCONFIG STATUS IMNUM BUSCONFIG 0 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 21 GETDEVCONFIGCALL Statement Syntax CALL GETDEVCONFIG STATUS IMNUM DEVICENUM DEVCONFIG 0 Action Get Device Configurat
14. Coding Example Send a Read Diagnostics message to device 8 on PCIM 1 This message will read 10 bytes of diagnostic data beginning at offset 0 include lt pcim h gt int status SEND_MESSAGE Msg Msg Destination 8 Device 8 Msg Function 0x20 Genius Function Code Msg SubFunction 8 Read Diagnostic Subfunction Code Msg Priority NORMALP Transmit at Normal priority Msg Length 2 Length of data in Data Buffer Msg Data 0 0 Offset of 0 Msg Data 1 OxA Length of 10 decimal status SendMsg 1 amp Msg To see how message function calls work together see Appendix A Example 2 GFK 0881 Chapter 4 C Programming for the PCIM 4 47 SendMsgReply Send a Message Requesting a Reply 4 48 Summary include lt pcim h gt int SendMsgReply IMnum Msg int IMnum SEND MESSAGE REPLY Msg Description The Send Message Reply call allows you to write a memory or non memory message from the Host to the selected PCIM for transmission onto the bus using the Transmit Datagram With Reply command SendMsgReply will return control to the calling program without waiting for the reply You must call ChkMsgStat or GetMsg to check for completion or to read the reply message IMnum defines the PCIM as configured during initialization from which to transmit the message The Msg parameter is a pointer to the buffer where the transmit message is stored The format of SEND MESSAGE REPLY is De
15. DEVICENUM 0 31 Specifies I O device to which output will be written CIROFFSET 1 1024 Output circuit offset in specified I O device in bits STATE 0 1 Variable STATE is written from the Host memory to the specified PCIM STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value PUTCIR will return SUCCESS if the target device is present on the given IMNUM If the target device is not present or is out of range PUTCIR will return FAIL If SUCCESS is returned then the character pointed to by STATE will contain the value of the circuit changed The following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus de vices 0 31 decimal or is that of the PCIM NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The device requested is currently not on the bus and data is NOT transferred OVERFLOW The Offset specified is greater than the devices Output Length in circuits UNDERFLOW The Offset is specified as zero 0 Coding Example Set the state value of circuit 2 of device 8 on PCIM 1 to 1 3200 IMNUM 1 3210 DEVICENUM 8 3220 STATE 1 3230 CIROFFSET 2 3240 Call PUTCIR STATUS IMNUM DEVICENUM CIROFFSET STATE GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 39 GETWORDCALL Statement 5 40 Syntax CALL GETWORD
16. NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE No devices are currently on the bus however the appropri ate buffer is still returned and will contain input data for de vices once logged in Coding Example Read all inputs from all active devices on PCIM 1 include lt pcim h gt int status unsigned char lOdata status GetBusln 1 lOdata GFK 0881 Chapter 4 C Programming for the PCIM 4 29 PutBusOut Write all Output Values Code Summary include lt pcim h gt int PutBusOut IMnum lOdata unsigned int IMnum unsigned char lOdata Description The Put Bus Outputs call allows you to update outputs to all devices in the Output Table of the specified PCIM All output values are written from the Host memory IOdata parameter IOdata must point to a 4096 byte buffer where the I O information is saved The IOdata parm has the same format as the Output Table 32 slots of 128 bytes each Slots are in serial bus address order When PutBusOut is called it begins by locking out the PCIM from updating its Output Table ensures data coherency across PCIM scans PutBusOut then transfers all data from IODATA to the Output Tables When the entire PCIM Output T ble has been searched the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM lOdata 4096 bytes Data parameter
17. That is the fourth fifth Select Disabled and sixth digits of the hexadecimal address for the start of the memory space must be 0 The third digit must always be 0 4 8 or C So valid memory addresses for the start of the block could be F4C000 288000 0E0000 etc I Obase If the daughterboard will The I O Base Address is a hexadecimal address be used enter a hexadeci used for PCIM command and status data Address mal address The next field described in chapter 2 The address is truncated should be set to Enabled down to the nearest 4 byte boundary That is the Enabled Disabled third digit of the address must be a 0 4 8 or C If the daughterboard will not be used it is not neces sary to enter an address Select Disabled Interrupt Not used with the Soft IRQ2 and IRQ9 are the same pin on the ware Library select Dis motherboard connector IRQ is used by PC XTs able when using the li IRQ9 is used by PC ATs and all new PCs Either brary routines may be selected for configuration If not using the Software Do not select IRQ3 if serial port 2 is installed Library select Enabled f x and enter the Interrupt Do not select IRO4 if serial port 1 is installed TRQ2 Do not select IRQS if parallel port 2 is installed IROS e Do not select IRQ6 if a diskette controller is IRQ5 present IRQ6 IRQ9 10 and 11 are only present on 286 386 and d 486 PCs IRO10 IRO11 NMI is normally not selected NMI non ma
18. struct IMBOARD im Board values for PCIM unsigned int IMRef Status Table or Reference Address unsigned char OutputLength Broadcast I O Data Length unsigned char InputLength Directed I O Data Length unsigned char Active Turn ON or OFF PCIM IMPARMS The following Macros are to be used with the functions InitlM and the ChglMSetup define ON 1 Active set ON will enable the PCIM define OFF 0 Active set OFF will disable the PCIM Single Slot PCIM User s Manual January 1994 GFK 0881 The following template is to be used with the function GetlMState typedef struct unsigned char DipSwitch GENI Board Dip Switch value unsigned int IMRef Reference Address unsigned char OutputLength Output Control Data Length unsigned char InputLength Input Control Data Length unsigned char Revision GENI Revision Number unsigned char GENI OK every 200mS set to one unsigned char Fault Overall fault byte unsigned char Active Hand Held Monitor Present unsigned int SBerr Serial Bus error count unsigned int ScanTime Bus Scan Time in milliseconds IMSTATE p The following Macros are to be used with the function GetlMStatus and define the position of the Fault byte 3 define RAMERR 0 define EPROMERR 1 define CPUERR 2 define COMMERR 3 define SBAMAS
19. Basic language specified as a set of function calls in order to allow a consistent interface with both languages Library software is delivered in the form of object code in a single exe COM file This user s guide covers both C language and Basic language applications The PCIM Software Library is supplied in a version compatible the MSDOS operating system as follows C MSDOS BASIC MSDOS Single Slot PCIM User s Manual January 1994 GFK 0881 Chapter 2 Operation PCIM Electrical Characteristics Power Supply Requirements The PCIM requires a 5 volt DC source for logic power Supply voltage should not vary more than 10 above or below nominal below 4 5 V DC or above 5 5 V DC or the PCIM will not function correctly The PCIM with one daughterboard single channel PCIM typically draws 1 0 Amps The PCIM with two daughterboards dual channel PCIM typically draws 1 5 Amps Bus Loads Drive Capability Allinput lines to the PCIM present no more than one standard LSTTL load to the host interface connector All output lines from the PCIM are capable of driving 10 standard LSTTL loads These lines with the exception of the INT and PCIM OK lines are tri state outputs The INT line is an open collector output that can be wired ORed to a single interrupt input The PCIM OK and COMM OK lines are low true open collector type outputs with built in current limiting to 10 ma suitable for driving LEDs directly All input s
20. Byte 3E0 1 3E1 PCIM Control Byte Bit definitions for the Status Byte and Control Byte are given on the following pages Single Slot PCIM User s Manual January 1994 GFK 0881 GFK 0881 PCIM Status Byte Bit Definitions The individual bits in the PCIM Status byte have the following functions 71 6 5 4 3 2 11 0 unlabelled bits not used 46352 L Low voltage host Reset detect Watchdog Timer status Interrupt request PCIM OK Communications OK 0 Low Voltage Host RESET Detect This input goes to 0 and stays 0 until reset whenever the voltage on the motherboard drops below 3 12 volts or the Host system has gone into RESET This bit is reset by the 1 bit of the PCIM Output byte see next page During normal operation this bit should be 1 Note Do not enable interrupts or read write to the PCIM for 2 seconds the period of time required for hardware software initialization after reset One false interrupt occurs within this time period Reading or writing to the PCIM during this time may cause the watchdog timer to time out The PCIM OK flag will be invalid during this period of time 1 Watchdog Timer Status Not used with the software library This bit is 1 if the watchdog timer as been enabled by the configuration software and is being pulsed every 727mS by PCIM Control bit 0 see next page If the timer expires this bit goes to 0 It will also go to
21. DISABLEINTR 0 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 55 Chapter Communications 6 Introduction PCIM applications may be considered on two levels basic operation consisting of that which is necessary to set up the PCIM and use it as a simple I O controller and advanced operation Advanced operation details the use of expanded diagnostics message handling and other more sophisticated features a class of applications dependent on the Genius I O Network for low cost peer to peer moderate performance communications between Hosts and I O devices Chapters 4 and 5 outlined the basic operational level providing you with enough information to code the PCIM Software Driver function calls and run a system consisting of I O blocks Chapter 6 explains the advanced communications features of the PCIM Global Data Global Data is data used for communicating data between CPUs simply automatically and repetitively Once set up by the user at power up assigned data is automatically and periodically routed among CPUs without further user programming Such data is termed Global Data since it is broadcast to all other CPUs on the bus and thus allows the formation of a global data base Up to 128 bytes may be broadcast by each PCIM or Bus Controller The PCIM or Bus Controller will broadcast these bytes once per bus scan A block of data is assigned to be broadcast by downloading a Global Data Referen
22. GetBus Config Macro Value Explanation Inthevariable Output Disable define ENABLE 0 Enable Outputs to a device define DISABLE 1 Disable Outputs to a device define ALL 32 Value to select all devices define MAXDEVICE 32 Maximum devices per PCIM define MAXIMS 64 Maximum number of PCIMs In the value Present define PRESENT 1 Device Present on PCIM define NOTPRESENT 0 Device Offline from PCIM In the value Config define INPUT 1 Input Data Only Device define OUTPUT 2 Output Data Only Device define COMBO 3 Input and Output Data Device Single Slot PCIM User s Manual January 1994 GFK 0881 Data Structures for Communications Read Message The following data structures are to be used for the ReadMsg function call Type Name Range Description unsignedchar Source 0 31 Serial Bus Address of device unsignedchar Function normally20 h for Function Code Geniusmessages unsignedchar SubFunction hexvalue Sub Function Code See GEK 90486 2 unsignedchar DB Indicator 1 0 Message type Directed 1 Broadcast 0 unsigned char Length 0 134 Length of message in bytes unsigned char Data 134 Actual Message Data in bytes Data Structures for Communications Send Message The following data structures are to be used for the SendMsg function call Type Name Range Description unsigned char Desti
23. GetDevConfig IMPARMS local 2 PCIM Configuration Structure allocate an element per PCIM in your PC char flags 2 Error return for PCIM Init allocate an element per PCIM in your PC DEVICE config Device Config Structure 32 may be allocated define PCIM1 amp local 0 Macro for easier remembering define PCIM2 amp local 1 Macro for easier remembering main int ret X y loop 1 printf n nThis is a test of the GetDevConfig function n print nTurning on two PCIMs n n Initialize the PCIM 1 Parameters local 0 im Segment 0xCC00 local 0 im IOPort 0x3E0 local 0 IMRef 0x1212 local 0 OutputLength 0 local 0 InputLength 0 loca 0 l Active ON Initialize the PCIM 2 Parameters local 1 im Segment 0xD000 local 1 im IOPort 0x3E4 local 1 MRef 0x3434 local 1 OutputLength 0 local 1 InputLength 0 local 1 Active ON if ret InitIM 2 local flags SUCCESS printf nInitlM returned d ntest exit ret loop 0 while loop Single Slot PCIM User s Manual January 1994 GFK 0881 k lis From PCIM 1 which is SBA 31 GetDevConfig uration for SBA 30 which in this case is PCIM 2 This can be used for any devices on the bus if ret GetDevConfig 1 30 amp config SUCCESS returned an error code probably 7 or 11 look in PCIM H for Error R
24. I O service times unless Normal Priority datagrams are used Your application must service the Datagram queue at least once every 10 milliseconds to ensure that the Datagram queue will not fill up causing datagrams to be dropped without Host notification Use the Software Driver function calls GetMsg SendMsg SendMsgReply and ChkMsgStat to transmit Datagrams For the the bit byte format of the following specific Genius I O Datagrams see the Genius I O System and Communications Manual GEK 90486 1 The following Datagrams are transmitted to and from I O blocks Report Fault faults are reported as they occur to the defined Controller of a specific I O block or device The controller of a device is the device which sends outputs to the device The GetMsg call is used to access this message from the PCIM Clear Circuit Fault the Host may clear a single circuit or controller fault using this message The Host requires a SendMsg call to transmit this message to an I O Block Clear All Circuit Faults the Host may clear all circuit faults using this message The Host again requires a SendMsg call to transmit this message Write Configuration downloads either partial or full configuration from the Host to an I O Block or other bus device The Host requires a SendMsg call to transmit this message to an I O Block GFK 0881 Chapter 6 Communications 6 3 Read Diagnostics Read Diagnostics Reply allows the Host to read the curre
25. Message cannot be transmitted Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM MSGSTATUS 0 1 Returned message status STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value CHKMSGSTAT will normally return the Status requested and a SUCCESS indication Other wise one of the following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 PCIMERR There may be a problem with the PCIM firmware See Also SENDMSGREPLY SENDMSG and GETMSG Coding Example Check the message status area of PCIM 1 4200 IMNUM 1 4210 Call CHKMSGSTATUS STATUS IMNUM MSGSTATUS To see how the message function calls work together see Appendix A Example 2 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 49 GETMSG CALL Statement 5 50 Syntax CALL GETMSG STATUS IMNUM MSG 0 Action Read Received Message Description The Get Message call allows you to read a received memory or non memory message or a reply to a previous SENDMSGREPLY call from the selected PCIM into the Host memory MSG parameter IMNUM is the PCIM number configured during initialization The MSG parameter is the buffer where the received message will be stored The format of GETMSG is MSG 0
26. PCIM from Host memory GetDevIn read control data inputs from a selected bus device into Host memory PutDevOut write control data outputs to a selected bus device from Host memory GetIMIn reads all PCIM control data from Directed Control Input Table of selected PCIM into Host memory PutIMOut writes all PCIM control data to Global Data Table of selected PCIM from Host memory GetCir reads an input circuit value variable into the Host memory from the Input Table of a selected PCIM GetWord reads an input word value variable into the Host memory from the Input Table of a selected PCIM PutCir writes an output circuit value variable from the Host memory to the Output Table of a selected PCIM PutWord writes an output word value variable from the Host memory to the Output Table of a selected PCIM Single Slot PCIM User s Manual January 1994 GFK 0881 Functions that deal with communications GetMsg reads a received message from a selected PCIM into Host memory SendMsg writes a message from Host memory to the PCIM for transmission onto the bus SendMsgReply writes a message from Host memory to the PCIM for transmission onto the bus and expects a specified reply message from the destination ChkMsgStat allows the Host to detect when a transmitted message has actually been completed or if transmission is incomplete or has failed Functions that deal with interrupt processing G
27. STATUS IMNUM DEVICENUM CIROFFSET WORDDATA Action Read Input Word Value Description A Get Word call allows you to read the value of a single input word from the specified PCIMs Input Table into the Host memory WORDDATA parameter The WORDDATA parameter is an integer IMNUM is the PCIM number configured during initialization The DEVICENUM parameter specifies the serial bus address of the device where the input word is located The CIROFFSET parameter indicates which word of the specified device is to be read This value ranges from 1 through 64 in word quantities When GETWORD is called it begins by Locking out the PCIM from updating the Shared RAM ensures data coherency across bus scans GETWORD then transfers the word data into Host memory Once the transfer is complete the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM DEVICENUM 0 31 Specifies I O device from which input word will be read OFFSET 1 64 Input word offset in specified I O device in words WORDDATA 1 entry Word requested STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value GETWORD will return SUCCESS if the device specified by IMNUM is present on the serial bus and after the data is transferred to WORDDATA If the target device is not present or is out of range GETWORD will return FAIL If SUCCESS is returned then the requested w
28. Source 0 31 Source address of Device MSG 1 Function code 0 111 Function Code MSG 2 SubFunction code 0 255 Sub Function Code MSG 3 DB Indicator Directed 1 Broadcast 0 MSG 4 Length 0 134 Data field length length of message MSG 5 Data variable Message Data length per MSG 4 Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM STATUS Success Fail MSG see above Buffer where the received message will be stored GETMSG performs the following sequence 1 Tf there is a previous call to SENDMSGREPLY GETMSG checks to see if the transmission has successfully completed and transfers the response back to you If the response completed with an error or if in progress GETMSG will return a FAIL indication 2 If there is no previous call to SENDMSGREPLY GETMSG checks to see if there is a memory message and transfers that message back to you 3 If no memory messages exist then GETMSG checks to see if there is a non memory message and transfers that message back to you 4 If no messages are present GETMSG returns with a FAIL status Note Unsolicited memory or non memory Datagrams received by the PCIM may not be read by the Host while a SENDMSGREPLY is in progress This significantly affects Host response time to service received Datagrams If this is a problem use the SENDMSG call instead of SENDMSGREPLY Single Slot PCIM User s Manual
29. allows you to write Global Data from the Host memory IMdata parameter to the Global Data Output Table of a specified PCIM This data is subsequently broadcast to all CPUs on the bus every bus scan IMnum is the PCIM number configured during initialization The IMdata parameter is a character pointer to a buffer where the data to be written is located The size of this buffer is determined by the OutputLength Global Data Length parameter located in the PCIM s configuration data When PutIMOut is called it begins by locking out the PCIM from reading from its Output Table ensures data coherency across bus scans PutIMOut then transfers all the data from this parm to the PCIMs Global Output buffer Once the transfer is complete the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM IMdata variable Character pointer to a buffer where the data is located Length of buffer is equal to output length as specified in InitIM Return Value Status PutIMOut will return SUCCESS if the Global Data Length is non zero and the transfer is complete The following FAIL indications will be returned BADIMNUM Mnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 UNDERFLOW The GlobalLength parameter in IMPARMS is set to zero 0 Coding Example Write
30. an entry point into the Genius I O System for the IBM PC AT XT family The PCIM is an AT style board designed to be integrated into a user developed microprocessor system It is fully compatible with all Genius protocols mechanical electrical levels and communications timing 46350 Bus Connector for Daughter daughterboard A daughterboard B motherboard board A Bus Connector e for Daughter board B The PCIM is available with either one or two daughterboard s Each PCIM daughterboard provides a low cost tap on a Genius I O bus allowing a host system to control remote I O utilizing the extensive diagnostics high reliability and noise immunity of the Genius I O System Each daughterboard is independently configurable using the configuration software supplied with the PCIM Board edge connectors are used to connect the PCIM to the Genius bus If the PCIM has two daughterboards they can be connected to the same bus or to independent busses 1 2 Single Slot PCIM User s Manual January 1994 GFK 0881 GFK 0881 Daughterboard Motherboard Faceplate A PCIM daughterboard is a general purpose I O Controller for the Genius I O System It provides a convenient method to control devices on the Genius serial bus The PCIM daughterboard performs the housekeeping tasks of initialization and fault management for up to 30 bus devices k
31. circuit 21 if discrete block 3400 IMNUM 1 3410 DEVICENUM 8 3420 CIROFFSET 2 3430 WORDDATA amp H10 3440 Call PUTWORD STATUS IMNUM DEVICENUM CIROFFSET WORDDATA GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 43 SENDMSG CALL Statement 5 44 Syntax CALL SENDMSG STATUS IMNUM MSG 0 Action Send a Message Description The Send Message call allows you to write a memory or non memory message from the Host to the selected PCIM for transmission onto the serial bus using the Transmit Datagram command SENDMSG will return control to the calling program without delay before the message has been processed or transmitted by the PCIM IMNUM defines the PCIM as configured during initialization from which to transmit the message The MSG parameter is the buffer where the transmit message is stored The format of SENDMSG is MSG 0 Destination 0 31 255 brdcst Destination address of Device MSG 1 Function code 0 111 Function Code normally 20 hex MSG 2 SubFunction code 0 255 Sub Function Code MSQG 3 Priority 0 Normal 1 High MSG 4 Length Data field length length of msg MSG 5 Data variable Message Data length per MSG 4 You should check the status of the message using CHKMSGSTAT to determine if the message completed processing properly Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM MSG see above B
32. devices Output Length in circuits UNDERFLOW The Offset is specified as zero 0 Coding Example Set the State value of circuit 2 of device 8 on PCIM 1 to 1 include lt pcim h gt int status status PutCir 1 8 2 Char 1 GFK 0881 Chapter 4 C Programming for the PCIM 4 41 GetWord Read Input Word Value 4 42 Code Summary include lt pcim h gt int GetWord IMnum Devicenum Offset Worddata unsigned int IMnum Devicenum unsigned int Offset unsigned int Worddata Description A Get Word call allows you to read the value of a single input word from the specified PCIM s Input Table into the Host memory Worddata parameter The Worddata parameter is an integer pointer which GetWord uses to store the word requested IMnum is the PCIM number configured during initialization The Devicenum parameter specifies the serial bus address of the device where the input word is located The Offset parameter indicates which word of the specified device is to be read This value ranges from 1 through 64 in word quantities When GetWord is called it begins by locking out the PCIM from updating the Shared RAM ensures data coherency across bus scans GetWord then transfers the word data into Host memory Once the transfer is complete the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Devicenum 0 31 Specifies I O device fro
33. following status codes will be returned in the appropriate location in the IMflags parameter if the return code is INITFAIL Each status value in the IMflags array is unique to the associated PCIM and does not reflect the status of any other PCIM SUCCESS This PCIM has been powered up and configured as specified IMFAIL This PCIM never powered up BADCFG This PCIM rejected the configuration because a parameter was out of range BADSEG The segment value in IMparms is set to the illegal value 0 zero BADPORT The I O port address is set to some illegal value less than 256 Note If any of the PCIMs fail to initialize as you have specified in IMparms InitIM turns OFF the failed PCIM 4 16 Single Slot PCIM User s Manual January 1994 GFK 0881 Coding Example In this example there are two PCIMs include lt pcim h gt define COUNT 2 int status char IMflags COUNT IMPARMS IMparms COUNT IMparms 0 im Segment OxD000 Shared RAM begins at DOOO h IMparms 0 im IOPort Ox3E4 Port Base Address at 3E4 h IMparms 0 IMRef 0x7000 PCIM Global Reference 7000 h IMparms 0 OutputLength 0 No Global Data IMparms 0 InputLength 0 No Directed Input data IMparms 0 Active ON Turn PCIM 1 ON by default IMparms 1 im Segment 0xCCO00 Shared RAM begins at CCOO h IMparms 1 im IOPort Ox3EO0 Port Base Address at 3E0 h IMparms 1 IMRef 0x8001 PCIM Global Reference
34. in the summary of data structures in this chapter and in lt pcim h gt IMnum defines the PCIM as configured during initialization from which the Interrupt Status Table is to be read The Intr parameter is a pointer to the buffer where the Interrupt Status Table information is stored The format of the Intr table is unsigned char Intr The following Macros are used as shown in the Interrupt Status Table Macro Position Explanation define ENABLE 0 Enable the interrupt level define DISABLE 1 Disable the interrupt level define SUMMARY define REQUEST Q define PCIM STAT define DEV STAT define OUT SENT define CCOMPLETE define RECEIVE D After data transfer to the Host is complete GetINTR clears all of the PCIMs Interrupt Status Table bytes each time it is called This way you can see the lastest event that has occurred each call Summary if interrupt occurred Received memory datagram PCIM Status Change usually fatal Device Status Change Outputs sent end of bus access Command Block completed Received Datagram o0i1 cnm o Single Slot PCIM User s Manual January 1994 GFK 0881 Parameters are summarized as follows Parameter Value Function IMnum 1 64 Relative number of PCIM Intr see above Pointer to the buffer where the table data will be stored Return Value Status GetINTR will return SUCCESS if the device specified by IMnum
35. int status IMPARMS IMparms COUNT IMparms 0 IMref 0x8010 status ChglMSetup 1 amp lMparms Turn OFF PCIM 2 include lt pcim h gt int status IMPARMS IMparms COUNT IMparms 1 Active OFF status ChglMSetup 2 amp lMparms GFK 0881 Chapter 4 C Programming for the PCIM 4 19 GetlMState Get Configuration and Status Information Code Summary include lt pcim h gt int GetIMState IMnum IMstate unsigned int IMnum IMSTATE IMstate Description The Get PCIM State call allows you to access configuration and status information about a specific PCIM by reading its Setup Table and Status Table into the IMstate parameter in Host memory The format of IMstate is DipSwitch Daugherboard Dip Switch Value IMRef Reference Address OutputLength Output Control Data Length InputLength Input Control Data Length Revision PCIM Firmware Revision Number GENI OK PCIM OK every 200 ms set to 1 If 0 board has faulted Fault Overall fault byte any PCIM fault Active Hand Held Monitor Present SBerr Serial Bus error count ScanTime Bus Scan Time in ms Since the PCIM periodically sets its PCIM OK flag this call allows the implementation of a PCIM OK heartbeat procedure Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM IMstate varies PCIM Configuration and Status see above 4 20 Single Slot PCIM User
36. is used by InitIM to tell you which of the PCIMs initialized properly or improperly as the case may be The number of flags should equal IMcount Parameters are summarized as follows Parameter Values Function IMcount 1 64 Total number of PCIMs IMparms varies shows the characteristics of each module see above IMflags varies tells you which PCIMs initialized properly see above Chapter 4 C Programming for the PCIM 4 15 The InitIM call performs the following sequence of actions l Brings each defined PCIM out of reset or if the PCIM is already running into reset then out of reset 2 Downloads Global data parameters to each PCIM after its PCIM OK LED turns ON may take up to two seconds 3 After all PCIMs have been downloaded or a two second timeout has occurred returns with a 64 byte Status array one byte for each defined PCIM If any syntax or execution errors detected the status returned is Fail An example of an execution error is failure of the PCIM OK flag to be ON within two seconds after Reset Return Value Status InitIMreturns SUCCESS if all resets and data parameters are accepted by each PCIM The following failure codes may be returned BADIMNUM IMnum is out of range a count of 64 or greater No more InitIM processing is performed INITFAIL An initialization problem occurred in one or more PCIM The individual status for each PCIM on the bus is located in the IMflags parameter One of the
37. may be Disabled When PutINTR is called it transfers the data from the Host memory DisableIntr parameter to the PCIMs Interrupt Disable Table The format of the Interrupt Disable Table and its associated macros shown below is defined in the summary of data structures in this chapter and in lt pcim h gt IMnum defines the PCIM as configured during initialization to which DisableIntr will beread The DisableIntr parameter is a pointer to the buffer where the Interrupt Disable Table information is stored The format of the DisableIntr table is unsigned char Disablelntr The following Macros are used as shown in the Interrupt Disable Table Macro Position Explanation define ENABLE 0 Enable the interrupt level define DISABLE 1 Disable the interrupt level define SUMMARY define REQUEST Q define PCIM STAT define DEV STAT define OUT SENT define CCOMPLETE define RECEIVE D Summary if interrupt occurred Received memory datagram PCIM Status Change usually fatal Device Status Change Outputs sent end of bus access Command Block completed Received Datagram oci cnm o Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Disablelntr see above Pointer to the buffer from which enable disable data is sent Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status Pu
38. or improper address assignment or RST inputline is low ON Power is available the controller scommunications hard ware is functional and it can send data receives the token COMM OK every serial bus scan OFF or FLASHING means an error has been detected in the communications hardware or access to the Genius serial bus Fault Isolation and Repair 7 2 If the status indicator LEDs are in the correct state but the bus is not functioning properly the malfunctions below may describe the problem If so follow the procedures listed under the appropriate malfunction m AnLED does not come ON when a PCIM is plugged in and powered up and RST input is high If Board OK OFF CommOK ON Check the parameters entered using the configuration software If set different then the InitIM parameter the BOARD OK LED will not come on Check to see if the PCIM is completely inserted in the host backplane connector and that all connector pins are properly aligned If all appears to be in order assume hardware failure replace PCIM If Board OK ON CommOK OFF Check for correct cable type and length see Genius I O System and Communications User s Manual GEK 90486 1 See if correct terminating resistors see Genius I O System and Communications User s Manual GEK 90486 1 are installed at both ends of bus Determine if serial bus wiring has been completed in a daisy chain fashion
39. s Manual January 1994 GFK 0881 Return Value Status GetIMState will almost always return SUCCESS If the target PCIM is currently offline has not been initialized or is out of range the following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 Coding Example Examine the state of PCIM 1 include lt pcim h gt int status IMSTATE IMstate status GetlMState 1 amp IMstate GFK 0881 Chapter 4 C Programming for the PCIM 4 21 GetBusConfig Get Serial Bus Configuration Code Summary include lt pcim h gt int GetBusConfig IMnum Config unsigned int IMnum DEVICE Config Description The Get Bus Configuration call allows you to read device configuration information about all devices on a serial bus except the PCIM GetBusConfig reads all 32 Device Configuration Tables from the PCIM selected by IMnum into the Host memory Config parameter This information is not packed and will fill the entire Config parm 256 bytes in length The format of Config is unsigned char Model Model Number of device unsigned char OutputDisable Output disable flag unsigned char Present Device Present flag unsigned int Reference Status Table or Reference Address unsigned char InputLength Control Input Data Length unsigned char OutputLeng
40. 0 if the voltage detector detects low voltage If not enabled by configuration the timer does not need to be pulsed 2 Interrupt Request When the daughterboard generates an interrupt to the motherboard this goes to 1 and stays 1 until reset by Control bit 2 see next page 3 PCIM OK The state of this bit follows the condition of the PCIM OK LED on the daughterboard If the LED is lit the PCIM OK bit is 0 4 COMM Communications OK Like the BOARD OK bit this bit follows the output of one of the LEDs on the daughterboard This bit is 0 if the COMM OK LED on the daughterboard is lit Chapter 2 Operation 2 3 PCIM Control Byte Bit Definitions The individual bits in the PCIM Control byte are used for the following functions 71 6 5 4 3 2 11 0 unlabelled bits not used 16353 L Watchdog Timer Pulse Clear Reset Clear Interrupt Request HHM present test Reset the PCIM 0 Watchdog Timer Pulse The watchdog timer is a hardware timer that can be enabled by the configuration software If the watchdog timer is enabled it must be reset periodically or it will put the PCIM into RESET You can toggle the watchdog timer and use it as a failsafe timer to ensure that if the Host system hangs up the PCIM will not send any erroneous messages to the serial bus If the watchdog timer is disabled by by the configuration software you do not have to toggle it it will s
41. ADIMNUM IMnum is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus de vices 0 31 decimal NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 or never com pleted processing the config change command OFFLINE The device requested is currently not on the bus however the appropriate buffer is still returned and will contain configu ration data for devices once logged in Coding Example Examine the configuration of device 30 on PCIM 1 include lt pcim h gt int status DEVICE Configbuf status GetDevConfig 1 30 Configbuf GFK 0881 Chapter 4 C Programming for the PCIM 4 25 DisableOut Disable Enable Device Outputs Summary include lt pcim h gt int DisableOut IMnum Devicenum Flag unsigned int IMnum Devicenum char Flag Description The Disable Enable Outputs call allows you to selectively disable or enable outputs to a specific device or to all devices on a serial bus If Flag is non zero 1 outputs to the device will be disabled if Flag is zero 0 outputs will be enabled to that device If you code the Devicenum value equal to ALI then the outputs to all devices will be set to the value of Flag If Devicenum is a serial bus address value between 0 31 decimal then the flag value will only affect that device PCIM H contains macros defined for ON or OFF valu
42. F00 8064 1F80 8192 2000 16383 3SFFF GFK 0881 Each PCIM daughterboard uses 16K bytes of host memory For information purposes only the structure of this area is illustrated below You do not need to understand how this Shared RAM memory works if your application program will use the PCIM Software Driver functions described in chapters 4 and 5 to interact with this memory area Content Size in Bytes Request Queue 2176 Request Queue Head 1 Pointer Request Queue Tail Pointer 1 Uu GENI Setup Table 16 Uu GENI Status Table 16 Interrupt Status Table 16 Interrupt Disable Table 16 Command Block 16 Transmit Datagram Buffer 240 Read Datagram Buffer 134 I O Table Lockout Request 1 I O Table Lockout State 1 Host Clear 1 Reserved 64 Auxiliary Request Queue 48 Heartbeat Enable 2 Heartbeat TimeoutMultiplier 1 Reserved 4930 Device Configuration Table 256 Directed Control Input Table 128 Broadcast Control Output 128 Table Device I O Table 8192 RequestQueue Queue for incoming Read Device Write Device and Write Point datagrams to the host Request Queue Head Pointer Number of the Request Queue buffer currently being read Request Queue Tail Pointer Indicates the most recent entry in the Request Queue HGENISetup Table Characteristics of UGENI and the bus uGENI Status Table Diagnostics for UGENI and the
43. GE Intelligent Platforms Programmable Control Products Single Slot PC Interface Module PCIM User s Manual GFK 0881 March 2010 GFL 002 Warnings Cautions and Notes as Used in this Publication Warning notices are used in this publication to emphasize that hazardous voltages currents temperatures or other conditions that could cause personal injury exist in this equipment or may be associated with its use In situations where inattention could cause either personal injury or damage to equipment a Warning notice is used Caution notices are used where equipment might be damaged if care is not taken Note Notes merely call attention to information that is especially significant to understanding and operating the equipment This document is based on information available at the time of its publication While efforts have been made to be accurate the information contained herein does not purport to cover all details or variations in hardware or software nor to provide for every possible contingency in connection with installation operation or maintenance Features may be described herein which are not present in all hardware and software systems GE Intelligent Platforms assumes no obligation of notice to holders of this document with respect to changes subsequently made GE Intelligent Platforms makes no representation or warranty expressed implied or statutory with respect to and assumes no responsibility for the acc
44. IMRef d imparm IMRef printf nOutLength d imparm OutputLength printf nInputLength d imparm InputLength printf nActive d imparm Active else printf nChglMSetup driver successful n Use the GetlMState driver to read the Status Table and Setup Table of the PCIM Display the DIP Switch value which is returned as part of this call Single Slot PCIM User s Manual January 1994 GFK 0881 ft JE JE if ret GetlMState pnum amp imstate SUCCESS printf nGetIMState failure returned d n ret else printf nGetIMState driver successful printf DipSwitch value x n imstate DipSwitch Use the GetBusConfig driver to display the configuration of the Genius Bus Display a subset of the information returned for x 0 x lt OxFFFF x for y 0 y lt OxF y if ret GetBusConfig pnum device SUCCESS printf nGetBusConfig failure returned d n ret else printf nGetBusConfig successful n printf Model Device 1 96d device 1 Model printf n Device Present 96d device 1 Present printt n Device Configuration x n device 1 Config Use the GetDevConfig driver to display the configuration of a specific block Display the reference address of the block if ret GetDevConfig pnum dnum amp config SUCCESS printf nGetDevConfig failure returned d n else p
45. IR CALLE Stat ment eret rem Tea Vete Ha eaae 5 38 GETWORD CALL Statement 6 0 eee eee eee 5 40 PUTWORD CAL Statement sci gcd te Phe ae ete ed eos Sd o heed e 5 42 SENDMSG CALL Statement 0 eee eee 5 44 GFK 0881 Single Slot PCIM User s Manual January 1994 viii Contents SENDMSGREPEY CALL Statement i4 2229 ek ys ER ERRARE SERA a 5 46 CHKMSGSTAT CALL Statement sssseeessese eee 5 48 GETMSG CALL Statement 0 0 60 eei oi eene 5 50 GETINTR CALL Statement 0 cece eens 5 52 PUTINTR CALL Statement 45 224225 0234 2t E Rt EROR RAE Po RR da 5 54 Chapter 6 CommunicaH ons uoo oem o pac rq e a e ewe ema A UR i RS 6 1 Introd ction reU RR Ue ute Ue eed ite s 6 1 Global Data cs ee ut Me ue MUR ox Md tud LAU MU A da 6 1 Datagram Data eee ERROR pact E de RR eL Bankes 6 3 Chapter 7 Troubleshooung 24 5223 424 B CEPR ERR TREE NER eek ete tween 7 1 Introduction eeen etc e utes ee te e edere a ee tte e t teca 7 1 Replacement Module Concept 06 0 c cece eens 7 1 PCIM Troubleshooting eiere o eee i e II 7 2 EEDS ceili aii ne en esa x ce E EAE O EAE due esp ac dea d Cr 7 2 Fault Isolation and Repair 0 66 keene 7 2 AppendixA Example Applications 0 cece cece ee nnn G 1 Example Application 0 0 eee eee ee G 1 Example Application2 2e verse ee ie rese espe uaa G 5 Example Application3 errs opriet EE cee G 10 GFK 0881 Single Slot PCIM User s Manual January 1994 i
46. Input Table of a specified PCIM and write its contents into the Host memory IMdata parameter IMnum is the PCIM number configured during initialization The IMdata parameter is a buffer where the data to be read will be located The size of this buffer is determined by the InputLength parameter located in the PCIMs configuration data When GetIMIn is called it begins by Locking out the PCIM from updating the Directed Control Input Table ensures data coherency across bus scans GetIMIn then transfers all the data in this table into Host memory Once the transfer is complete the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM IMdata variable Buffer where the data read will be located see above Return Value Status GETIMIN will return SUCCESS if the InputLength is non zero and the data transfer is complete The following FAIL indications will be returned BADIMNUM Mnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 UNDERFLOW The InputLength of the PCIM is set to zero 0 4 36 Single Slot PCIM User s Manual January 1994 GFK 0881 GFK 0881 PutIMOut Write the Global Output Table Code Summary include lt pcim h gt int PutlMOut IMnum IMdata unsigned int IMnum char IMdata Description The PutIMOut call
47. K 0x1F define BAUDMASK 0x60 define OUTPUTMASK 0x80 f The following template is to be used with the function GetBusConfig typedef struct unsigned char Model Model Number of device unsigned char OutputDisable Output Disable flag unsigned char Present Device Present flag unsigned int Reference Status Table or Reference Address unsigned char InputLength Control Input Data Length unsigned char Config Device Configuration 7 6 5 4 3 2 1 0 not used Device Configuration DEVICE Chapter 4 C Programming for the PCIM 4 5 The following Macros are to be used with the function GetBusConfig define ENABLE define DISABLE define ALL define MAXDEVICE define MAXIMS define PRESENT define NOTPRESENT define INPUTO define OUTPUTO define COMBO 0 Enable Outputs to a Node 1 Disable Outputs to a Node 32 Value to select all Nodes 32 Maximum devices per PCIM 64 Maximum number of PCIMs 1 Device currently present on PCIM 0 Device currently offline from PCIM 1 Input Data Only Device 2 Output Data Only Device 3 Combination of Input and Output Data The following templates are to be used with all of the MSG functions yi typedef struct unsigned unsigned unsigned unsigned unsigned unsigned READ_MESSAGE typedef struct unsigned unsigned unsigned unsigned unsigned unsigned
48. M s must be present in the same computer to complete the configuration Setup parameters include the base addresses used by the PCIM and its daughterboard s baud rate serial bus address outputs enable and Watchdog Timer enable Configuration data is stored in EPROM memory on the PCIM and is retained if power is removed The configuration software can be run from diskette or the configuration files can be copied to a hard disk Ithas a tutorial mode that can be used to practice entering data without actually changing the parameters of any installed PCIM The software configures one PCIM at a time Follow the instructions to configure the first PCIM Write the configuration to the first PCIM then exit the configuration software Configurate the next PCIM by restarting the configuration software specifying the second PCIM s DIP switch address in the command as described below Notifying the Configuration Software of DIP Switch Change The configuration software for the PCIM expects the default DIP Switch setting of 222hex If you change the DIP switch setting for example when using multiple PCIMs you must also inform the configuration software in either of the following ways D Forone or more PCIMs you can set an address flag when entering the command to execute the configuration software as described on the next page E For just one PCIM you can set a variable in the DOS startup file AUTOEXEC BAT The format of the comma
49. NIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 IMBUSY The PCIM is otherwise engaged and cannot accept the command Note You are responsible for defining the device the Function code the Sub F unction code and the length of the transmit Datagram Itis also your responsibility to interpret the Function code the Sub F unction code and the meaning of the Reply message See GEK 90486 1 for predefined message codes Note You cannot issue a SendMsg call or read a received unsolicited message while a SendMsgReply call is in progress If this presents a timing problem use the SendMsg call See Also SendMsg GetMsg and ChkMsgsStat Coding Example This example sends a Read Diagnostics Message to device 8 on PCIM 1 and expects a reply message of Read Diagnostic Reply This message requests 10 bytes of diagnostic data beginning at offset 0 include lt pcim h gt int status SEND_MESSAGE_REPLY Msg Msg Destination 8 Device 8 Msg Function 0x20 Genius Function Code Msg T SubFunction 8 Read Diagnostic Subfunction Code Msg R SubFunction 9 Read Diagnostic Reply Subfunction Code Msg Priority NORMALP Transmit at Normal priority Msg T Length 2 Length of data in Data Buffer Msg Data 0 0 Offset of 0 Msg Data 1 0xA Length of 10 decimal status SendMsgReply 1 amp Msg To see how message functio
50. OINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 or never completed processing the config change command OFFLINE The device requested is currently not on the bus however the appropriate buffer is still returned and will contain configuration data for devices once logged in Coding Example Examine the configuration of device 30 on PCIM 1 1200 IMNUM 1 1210 DEVICENUM 30 1220 Call GETDEVICECONFIG STATUS IMNUM DEVICENUM DEVCONFIG 0 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 23 DISABLEOUTCALL Statement Syntax CALL DISABLEOUT STATUS IMNUM DEVICENUM FLAG Action Disable EnableDevice Outputs Description The Disable Enable Outputs call allows you to selectively disable or enable outputs to a specific device or to all devices on a serial bus IfFLAGisn n 1 outputs to the device will be disabled if FLAG is zero 0 outputs will be enabled to that device If you code the DEVICENUM value equal to ALL 32 then the outputs to all devices will be set to the value of FLAG If DEVICENUM is a serial bus address value between 0 31 decimal then the flag value will only affect that device Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM DEVICENUM 0 31 Specifies device on serial bus on which circuit resides 32 Specifies all devices FLAG 0 or 1 Enable disable out
51. OMSG No message is available to be received at this time TXERR A message transmission has failed or response to SendMsgReply has not arrived after 10 seconds PCIMERR There may be a problem with the PCIM firmware BADPARM Syntax error from previous SendMsgReply See Also SendMsgReply SendMsg and ChkMsgsStat Coding Example Check to see if any messages exist on PCIM 1 and if so store them into the location Msg include lt pcim h gt int status READ_MESSAGE Msg status GetMsg 1 amp Msg GFK 0881 Chapter 4 C Programming for the PCIM 4 53 GetlNTR Read Interrupt Status Table 4 54 Code Summary include lt pcim h gt int GetINTR IMnum Intr unsigned int IMnum unsigned char Intr Description The Get Interrupt call allows you to read the selected PCIMs Interrupt Status Table You can read this table to m See why an interrupt in the Host system has occurred m Report the event in a non interrupt environment as is the default state of the Software Driver concept the PCIM will still report the event even though the interrupt is disabled Thus the Interrupt Status Table can be polled by reading and interpreting it to determine what is causing an interrupt from the PCIM When GetINTR is called it transfers the data from the PCIMs Interrupt Status Table to the Host memory Intr parameter The format of the Interrupt Status Table and its associated macros shown below is defined
52. PCIM into Host memory SendMsg writes a message from Host memory to the PCIM for transmission onto the bus SendMsgReply writes a message from Host memory to the PCIM for transmission onto the bus and expects a specified reply message from the destination ChkMsgStat allows the Host to detect when a transmitted message has actually been completed or if transmission is incomplete or has failed Functions that deal with interrupt processing GetINTR reads the entire Interrupt Status Table from a selected bus device into Host memory PutINTR writes the entire Interrupt Status Table to a selected PCIM from Host memory Using Software Driver Function Calls When coding the PCIM Software Drivers in your application programs you should have at hand the following m Starting Address Segment Address of the Shared RAM Interface m OPort Base Address m Status Table Address PCIMs or Reference Address Series Six m Serial Bus Address of each bus device m Global Input Output Data lengths for all devices Itis also helpful to have the Genius I O System and Communications User s Manual GEK 90486 1 handy for reference GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 3 Basic Software Driver Function Call Parameters Software Driver function calls require that you specify a number of parameters for each call The data structures for each parameter which are linked and loaded from the Software Driver exe f
53. S if any of the devices specified by the IMNUM are active and data was transferred If no devices are present on the target IM if the target IM is currently offline has not been initialized or is out of range the following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE Data was transferred to the output tables however no devices were found on the bus Coding Example Write all outputs to all active devices 4 on PCIM 1 2100 IMNUM 1 2110 IODATA 0 1 2120 IODATA 128 2 2130 IODATA 256 4 2140 IODATA 384 8 2150 Call PUTBUSOUT STATUS IMNUM IODATA 0 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 29 GETDEVINCALL Statement Syntax CALL GETDEVIN STATUS IMNUM DEVICENUM LENGTH DEVDATA 0 Action Read Device Data Only Description The GETDEVIN function allows you to read the control data inputs received from a single serial bus device into the Host memory DEVDATA parameter IMNUM is the PCIM number configured during initialization The DEVICENUM parameter specifies the serial bus address of the device from which input data is to be read The LENGTH parameter is the length of the input data the device sent This way the function can determine whether or not it should update its current data base The DEVDATA
54. T SENDMSG 68 DROFFSET SENDMSGREPLY 72 DROFFSET CHKMSGSTAT 76 DROFFSET GETINTR 80 DROFFSET PUTINTR 84 DROFFSET Get inputs for initialization function call INITIM INITIM must be called first to initialize PCIMs and check that they were initialized CALL INITIM STATUS IMCOUNT IMPARMS 0 IMFLA Chapter 5 BASIC Programming for the PCIM 5 11 In the above sequence Line 10 forces array indexing to start at zero since this is more convenient when using the Driver Line 20 defaults all variables to integer type use the type overrides for single and double precision reals Lines 60 through 180 find the segment address in memory where the Driver has previously been installed and ensures that it is present And Lines 190 through 400 define the offsets in the segment for each of the function call subroutines Lines 410 through 460 are simply a reminder to call for initialization first see the INITIM call Coding Basic Function Calls There are two ways to call a function in Basic as shown below 1 Segment relocation first relocate the segment perform the the call then restore the segment For example to call INITIM code 1000 DEF SEG SUBSEG 1010 CALL INITIM parameters 1020 DEF SEG No relocation if you know in advance that other BASICA statements which depend on segment relocation PEEK POKE BLOAD BSAVE DEF USR or CALLs to other user routines will not be used then the code in line 1000 above c
55. Table and Interrupt Disable Table define ENABLE define DISABLE define SUMMARY define REQUEST Q define PCIM STAT define DEV STAT define OUT SENT define CCOMPLETE define RECEIVE D define LOCKOUT ie 0 1 N oO NO of OO Enable the interrupt level Disable the interrupt level Summary set if interrupt occurred Received memory datagram PCIM Status Change usually fatal Device Status Change Outputs sent end of bus access Command Block complete Received Datagram Lockout granted The following Macros are used as Return values for all functions The FAIL codes should be listed with each individual function description Ei define SUCCESS define INITFAIL define IMFAIL define BADSEG define BADPORT define BADCFG define NOCFG define NOINIT define NODATA define UNDERFLOW define OVERFLOW define OFFLINE define IMBUSY define BADPARM define TXERR define NOMSG define IMFREE define BADSBA define BADIMNUM define PCIMERR define DUPSEG define DUPPORT Chapter 4 C Programming for the PCIM OONDOAARWNDY O Successful completion of function Initialization Failure PCIM Failure Invalid Segment address Invalid I O Port Address Invalid Configuration parameter No Configuration changes found PCIM selected is not initialized No data foun
56. a na E disable a ERI L LEDs 1 3 1 5 7 2 Low voltage detection 2 3 Mechanical specifications Memory requirements Message reading 14 52 5 50 Message status 4 50 5 48 Message reading 4 3 j Motherboard MS DOS requirements O Operating system Outputs e s Parameters BASIC Parameters C Parity errors PCIM catalog numbers control data dauchterpoanT 1 2 1 3 electrical characteristics 2 1 host memory required amp motherboard 1 3 13 size and appearance software driver pea HOA status data 2 3 PCIM OK status 2 3 PCIM Reset command bit 2 4 PCIM software driver 4 1 PCIM H file Power supply requirements PutBusOut j4 30 PutCir m I 40 52 PutDevOut y P PutIMOut 14 37 5 35 PutlNTR 14 3 4 58 5 3 PutWord 4 2 psa b 2 R Read Datagram Buffer Reading confi EN and status data uo en 5 18 18 4 20 ea BS ad Ba a a B the bus configuration 14 2 4 27 5pm GFK 0881 GFK 0881 Reset detection 2 3 Reset Request clear 2 4 S 4 48 soe ERES ER SendMsgReply 4 3 4 48 b 3 5 46 Serial bus address 3 10 Service telephone number 7 1 Setup Table Shared RAM Signal conditioning Software driver files E Hincion calls 4 2 5 2 installation Sendin LEA sd pis eon the bus 4 3 1 3 11 48 Index overview Startup Status bits D 2 Status Table System ov
57. a variable Character pointer to a buffer where the data to be written will be located see above Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status PutDevOut will return SUCCESS if the device indicated is present on the given IMnum and after the data is transferred to that device If the target device is not present or is out of range the following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus de vices 0 31 decimal or is that of the PCIM NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The device requested is currently not on the bus and data is NOT transferred OVERFLOW Specified DataLngth is greater than actual device s output length UNDERFLOW Specified DataL ngth is less than actual device s output length Coding Example Write 2 bytes of output data to device 8 on PCIM 1 include lt pcim h gt int status unsigned char Devdata data length Devdata 0 1 Devdata 1 0x10 status PutDevOut 1 8 2 Devdata GFK 0881 Chapter 4 C Programming for the PCIM 4 35 GetlMIn Read Directed Input Table Code Summary include lt pcim h gt int GetIMIn IMnum IMdata unsigned int IMnum unsigned char IMdata Description The Get IM Inputs call allows you to read the Directed Control
58. accepted by each PCIM The following failure codes are returned BADIMNUM IMcount is out of range a count of 64 or greater No more InitIM processing is performed INITFAIL An initialization problem occurred in one or more PCIM The individual status for each PCIM on the bus is located in the IMflags parameter One of the following status codes will be stored in the appropriate location in the IMFLAGS parameter if the return code is INITFAIL Each status value in the IMFLAGS array is unique to the associated PCIM and does not reflect the status of any other PCIM INITFAIL This PCIM failed to power up Incorrect segment address or port address SUCCESS This PCIM has been powered up and configured as specified IMFAIL This PCIM never powered up BADCFG This PCIM rejected the configuration because a parameter was out of range BADSEG The segment value in IMparms is set to the illegal value 0 zero BADPORT The I O port address is set to some illegal value less than 256 DUPSEG The segment address is a duplicate of another PCIM DUPPORT The port address is a duplicate of another PCIM 5 14 Single Slot PCIM User s Manual January 1994 GFK 0881 Note If any of the PCIMs fail to initialize as you specified in IMPARMS INITIM turns OFF the failed PCIM Coding Example In this example are two PCIMs 410 IMCOUNT 2 2PCIMs 420 IMPARMS 0 amp HDOOO IM1 PCIM 1 Segment address 430 IMPARMS 1 amp H3E4 IM1 Port ad
59. age 6 6 c cece ccc neees 4 52 GetINTR Read Interrupt Status Table 066 6 4 54 PutINTR Write to the Interrupt Disable Table 00 005 4 56 Chapter 5 BASIC Programming forthe PCIM sees 5 1 Basic Software Driver Installation 0 2 0 nee 5 1 Software Driver Function Calls sees 5 2 Using Software Driver Function Calls 2 0 0 cece 5 3 Basic Software Driver Function Call Parameters 0 0000005 5 4 Basic Data Array Structures 6 coe 5 4 Error Status Indication 0 eee ee 5 10 Access from BASIC iussus eet tera ex aee ee Y E aa 5 11 Coding Basic Function Calls 2 0 00 cence eee eee 5 12 INITIM CALL Statement suicune E E n 5 13 CHGIMSETUP CALL Statement 0 cee eee 5 16 GETIMSTATE CALL Statement s 23 004 4 exa ce tA CR LA nti ee eu da Dada 5 18 GETBUSCONFIG CALL Statement 606s 5 20 GETDEVCONHIG CALL Statement 0 000000 5 22 DISABLEOUT CALL Statement oaa ett hp UE Det as waa naw sepia 5 24 GETBUSIN CALL Statement 2 2elcesesRee y sy ee Rt et PT oa 5 26 PUTBUSOUT CALL Statement ier Rm RR E Rr hy 5 28 GEIDEVIN CALL Statement 4222 yk ertet kt Ce nh ERR RR d 5 30 PUTDEVOUT CALL Statement 4 4 aec TA es dh Ye HC A eee e 5 32 GETIMIN CALL Statement cscri 0 0 eee nn 5 34 PUTIMOUT CALL Statement sous iP reda boc e t CO Rete dob eects pde 5 35 GETCIRCALLStatement oerset rener pe Der ex eres peer ees 5 36 PUTC
60. alized INITIM IMFAIL The indicated PCIM has failed PCIM OK 01 OFFLINE The device requested is currently not on the bus and data is NOT transferred OVERFLOW The OFFSET specified is greater than the devices InputLength in circuits UNDERFLOW OFFSET is specified as zero 0 Coding Example Get the state value of circuit 2 of device 8 on PCIM 1 3000 IMNUM 1 3010 DEVICENUM 8 3020 CIROFFSET 2 3030 Call GETCIR IMNUM DEVICENUM CIROFFSET STATE GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 37 PUTCIR CALL Statement Syntax CALL PUTCIR STATUS IMNUM DEVICENUM CIROFFSET STATE Action Write Output Circuit Value Description A Put Circuit call allows the state of a single output circuit to be changed from ON to OFF or vice versa In this call the STATE parameter is written from the Host memory to the specified PCIMs Output Table IMNUM is the PCIM number configured during initialization The DEVICENUM parameter specifies the serial bus address of the device which contains the target output circuit The CIROFFSET parameter indicates which bit of DEVICENUM is to be written This value ranges from 1 through 1024 in bits STATE is a variable containing the value of the circuit as indicated by the above parameters The contents of STATE should be either a 1 or 0 ON or OFF Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM
61. ample Read all inputs from all active devices on PCIM 1 2000 IMNUM 1 2010 Call GETBUSIN STATUS IMNUM IODATA 0 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 27 PUTBUSOUT CALL Statement Syntax CALL PUTBUSOUT STATUS IMNUM IODATA 0 Action Write all Output Values Description The Put Bus Outputs call allows you to update outputs to all active devices in the Output Table of the specified PCIM Active outputs are those with the Device Present flag set to 1 it is the application s responsibility to know which devices are present on the bus via the GETBUSCONFIG call Active output values are written from the Host memory IODATA parameter IODATA must be an array buffer where the I O information is saved The IODATA parm is 4096 in length 128 entries device times 32 devices Slots are in serial bus address order When PUTBUSOUT is called it begins by locking out the PCIM from updating its Output Table ensures data coherency across PCIM scans PUTBUSOUT then transfers all data from IODATA to the Output Table When the entire PCIM Output Table has been searched the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM IODATA 4096 bytes Data parameter will be copied from Host memory to specified PCIM STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value PUTBUSOUT will return SUCCES
62. an be executed once at startup to set the segment to the Driver Function calls can then be coded on a single line without segment relocation Using the same example 1010 CALL INITIM parameters 5 12 Single Slot PCIM User s Manual January 1994 GFK 0881 GFK 0881 INITIM CALL Statement Syntax CALL INITIM STATUS IMCOUNT IMPARMS 0 IMFLAGS 0 Action Setup and Activate PCIM Description The Initialize IM call specifies the total number of PCIMs in the Host system through the parameter IMCOUNT and the characteristics of each PCIM through the parameter IMPARMS INITIM resets the IMcount of PCIMs in the Host system and initializes each PCIM as defined by IMPARMS You must create a separate IMPARMS entry for each PCIM in IMCOUNT Each PCIM requires the entries in IMPARMS array The format of IMPARMS is IMPARMS 0 IM 1 Segment Address of PCIM shared RAM two bytes LSB MSB IMPARMS 1 IM 1 I O Port Address two bytes LSB MSB IMPARMS 2 IM 1 PCIM Global Reference two bytes LSB MSB IMPARMS 3 IM 1 Global data length one byte IMPARMS 4 IM 1 Input directed data length normally 0 IMPARMS 5 IM 1 Active one byte 1 ON 0 OFF IMPARMS 6 IM 2 Segment Address of PCIM shared RAM two bytes LSB MSB IMPARMS 7 IM 2 I O Port Address two bytes LSB MSB IMPARMS 8 IM 2 PCIM Global Reference two bytes LSB MSB IMPARMS 9 IM 2 Global data length on
63. apter 5 BASIC Programming for the PCIM 5 45 SENDMSGREPLY CALL Statement 5 46 Syntax CALL SENDMSGREPLY STATUS IMNUM MSG 0 Action Send a Message requesting a Reply Description The Send Message Reply call allows you to write a memory or non memory message from the Host to the selected PCIM for transmission onto the bus using the Transmit Datagram With Reply command SENDMSGREPLY will return control to the calling program without waiting for the reply You must call CHKMSGSTAT or GETMSG to check for completion or to read the reply message IMNUM defines the PCIM as configured during initialization from which to transmit the message The MSG parameter is a pointer to the buffer where the transmit message is stored The format of SENDMSGREPLY is MSG 0 Destination 0 31 255 brdcst Destination address of Device MSG 1 Function code 0 111 Function Code MSG 2 T SubFunction code 0 255 Transmitted Reply SubFunction Code MSG 3 R SubFunction code 0 255 Expected Reply SubFunction Code MSG 4 Priority 0 Normal 1 High MSG 5 Length 0 134 Data field length length of msg MSG 6 Data variable Message Data length per MSG 5 You can check the status of the message using CHKMSGSTAT to determine if the message completed processing properly Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM MSG see above Pointer to the buff
64. ariety of other malfunctions which are beyond the power of conventional PLCs to detect A simplified diagram of a typical Genius I O System is shown below 46201 Host Host Hand held Monitor 1 4 Single Slot PCIM User s Manual January 1994 GFK 0881 Specifications CatalogNumbers Single channel PCIM Dual channelPCIM MicroGENHaughterboard LEDs 2 for each daughterboard Electrical PowerRequirements Bus Loading Bus Drive Capability Mechanical PCIM board type Hand held Monitorconnection Serial bus connection Hostbackplane interface Memoty Requirements Motherboard Eachdaughterboard EnvironmentalRequirements Operating Temperature Humidity Altitude Vibration Shock EnvironmentalRequirements Non operating Temperature Humidity Altitude Vibration Shock GFK 0881 Chapter 1 Introduction IC660ELB921 IC660ELB922 IC660ELB912 GENI OK COMMS OK Communications OK 5 volts DC 10 400 ma maximum 1LSTITL load per input line 10LS TTL loads per outputline Single slot AT style board External connector with HHM and bus terminals Board edge terminals or external connector Board edge terminals accept two AWG 20 avg 55mm cross sec tion wires or three AWG 22 avg 36mm cross section wires full
65. bus Interrupt Status Table Current status of interrupts to host Interrupt Disable Table Used toenable disablehostinterrupts CommandBlock Used by host to send Read Datagram Transmit Datagram Transmit Datagram with Reply and Configuration Change commands to GENI TransmitDatagramBuffer Temporary location for sending data grams ReadDatagramBuffer Location where host may read incoming datagrams T O Table LockouRequest Relinquish Used to set or release uGE NllockoutofI O Tables T O Table Lockout State Actuallockout state HostClear Used by nGENI to clear Interrupts from the host Reserved Area The host should NOT read or write here Auxiliary RequestQueue Used in conjunction with Request Queue HeartbeatEnable Used to enable host tomGENI heartbeat moni toring HeartbeatTimeoutMultiplier Sets the heartbeat interval Reserved Area The host should NOT read or write here Device Configuration Table Location of device ID status and setup information Directed Control Input Table Location for receiving Directed Control Data BroadcastControl Output Table Buffer for sending Global Data Device I O Table Contains all device inputs and outputs and incoming Global Data Host write causes interrupt to LGENIdaughterbaord Chapter 2 Operation 2 5 Chapter 3 Getting Started Introduction In order for you to interface the PCIM with the Genius serial bus you must first perform the following st
66. ce address 620 Call CHGIMSETUP STATUS IMNUM IMPARMS 0 Turn off PCIM 2 690 IMNUM 2 700 IMPARMS 5 0 720 Call CHGIMSETUP STATUS IMNUM IMPARMS 0 730 Check status for next action 740 If STATUS 0 Then 760 else 800 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 17 GETIMSTATE CALL Statement Syntax CALL GETIMSTATE STATUS IMNUM IMSTATE 0 Action Get Configuration and Status Information Description The Get IM State call allows you to access configuration and status information about a specific PCIM by reading its Setup Table and Status Table into the IMSTATE parameter in Host memory If PCIM OK 0 board has failed The format of IMSTATE is IMSTATE 0 DipSwitch See page 4 9 IMSTATE 1 IMRef Reference Address IMSTATE 2 OutputLength Output Control Data Length IMSTATE 3 InputLength Input Control Data Length IMSTATE 4 Revision PCIM Firmware Revision Number IMSTATE 5 PCIM OK PCIM OK every 200 ms set to 1 IMSTATE 6 Fault Overall fault byte any PCIM fault IMSTATE 7 Active Hand Held Monitor Present IMSTATE 8 SBerr Serial Bus error count IMSTATE 9 ScanTime Bus Scan Time in ms Since the PCIM periodically sets its PCIM OK flag this call allows the implementation of a PCIM OK heartbeat procedure Parameters are summarized as follows IMSTATE varies PCIM Configuration and Status see above Parameter Values Function IMNUM 1 64 Relati
67. ce and Global Data Length The Global Data Reference is the beginning address of the Global Data where a receiving Series Six or Series Five PLC will place the data A Series 90 70 or Series 90 30 PLC does not use this reference If no PLCs are involved this reference can be defined for any suitable application purpose This reference is called IMRef in the PCIM The Global Data length is the number of bytes of Global Data to be broadcast by the PCIM Global Data Length is called OutputLength You will use the Software Driver function call InitIM to set IMRef and OutputLength parameters Always set the MSB Most Significant Bit of the IMRef to 1 if it is to be used with a Series Six or Series Five PLC The location where the receiving host will place the Global Data can be specified using IMRef The 16 bit register address must have the two upper bits set as shown below A Series Six or Series Five PLC will only use the bottom 14 bits 46233 1 0 a a a a a d b 0 a a a a a a 161514 131211109 8 76 5 43 2 1 Register Address GFK 0881 6 1 For example IMRef 8005 hex will send Global Data to all Series Six Series Five CPUs on the bus starting at Register 5 The Global Data Length OutputLength is always specified in bytes Therefore if 15 Registers of Global Data are to be sent OutputLength should be set to 1E hex 30 decimal Global Data is automatically broadcast by the PCIM every serial bus scan The user appl
68. char char char char char char char char char char char char SEND_MESSAGE typedef struct unsigned unsigned unsigned unsigned unsigned unsigned unsigned char char char char char char char Source Source Address of Serial Bus Device Function Function Code SubFunction Sub Function Code DB Indicator Flag for Directed 1 or Broadcast 0 Length Length of Buffer Data 134 Message buffer which will Destination Destination Address of Serial Bus Device Function Function Code SubFunction Sub Function Code Priority fF Priority O0 normal or 1 high Length Data Buffer 134 bytes max Data 134 Message buffer which will Destination Destination Address of Serial Bus Device Function Function Code T SubFunction Sub Function Code transmitted R_SubFunction Sub Function Code received Priority Priority 0 normal or 1 high Length Trans Data Buff Length 134 bytes max Data 134 Message buffer which will SEND_MESSAGE_REPLY Single Slot PCIM User s Manual January 1994 GFK 0881 GFK 0881 The following Macros are used with all the MESSAGE templates define BROADCAST define NORMALP define HIGHP Jz 255 0 1 Normal Priority High Priority The following describes the tables necessary to read and write the PCIM s Interrupt Status
69. d Insufficient device data length Exceeds device data length Device is offline PCIM busy Invalid message parameter Message transmit failure No Message available No message activit Invalid Serial Bus Address Invalid PCIM Number PCIM firmware problem Duplicate segment values given Duplicate I O port values given 4 8 Data Structures for Initialization The following data structures may be defined for use with the IMPARMS function call Type Name Range Description unsigned int im Segment 0 FFFE h Starting address defined by configurationsoftware unsignedint im IOport 100 h 3FC h I OPortbase address DIP switchSW1 unsigned int IMRef 0 8001 O FFFF h Global Data Address of PCIM daughterboard unsigned char OutputLength 0 128 Global Data length in BYTEs unsigned char InputLength 0 128 Directed Input Data length normally 0 unsigned char Active ON OFF Turn PCIM on or off see ChgIMSetup Macros for Initialization and Setup Change The following Macros are to be used with the variable Active in the functions InitIM and the ChgIMSetup Any structures which do not indicate setting by Dipswitch hardware actuated are set by the Software Drivers software actuated Macro Value Explanation define ON 1 Active set ON will enable the PCIM define OFF 0 Active set OFF will disabl
70. d BADIMNUM IMNUM is out of range a count of 64 or greater BADSBA Specified DEVICENUM is not in the range for Genius bus devices 0 31 decimal or is that of the PCIM which has its own function NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The device requested is currently not on the bus and data is NOT transferred OVERFLOW The Offset specified is greater than the device s InputLength in circuits UNDERFLOW The Offset is specified as zero 0 Coding Example Write 2 bytes of output data to device 8 on PCIM 1 2500 IMNUM 1 2510 DEVICENUM 8 2520 DEVDATA 0 1 2530 DEVDATA 1 amp H10 2540 LENGTH 2 2550 Call PUTDEVOUT STATUS IMNUM DEVICENUM LENGTH DEVDATA 0 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 33 GETIMIN CALL Statement Syntax CALL GETIMIN STATUS IMNUM IMDATA 0 Action Read Directed Input Table Description The Get IM Inputs call allows you to read the Directed Control Input Table of a specified PCIM and write its contents into the Host memory IMDATA parameter IMNUM is the PCIM number configured during initialization The IMDATA parameter is a buffer where the data to be read will be located The size of this buffer is determined by the InputLength parameter located in the PCIMs configuration data When GETIMIN is called it begins by Locking out the PCIM from u
71. d datagram GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 9 5 10 Error Status Indication Any function call may return an error condition You are informed of error conditions by a non zero error code returned in the STATUS variable included as the first parameter in every call Normal completion of a function call is indicated by a zero STATUS returned The table of error codes that follows will help you interpret these codes A simple check for non zero STATUS must be performed after each driver call to detect error conditions The following error codes are returned for all calls Error Code SUCCESS 0 INITFAIL 1 IMFAIL 2 BADSEG 3 BADPORT 4 BADCFG 5 NOCFG 6 NOINIT 7 NODATA 8 UNDERFLOW 9 OVERFLOW 10 OFFLINE 11 IMBUSY 12 BADPARM 13 TXERR 14 NOMSG 15 IMFREE 16 BADSBA 17 BADIMNUM 18 PCIMERR 19 DUPSEG 20 DUPPORT 21 Single Slot PCIM User s Manual January 1994 Explanation Successful completion of function Initialization Failure PCIM Failure Invalid Segment address Invalid I O Port Address Invalid Configuration parameter No Configuration changes found PBIM selected is not initialized No data found Insufficient device data length Exceeds device data length Device is offline PCIM busy Invalid message parameter Message transmit failure No Message available No message activity Invalid Serial Bus Address Invalid PCIM Number PCIM firmware problem Duplicate segment values give
72. dications will be returned BADIMNUM IMUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 Coding Example This example shows how if an interrupt occurs on PCIM 1 to transfer the contents of that PCIMs status table Interpretation of bits will depend on which interrupt is enabled and which application is to be run 4300 IMNUM 1 4310 Call GETINTR STATUS IMNUM INTR 0 4320 Do what is necessary for interrupt processing GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 53 PUTINTR CALL Statement Syntax CALL PUTINTR STATUS IMNUM DISABLEINTR O Action Write to the Interrupt Disable Table Description The Put Interrupt call allows you to write to the selected PCIM s Interrupt Disable Table The PUTINTR call first initializes a table to Enable and Disable individual interrupts as you require The PUTINTR call then writes this table to the Interrupt Disable Table on the PCIM You can Enable or Disable interrupts in any mix that is on a single call some interrupts may be Enabled and some Disabled all may be Enabled or all of the interrupts may be Disabled When PUTINTR is called it transfers the data from the Host memory DISABLEINTR parameter to the PCIMs Interrupt Disable Table The format of the Interrupt Disable Table is shown below IMNUM defines the PCIM as configured during initialization to w
73. dress 440 IMPARMS 2 amp H7000 IM1 Reference address 450 IMPARMS 3 20 IM1 No global data 460 IMPARMS 4 2 0 IM1 No Directed input data 470 IMPARMS 5 1 IM1 Turn PCI on by default 480 IMPARMS 6 amp HCCOO IM2 PCIM 2 Segment address 490 IMPARMS 7 amp H3E0 IM2 Port address 500 IMPARMS 8 amp H8001 IM2 Global Data Reference address Series 6 register 1 510 IMPARMS 9 0 IM2 No global data 520 IMPARMS 10 0 IM2 No Directed input data 530 IMPARMS 11 1 IM1 Turn PCI on by default 540 Call INITIM STATUS IMCOUNT IMPARMS 0 IMFLAGS 0 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 15 CHGIMSETUP CALL Statement Syntax CALLCHGIMSETUP STATUS IMNUM IMPARMS 0 Action Change PCIM Configuration Description Following initialization any changes you make to the configuration of a specific PCIM must use the Change IM Setup call This call allows you to make configuration changes to a specific PCIM Setup Table by writing the IMPARMS parameter from Host memory to it The IMNUM parameter is an offset of the IMPARMS parameter which after initialization indicates the specific PCIM in the host system for which configuration changes are intended Note Configuration changes to any PCIM while online causes that IM to stop transmitting on the serial bus for 1 5 seconds The format of IMPARMS is the same as shown in the INITIM call However only fo
74. dule1 module2 module3 module4 moduleN program exe program map search path pcim lib The command to link the response file is LINK RESPONSE FIL GFK 0881 4 1 Software Driver Function Calls The PCIM Software Driver consists of easy to use macro oriented function calls you code appropriately in your C language or Basic language applications routines Function calls are summarized below Functions that deal with PCIM configuration InitIM assigns PCIM numbers and Global data parameters to all PCIMs Performs any required hardware activation and initialization of the PCIMs such as Reset ChgIMSetup writes to the Setup Table of the selected PCIM from the Host memory to change PCIM parameters GetIMState reads PCIM configuration and status from the selected PCIM Status Table and Setup Table into Host memory Functions that deal with bus configuration GetBusConfig reads all Device Configuration Tables from the selected PCIM into Host memory GetDevConfig reads one device s configuration from the selected PCIM into Host memory DisableOut writes to the Device Configuration Table of the selected PCIM to enable disable outputs to selected devices or to all devices Functions that deal with control data movement GetBusIn reads the entire Input Table control data inputs from a selected PCIM into Host memory PutBusOut writes the entire Output Table control data outputs to a selected
75. e Address OECOO00 Enabled I O Base Address 3EC Enabled Interrupt Disabled Device 28 Baud 153 6K std Outputs Enabled Watchdog Disabled GFK 0881 Chapter 3 Getting Started 3 13 Chapter C Programming for the PCIM 4 This chapter explains programming for a PCIM in C Programming requires C MSDOS Compiling your Application with Microsoft In order to make your C application compatible with the PCIM library you must first invoke the Microsoft compiler with the following switch option Zp This option permits user packed data structures and is required for the GetIMState GetBusConfig and GetDevConfig calls For example C msc application Zp small model OR C msc application Zp AL large model Software File Linkage It is necessary to link and load the file named SPCIM LIB small model or LPCIM LIB large model to use the C Software Drivers in your programs There are several ways to link the PCIM LIB using the Microsoft Linker 1 The simplest way is to type all of the necessary module information on the command line LINK PROGRAM MODULE SEARCH PATH SPCIM LIB small model OR LINK PROGRAM MODULE SEARCH PATH LPCIM LIB large model 2 However if the program is divided up into several modules too numerous to fit on the command line you can set up a response file to link all of the associated object files The contents of a response file might look like program mo
76. e byte IMPARMS 10 IM 2 Input directed data length normally 0 IMPARMS 11 1M 2 Active one byte 1 ON 0 OFF etc Note The memory pointer and I O port assignments must correspond to the dip switch settings on the PCIM The last parameter IMFLAGS is an array the size of IMCOUNT used by INITIM to tell you which PCIMs initialized properly or improperly as the case may be The number of flags should equal IMCOUNT Chapter 5 BASIC Programming for the PCIM 5 13 Parameters are summarized as follows Parameter Values Function IMCOUNT 1 64 Total number of PCIMs IMPARMS varies shows the characteristics of each module see above 6 entries IM IMFLAGS varies tells you which PCIMs initialized properly see above STATUS 0 1 success fail The INITIM call performs the following sequence of actions 1 Brings each defined PCIM out of reset or if the PCIM is already running into reset then out of reset 2 downloads Global data parameters to each PCIM after its PCIM OK LED turns ON may take up to two seconds 3 After all PCIMs have been downloaded or a two second timeout has occurred returns with an IMFLAGS array one for each defined PCIM Status returned will be Fail for any syntax or execution errors detected An example of an execution error is failure of the PCIM OK flag to be ON within two seconds after Reset Status Value INITIM will return SUCCESS if all resets and data parameters were
77. e indicated PCIM has failed PCIM OK 0 PCIMERR There may be a problem with the PCIM firmware See Also SendMsgReply SendMsg and GetMsg Coding Example Check the message status area of PCIM 1 include lt pcim h gt int status char Status status ChkMsgStat 1 amp Status switch STATUS case SUCCESS break case IMFREE break case IMBUSY break case BADPARM break case TXERR break case PCIMERR break default break GFK 0881 Chapter 4 C Programming for the PCIM 4 51 GetMsg Read Received Message 4 52 Code Summary include lt pcim h gt int GetMsg IMnum Msg int IMnum READ_MESSAGE Msg Description The Get Message call allows you to read a received memory or non memory message or a reply to a previous SendMsgReply call from the selected PCIM into the Host memory Msg parameter IMnum is the PCIM number configured during initialization The Msg parameter is a pointer to the buffer where the received message will be stored The format of READ MESSAGE is Source 0 31 Source address of Device Function code 0 111 Function Code SubFunction code 0 255 Sub Function Code DB Indicator 0 134 Directed 1 Broadcast 0 Length Data field length length of message Data 0 134 Message Data depends on length parm Parameters are summarized as follows Parameter Values Function IMnum 1 64 of PCIM Msg see above Pointer to the bu
78. e the PCIM Single Slot PCIM User s Manual January 1994 GFK 0881 Data Structures for PCIM Configuration The following data structures are to be used for the GetIMState function call Type Name Range Description unsignedchar DipSwitch 0 255 d Daughterboard Dip Switch value See below unsignedint IMRef 0 8001 d Global Data Reference Beginning address of or the Global Data of the broadcasting CPU 0 FFFF h unsigned char OutputLength 0 128 Global Data Length Number of bytes of Glob al Data to be broadcast by the PCIM unsigned char InputLength 0 128 Directed Input Data Length normally 0 unsigned char Revision PCIM Firmware Revision Number unsigned char GENI OK 1 0 PCIM OK every 200 ms set to 1 unsignedchar Fault 0 15 Overall fault byte any PCIM fault shown below unsignedchar Active 0 5 Hand Held Monitor Present one or com bination of bit positions bit 0 HHM present 1 pres bit 1 reserved bit 2 10 CRC errors in 10 seconds On for one second does not stop PCIM This bit is et of 10 errors occur in 10 seconds unsigned int SBerr O0 FFFF Serial Bus error count roll over counter Goes FFFF 0 from 0 to FFFF to 0 unsignedint ScanTime Bus Scan Time in mS Content of DipSwitch is 716 151413 11 0 Macros for GetlMState The following Macros are to be used with the variable Fault in
79. ee Also SENDMSG GETMSG and CHKMSGSTAT Coding Example This example sends a Read Diagnostics message to device 8 on PCIM 1 and expects a reply message of Read Diagnostics Reply This message requests 10 bytes of diagnostic data beginning at offset 10 4000 IMNUM 1 4010 MSG 0 8 Destination 4020 MSG 1 amp H20 Function Code 4030 MSG 2 8 Transmit SubFunction Code 4040 MSQ 3 9 Excepted Reply SubFunction Code 4050 MSG 4 0 Priority 4060 MSG 5 2 Message Length Transmitted 4070 MSG 6 16 Offset 4080 MSG 7 10 Message Length to be Read 4090 Call SENDMSGREPLY STATUS IMNUM MSG 0 To see how the message function calls work together see Appendix A Example 2 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 47 CHKMSGSTAT CALL Statement 5 48 Syntax CALL CHKMSGSTAT STATUS IMNUM MSGSTATUS 0 Action Read Message Progress Status Description The Check Message Status call allows you to determine the status of a previous SENDMSG call that is to determine when a transmitted message has actually been received and its completion status IMNUM is the PCIM number configured during initialization The MSGSTATUS parameter is the returned message status The MSGSTATUS parameter will contain the following values IMFREE There is currently no activity IMBUSY Message is still in progress SUCCESS Message has successfully completed BADPARM Message contained a syntax error TXERR
80. eeps up to date images of the I O controlled by each device whether the device is a Genius I O Block or other bus device and can communicate with other Controllers on the Genius bus by passing background messages not associated with I O commands or Global Data The interface to this RAM is optimized for the IBM personal computer bus The PCIM motherboard provides a convenient way to interface an Open Architecture daughterboard like the PCIM daughterboard to an IBM compatible Host system All the signals necessary to communicate to a daughterboard are buffered through the motherboard to the Host bus In addition to the normal interface lines the motherboard provides the following daughterboard control and monitoring functions m A standard unit load to the IBM bus m Works in ISA compatible backplanes Low supply voltage detection Power up RESET signal sequencing m Host system address decoding over the full PC XT or AT memory maps m A built in watchdog timer that can monitor system operation and shut down the daughterboard if the Host system faults preventing any conflicts on the Genius bus Note that this timer is not used with the Software Library 46351 For each daughterboard two LEDs Board OK and Communications OK are provided in the PCIM faceplate For each daughterboard the LEDs are as shown below LEDs for Daughterboard A Bus Connector for Daughterboard A
81. en Single Slot PCIM User s Manual January 1994 GFK 0881 GFK 0881 InitIM Setup and Activate PCIM Code Summary include lt pcim h gt int InitlM IMcount IMparms IMflags unsigned int IMcount IMPARMS IMparms unsigned char IMflags Description The Initialize PCIM call specifies the total number of PCIMs in the host system through the parameter IMcount and the characteristics of each PCIM through the parameter IMparms InitIM resets the IMcount of PCIMs in the host system and initializes each PCIM as defined by IMparms You must create a separate IMparms entry for each PCIM in IMcount The format of IMPARMS is IM1 Segment Address of PCIM shared RAM two bytes LSB MSB IM1 I O Port Address two bytes LSB MSB IM1 PCIM Global Reference two bytes LSB MSB IM1 Global data length one byte IM1 Input data length input directed data length normally 0 IM1 Active one byte 1 ON 0 OFF IM2 Segment Address of PCIM shared RAM two bytes LSB MSB IM2 TI O Port Address two bytes LSB MSB IM2 PCIM Global Reference two bytes LSB MSB IM2 Global data length one byte IM2 Input data length reserved one byte always set to 0 IM2 Active one byte 1 ON 0 OFF etc Note The memory pointer and I O port assignments must correspond to the configuration of the PCIM The last parameter IMflags
82. en This value ranges from 1 through 64 in word quantities When PUTWORD is called it begins by Locking out the PCIM from updating the Shared RAM ensures data coherency across bus scans PUTWORD then transfers the word data to the PCIM Once the transfer is complete the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM DEVICENUM 0 31 Specifies device to which output word will be written CIROFFSET 1 64 Output word offset in specified device in words WORDDATA 1 entry Word requested STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value PUTWORD will return SUCCESS if the device specified by IMNUM is present on the serial bus If the target device is not present or is out of range PUTWORD will return FAIL The following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus devices 0 31 decimal or is that of the PCIM NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The device requested is currently not on the bus and data is NOT transferred OVERFLOW The Offset specified is greater than the devices OutputLength in circuits UNDERFLOW The Offset is specified as zero 0 Coding Example Set the second word of device 8 on PCIM 1 to 10 hex
83. eps m Set the configuration I O address on the DIP switches m Install the PCIM in the host Connect the PCIM to the serial bus m Run the configuration software Hardware Required In addition to the devices normally considered part of the Genius I O system the following hardware is required to effect a Genius I O PCIM Host communications interface m AnIBMPC ATIBMPC XT or compatible computer APCIM Software Required GFK 0881 The following software is required to effect Genius I O PCIM Host communications MS DOS version 3 0 or higher and m dpcimcfg exe configuration software m pcim lib C Software Driver small memory model m Ipcim lib C Software Driver large memory model m pcim h C Software Driver include file Or pcimx exe BASIC Software Driver pcim bas BASIC startup sequence Setting the Board Address DIP Switch Before installing the PCIM in the computer it may be necessary to set its address selection DIP switches The default setting is 222hex The board address must be unique for each module if there are multiple PCIMs or if the address conflicts with addresses used by other modules in the system you must change it to an address in the range 102hex to 3FE hex Switch positions are numbered 1 through 8 Use switches 1 and 2 to set the high hex digit switches 3 4 5 and 6 to set the middle hex digit and switches 7 and 8 to set the
84. er where the received message will be stored see above STATUS Success Fail The advantage of the SENDMSGREPLY call over the SENDMSG call is that a 10 second timeout to a non responding device is automatically provided by the PCIM for a SENDMSGREPLY call The Host program sequence for a SENDMSGREPLY is as follows 1 Host sends aSENDMSGREPLY to the PCIM 2 Host issues GETMSG calls until the Status indicates completion GETMSG will also return the reply message into Host memory Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value SENDMSGREPLY will return SUCCESS if a message has been transferred from the Host memory to the PCIM Otherwise one of the following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 IMBUSY The PCIM is otherwise engaged and cannot accept the command Note You are responsible for defining the device the Function code the Sub F unction code and the length of the transmit Datagram It is also your responsibility to interpret the Function code the Sub F unction code and the meaning of the Reply message See GEK 90486 1 for message codes Note You cannot issue a SENDMSG call or read a received unsolicited message while a SENDMSGREPLY call is in progress If this presents a timing problem use the SENDMSG call S
85. erview 1 4 T Transmit Datagram Buffer W MORE timer Se pulse 2 4 status 2 3 Wiring specifications 1 5 Writing outputs 12 34 4 40 1 44 5 2 peor peut ea es 4 40 4 44 6 2 Index 3
86. es for Flag Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Devicenum 0 31 Specifies device on serial bus on which circuit resides 32 Specifies all devices Flag 0 or 1 Enable disable outputs 4 26 Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status DisableOut will return SUCCESS if the device specified by IMnum is present on the serial bus Otherwise DisableOut will return FAIL If Devicenum indicates ALL then DisableOut will almost always return SUCCESS The following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus de vices 0 31 decimal or is the serial bus address of the daughterboard NOINIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 Coding Example Enable outputs to device 8 on PCIM 1 include lt pcim h gt int status status DisableOut 1 8 ENABLE Disable outputs to all devices on PCIM 1 include lt pcim h gt int status status DisableOut 2 ALL DISABLE GFK 0881 Chapter 4 C Programming for the PCIM 4 27 GetBusln Read all Input Values Code Summary include lt pcim h gt int GetBuslIn IMnum lOdata unsigned int IMnum unsigned char lOdata Description A Get Bus Inputs call allows you to read input values from all act
87. ess two bytes LSB MSB IM2 PCIM Global Reference two bytes LSB MSB IM2 Global data length one byte IM2 Input data length reserved one byte always set to 0 IM2 Active one byte 1 ON 0 OFF etc Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM IMparms varies shows the characteristics of each module see above Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status ChgIMSetup will return SUCCESS if all changes were accepted by the target IM If the PCIM fails to change to the new parameters the following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 or never com pleted processing the config change command IMBUSY The PCIM is otherwise engaged and cannot accept the con fig change command BADCFG This PCIM rejected the configuration because a parameter was out of range NOCFG The PCIM after examining the received the config change command found no changes to make INITFAIL Change of Global Data output or Global Data reference or Directed Data input length required a reset of PCIM daugh terboard and the daughterboard failed to reinitialize Coding Example Change the PCIM Global Reference for PCIM 1 include lt pcim h gt define COUNT 2
88. et device is present on the given IMnum If the target device is not present or is out of range GetCir will return FAIL If SUCCESS is returned then the character pointed to by State will contain the value of the circuit requested The following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus de vices 0 31 decimal or is that of the PCIM NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The device requested is currently not on the bus and data is NOT transferred OVERFLOW The Offset specified is greater than the devices InputLength in circuits UNDERFLOW The Offset is specified as zero 0 Coding Example Get the State value of circuit 2 of device 8 on PCIM 1 include lt pcim h gt int status char State status GetCir 1 8 2 amp State GFK 0881 Chapter 4 C Programming for the PCIM 4 39 PutCir Write Output Circuit Value 4 40 Code Summary include lt pcim h gt int PutCir IMnum Devicenum Offset State unsigned int IMnum Devicenum unsigned int Offset char State Description A Put Circuit call allows the state of a single output circuit to be changed from ON to OFF or vice versa In this call the State parameter is written from the Host memory to the specified PCIMs Output Table IMnum is the PCIM number config
89. etDevConfig reads one device s configuration from the selected PCIM into Host memory DisableOut writes to the Device Configuration Table of the selected PCIM to enable disable outputs to selected devices or to all devices Functions that deal with control data movement GetBusIn reads the entire Input Table control data inputs from a selected PCIM into Host memory PutBusOut writes the entire Output Table control data outputs to a selected PCIM from Host memory GetDevIn read control data inputs from a selected bus device into Host memory PutDevOut write control data outputs to a selected bus device from Host memory GetIMIn reads all PCIM control data from Directed Control Input Table of selected PCIM into Host memory PutIMOut writes all PCIM control data to Global Data Table of selected PCIM from Host memory GetCir reads an input circuit value variable into the Host memory from the Input Table of a selected PCIM GetWord reads an input word value variable into the Host memory from the Input Table of a selected PCIM PutCir writes an output circuit value variable from the Host memory to the Output Table of a selected PCIM PutWord writes an output word value variable from the Host memory to the Output Table of a selected PCIM Single Slot PCIM User s Manual January 1994 GFK 0881 Functions that deal with communications GetMsg reads a received message from a selected
90. etINTR reads the entire Interrupt Status Table from a selected bus device into Host memory PutINTR writes the entire Interrupt Status Table to a selected PCIM from Host memory Using Software Driver Function Calls When coding the PCIM Software Drivers in your application programs you should have at hand the following m Starting Address Segment Address of the Shared RAM Interface or address of daughterboard m OPort Base Address m Status Table Address PCIMs or Reference Address Series Six or Series Five PLC m Serial Bus Address of each bus device Global Input Output Data lengths Itis also helpful to have the Genius I O System and Communications User s Manual GEK 90486 1 handy for reference GFK 0881 Chapter 4 C Programming for the PCIM 4 3 C Software Driver Function Call Parameters C Software Driver function calls require that you specify a number of parameters for each call The data structures for each parameter which are linked and loaded from your pcim h file Parameters are summarized on the pages following the pcim h file PCIM H File The pcim h file defines the data structures and macros used with the PCIM Software Library The pcim h file is listed below typedef struct unsigned int Segment Starting address of SRI unsigned int IOPort O Port Base Address IMBOARD The following template is to be used with the functions InitlM and the ChglMSetup typedef
91. eturn MACROS printf nGetDevConfig returned d ntest exit ret loop 0 y else printf n nFor Serial Bus Address 30 printf nModel 2d config Model printf nOutputs are 96s config OutputDisable DI SABLED ENABLED printf nDevice is spresent config Present NOT 7 printf nInput Length 2d config InputLength printf nOutput Length 2d config OutputL ength printf nDevice type is Switch config Config case 1 printf Input Only break case 2 printf Output Only break case 3 printf Combination break GFK 0881 Appendix A Example Applications A 3 k From PCIM 2 which is SBA 30 GetDevConfig uration for SBA 31 which in this case is PCIM 1 This can be used for any devices on the bus if ret GetDevConfig 2 31 amp config SUCCESS ie returned an error code probably 7 or 11 look in PCIM H for Error Return MACROS printf nGetDevConfig returned d ntest exit ret loop 0 else printf n nFor Serial Bus Address 31 printf nModel 2d config Model printf nOutputs are 969 config OutputDisable DI SABLED ENABLED printf nDevice is espresent config Present orintf nInput Length 2d config InputLength printf nOutput Length 2d config OutputLength printf nDevice type is uem config Config Wi case 1 print
92. eturned d n ret else printf nPutBusOut successful print n Output data 128 X n OUTdata printf Pt 3 4 and 5 should be ON n for x 0 x lt OxFFFF x for y 0 y lt OxF y Use the GetDevln driver to read input data from the discrete block Value should indicate 0x1C if ret GetDevln pnum dnum amp length INDdata SUCCESS printf nGetDevin failure returned d n ret else printf nGetDevIn successful printf n Discrete Block Input Data 9eXWM INDdata 0 BE PutDevOut driver to turn on pt 3 and 5 on the discrete Igth 1 Single Slot PCIM User s Manual January 1994 GFK 0881 GFK 0881 fe j iF OUTdata 0 0x14 if ret PutDevOut pnum dnum Igth OUTdata SUCCESS printf nPutDevOut failure returned d n ret else printf nPutDevOut successful printf n Pt 3 and Pt 5 should be ON Use the GetCir and GetWord drivers to read the input status of the discrete block offset 3 if ret GetCir pnum dnum offset amp val SUCCESS printf nGetCir failure returned d n ret else printf nGetCir successful print n Value read should be 1 val x n val offset 1 if ret GetWord pnum dnum offset valword SUCCESS printf nGetWord failure returned d n ret else printf nGetWord successful printt n Value read should be x14 val x n
93. f Input Only break case 2 printf Output Only break case 3 printf Combination break printf n nPress return to continue x getchar if x q x Q7 loop 0 printf mnThat is all bl These next instructions turn the two PCIMs off local 0 Active 2 OFF local 1 Active 2 OFF k These next two function calls may be checked for Error Returns ChglMSetup 1 PCIM1 ChglMSetup 2 PCIM2 Single Slot PCIM User s Manual January 1994 GFK 0881 Example Application 2 This example provides uses the most common call routines for the PCIM Each call routine will be provided with a section of C code showing the proper use of the driver These call routines have been set up using a discrete block connected to the PCIM in the following configuration Serial Bus Address 1 Reference Address 65 Point Configuration Pt 1 Input Pt 5 Output Pt 2 Output Pt 6 Input Pt 3 Output Pt 7 Input Pt 4 Output Pt 8 Input Any failures by the call routines will be displayed with the returned failure code Time delays are inserted within the program to visually verify the correct operation of the driver where appropriate lt stdio h gt pcim h include include extern int InitIM ChglMSetup GetlMState GetBusConfig GetDevConfig DisableOut GetBusIn PutBusOut GetDevin PutDevOut GetCir GetWord Pu
94. ffer where the received message will be stored see above GetMsg performs the following sequence 1 Tf there is a previous call to SendMsgReply GetMsg checks to see if the transmission has successfully completed and transfers the response back to you If the response completed with an error or if in progress GetMsg will return a FAILindication 2 If there is no previous call to SendMsgReply GetMsg checks to see if there is a memory message and transfers that message back to you 3 If no memory messages exist then GetMsg checks to see if there is a non memory message and transfers that message back to you 4 Ifno messages are present GetMsg returns with a FAIL status Note Unsolicited memory or non memory Datagrams received by the PCIM may not be read by the Host while a SendMsg Reply is in progress This significantly affects Host response time to service received Datagrams If this is a problem use the SendMsg call instead of Send MsgReply Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status GetMsg will return SUCCESS if a memory or non memory message is returned to you Other wise one of the following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 IMBUSY The PCIM is otherwise engaged and cannot accept the command N
95. gned to be integrated into a user developed IBM PC microprocessor based system It provides a low cost tap on the Genius I O bus allowing a host system to monitor and control remote I O utilizing the extensive diagnostics high reliability and noise immunity of GEs Genius I O System This manual is intended for design engineers and systems or applications programmers who are already familiar with Basic or C programming in the IBM PC environment Readers are further assumed to be familiar with the Genius I O System Content of this Manual This manual contains 7 chapters and 1 appendix Chapter 1 Introduction Chapter 1 provides a Genius I O system overview description and specifications of the PCIM and information about the PCIM software Chapter 2 Operation Chapter 2 describes PCIM electrical characteristics and explains how the host can interact directly with a PCIM reading status information and setting control bits Chapter 3 Getting Started Chapter 3 provides procedures for installing and configuring a PCIM Chapter 3 also describes an external connector that can be added to the serial bus for interface to a Genius Hand held Monitor Chapter 4 C Programming for the PCIM Chapter 4 is a programmer s reference for creating a C language interface to the PCIM Chapter 5 BASIC Programming for the PCIM Chapter 5 is a programmer s reference for creating a BASIC language interface to the PCIM Chapter 6 Communications Chapte
96. he 2nd IM 2 Flag for the 3rd IM Variable depending on the num 3 Flag for the 4th IM ber of IMs can be up to 64 e e e e e e IMSTATE The IMSTATE array is a system return used for accessing configuration and status information about a specific PCIM by reading its Setup Table and Status Table The format of IMSTATE is Daughterboard configuration Global Data Reference Global Data Length Normally set to 0 PCIM Firmware Revision number PCIM Hardware OK flag PCIM Fault Description PCIM Present Excess Bus Errors flag HHM Present Excess Bus Errors flag Serial Bus Error Count s Bus Scan Time in mS 10 O olo Nlo aoa BA we Wm o For more information about the content of the IMSTATE array particularly the daughterboard configuration parameters see page 4 9 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 5 BUSCONFIG The BUSCONFIG array is a system return used to access the configuration of all 32 devices from the PCIM selected by the IMNUM parameter The format of BUSCONFIG is Model number of device 1 Output disable flag for device 1 Device present flag for device 1 Reference address for device 1 Control Input data length for device 1 224 7 for each device Control Output data length for device 1 Configuration for device 1 Model number of device 2 o N am
97. he defective module within that assembly The defective module is then replaced from a duplicate set of modules maintained on site Your production line or system is back up fast The defective module can be returned through normal channels under warranty or for service without keeping your production line or system down for an extended period of time The replacement concept minimizes downtime to minutes as contrasted potentially to days The potential savings far outweigh the comparatively small cost of duplicate modules If you did not purchase a duplicate set of modules with your initial system we recommend that you contact your authorized GE distributor and do so Then with the help of this manual and the staff of your local authorized GE distributor you will be able to troubleshoot and repair just about any problem that may arise PCIM Troubleshooting LEDS A malfunction causing the improper operation of a PCIM can generally be isolated by checking the condition of the status indicator LEDs on the PCIM The normal condition of the status indicator LEDs is the ON state If a LED is not ON check the troubleshooting sequence in this section for the proper course of action Indicator Status Definition ON Power is available to the PCIM adequate power must be available for it to function properly and the on board self BOARDOK diagnostics test was passed OFF The watchdog timer has timed out indicating a board failure
98. hich DISABLEINTR will be read The DISABLEINTR parameter is the buffer where the Interrupt Disable Table information is stored The values in the table below are 0 Enable 1 Disable The format of the DISABLEINTR table is DISABLINTR Position Explanation DISABLINTR O Summary if interrupt occurred DISABLINTR 1 Received memory datagram DISABLINTR 2 PCIM Status Change usually fatal DISABLINTR 3 Device Status Change DISABLINTR 4 Outputs sent end of bus access DISABLINTR 5 Command Block completed 6 Received Datagram Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM DISABLEINTR see above Buffer from which enable disable data is sent STATUS Success fail 5 54 Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value PUTINTR will return SUCCESS if the device specified by IMNUM is present on the serial bus If the target device is not present or is out of range PUTINTR will return FAIL The following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 Coding Example This example enables the Receive Datagram Interrupt 7000 IMNUM 1 7010 For12 0to 6 7020 DISABLEINTR l 0 7030 NEXT 7040 DISABLEINTR 6 1 7050 Call PUTINTR STATUS IMNUM
99. ication program updates the PCIM with the latest Global Data by using the Software Driver PutIMOut If the program sweep time is longer than the bus scan time new Global Data may not be available each bus scan in that case the same data may be sent more than once If the program sweep time is much shorter than the bus scan time it is possible that Global Data might change more quickly than the bus controller can send it If that happens some data could be lost The host must accommodate these timing issues to assure data integrity Bus scan time increases by approximately 72uS for each byte of Global Data transmitted When the PCIM receives Global Data it appears in the Input Table slot corresponding to the Serial Bus Address device number of the device that sent the Global Data You will use the Software Driver function call GetBusIn or GetDevIn to read this data Example In a three host system the PCIM with serial bus address 30 broadcasts 128 bytes of Global Data to PCIMs with serial bus addresses 29 and 31 46 PCIM 29 PCIM 30 PCIM 31 128 bytes 128 bytes Global Output lt Global Output e Global Output Table Table Table Input Table Input Table Input Table bufe29 buffer29 buffer29 uffer30 M o buffer 30 buffer30 buffer 31 buffer 31 buffer 31 Output Table Output Table Output Table For More Information For more informat
100. ified PCIMs Input Table and be placed into the Host memory STATE parameter IMnum is the PCIM number configured during initialization The DEVICENUM parameter specifies the serial bus address of the device which contains the input circuit The CIROFFSET parameter indicates which bit of DEVICENUM is to be read This value ranges from 1 through 1024 in bits STATE is a variable in which GETCIR will store the value of the circuit as indicated by the above parameters The contents of STATE will be either a 1 or 0 ON or OFF Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM DEVICENUM 0 31 Specifies I O device from which input circuit will be read DIROFFSET 1 1024 Input circuit offset in specified I O device in bits STATE 0 1 ON or OFF condition of circuit read from PCIM STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value GETCIR will return SUCCESS if the target device is present on the given IMNUM If the target device is not present or is out of range GETCIR will return FAIL If SUCCESS is returned then STATE will contain the value of the circuit requested The following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater BADSBA Specified DEVICENUM is not in the range for bus devices 0 31 decimal or is that of the PCIM NOINIT Indicated PCIM has not been initi
101. ignals to the PCIM from the Host system look like one LSTTL load to the host system These signals are TTL compatible and switch at TTL levels Control output signals to the host are open collector LSTTL drivers with 10K resistive pull ups capable of sinking 4 mA while maintaining an output voltage of 0 4V or lower The data transceiver is a tri state LSTTL device capable of sourcing or sinking 12 mA with VOL 0 4V and VOH 2 0V The PCIM is fully compatible with ISA backplanes Signal Conditioning GFK 0881 The PCIM has two connectors that you can access when the PCIM is installed in a PC type rack Both connectors are for the standard twisted pair connection to a serial bus The Hand held Monitor can be connected through an interface cable to the separate Genius connectors All of the lines in from both connectors are either isolated or impedance limited to protect the PCIM from voltage spikes or the misapplication of high voltages on the serial bus connections PCIM Status and Control The PCIM motherboard uses four bytes of mapped I O memory space These four bytes start at the I O base address and are configured by the software utility and have the functions shown below Only the first two bytes are used Byte A7 AO Description 0 XXXXXXX00 PCIM Status byte 1 XXXXXXX01 PCIM Control byte For example if the the address selected is 3E0 hex you can perform operations on these addresses 3E0 0 3E0 PCIM Status
102. ile are summarized below IBM PC BASICA interpreter does not allow the passing of constants in the parameter list of a CALL statement Only variables may be passed You must load all variables which supply information to the Driver before performing a function call In the parameter lists which follow all parameters are either single integers or are arrays of integers Note BASICA interpreter requires that all arrays be called with subscript If this is violated incorrect data and or system crash is the usual result Basic Data Array Structures IMPARMS The user supplied IMPARMS array sets parameters for the initialization of each IM The format of IMPARMSY is Segment address of 1st PCIM daughterboard I O Port address dip switch setting Starting Ref addr for global data Global data length 0 127 Input data length 0 127 Active 12ON 0 OFF Segment address of 2nd PCIM SIR I O Point address DIP switch setting Variable depending on how many IMs are to be initialized can be up to 383 e co 100 B C0 nm 5 4 Single Slot PCIM User s Manual January 1994 GFK 0881 IMFLAGS The IMFLAGS array is a system return used by INITIM to tell you which PCIMs initialized properly on improperly as the case may be The length of IMFLAGS should be equal to the number of IMs or IMCOUNT The format of IMFLAGS is 0 Flag for the 1st IM 1 Flag for t
103. imer input every 727 ms or the motherboard will reset the daughterboard Chapter 2 explains how this is done With the watchdog timer disabled no input from the Host system is needed The other portions of the RESET circuit the voltage detection and Host RESERDRV monitor still provide RESET capability even with the watchdog timer disabled Single Slot PCIM User s Manual January 1994 GFK 0881 Configuration Example 46360 Serial port 2 is installed Serial port 1 is installed 4 Parallel port 2 is installed Diskette controller is present p These devices generate host interrupts so their interrupt lines XN cannot be assigned to a PCIM A B 5 C RI Both daughterboards connected to the bd same bus Connected to 3 two busses PCIM 1 Configuration Daughterboard A Memory Base Address 0E0000 Enabled I O Base Address 3E0 Enabled Interrupt Disabled Device 31 Baud 153 6K ext Outputs Enabled Watchdog Disabled Daughterboard B Memory Base Address 0E4000 Enabled I O Base Address 3E4 Enabled Interrupt Disabled Device 30 Baud 153 6K ext Outputs Enabled Watchdog Disabled PCIM 2 Configuration Daughterboard A Memory Base Address 0E8000 I O Base Address 3E8 Enabled Interrupt Disabled Enabled Device 28 Baud 76 8K Outputs Enabled Watchdog Disabled Daughterboard B Memory Bas
104. ion Description The Get Device Configuration call allows you to read device configuration information about a specific device on the serial bus GETDEVCONFIG reads this information from the PCIM selected by IMNUM into the Host memory DEVCONFIG parameter Again the format of DEVCONFIG is DEVCONFIG 0 Model Model Number of device DEVCONFIG 1 OutputDisable Output disable flag DEVCONFIG 2 Present Device Present flag DEVCONFIG 3 Reference Status Table or Reference Address DEVCONFIG 4 InputLength Control Input Data Length DEVCONFIG 5 OutputLength Control Output Data Length DEVCONFIG 6 Config Device Configuration 1 all inputs 2 all outputs 3 combination Device Configuration Not Used Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM DEVICENUM 0 31 Specifies device on serial bus DEVCONFIG 7 entries Device configuration of DEVICENUM STATUS Success Fail 5 22 Single Slot PCIM User s Manual January 1994 46365 GFK 0881 Status Value GETDEVCONHIG will almost always return SUCCESS If the target IM is currently offline has not been initialized or is out of range the following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater BADSBA Specified DEVICENUM is not in the range for Genius bus devices 0 31 decimal N
105. ion about Genius datagrams refer to the Genius I O System and Communications User s Manual GEK 90486 1 Single Slot PCIM User s Manual January 1994 GFK 0881 s Datagram Data A Datagram is a message comprised of application specific information with up to 128 bytes of user supplied data Datagrams may be directed from one bus device to another or broadcast to all devices A directed Datagram is secure in that the data link control layer of the protocol ensures it will be received at the destination device once and only once or aborted and alarmed after retry Datagram Service should be considered instead of Global Data if any of the following are true 1 Global Data takes up too much serial bus scan time for the application 2 More than 128 bytes of data are to be sent from one CPU to another 3 The data does not need to be sent every serial bus scan 4 The PLC CPU sweeptime receiving Global Data becomes too large for the application A Datagram may be transmitted with High Priority or at Normal Priority Normal Priority ensures that the bus scan time will only be modestly affected High priority will be sent as soon as the token is held by the PCIM Normal priority requires that no datagrams be sent for 1 bus scan prior to transmission of this datagram Bus scan time affects the response time of any I O data on the bus Using the same serial bus for CPU to CPU communications and I O block control may result in variable
106. is present on the serial bus If the target device is not present or is out of range GetINTR will return FAIL The following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 Coding Example This example shows how if an interrupt occurs on PCIM 1 to transfer the contents of that PCIMs Status Table Interpretation of bits will depend on which interrupt is Enabled and which application is to be run include lt pcim h gt int status unsigned char Intr 8 if status GetINTR 1 Intr SUCCESS report err 1 status else do what is necessary for interrupt processing GFK 0881 Chapter 4 C Programming for the PCIM 4 55 PutINTR Write to the Interrupt Disable Table 4 56 Code Summary include lt pcim h gt int PutINTR IMnum Disablelntr unsigned int IMnum unsigned char Disablelntr Description The Put Interrupt call allows you to write to the selected PCIM s Interrupt Disable Table The PutINTR call first initializes a table to Enable and Disable individual interrupts as you require The PutINTR call then writes this table to the Interrupt Disable Table on the PCIM You can Enable or Disable interrupts in any mix that is on a single call some interrupts may be Enabled and some Disabled all may be Enabled or all of the interrupts
107. ive devices in the Input Table of the specified PCIM Active inputs are those for which the Device Present flag is set to 1 itis the application s responsibility to know which devices are present on the bus via the GetBusConfig call Active input values are placed into the Host memory TOdata parameter IOdata must point to a 4096 byte buffer where the I O information will be saved The IOdata parm has the same format as the Input Table 32 slots of 128 bytes each Slots are in serial bus address order When GetBusln is called it begins by locking out the PCIM from updating its Input Table ensures data coherency across bus scans GetBusln then transfers the entire Input T ble to the IOdata parameter even for devices that are not active When the entire PCIM Input Table has been searched the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM lOdata 4096 bytes Data parameter will be copied from Host memory to specified PCIM Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status GetBusIn will return SUCCESS if any of the devices specified by the IMnum are active and data was transferred If no devices are present on the target IM if the target PCIM iscurrently offline has not been initialized or is out of range the following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater
108. ld In o Serial 2 a Co Serial 1 C lt Bus Connector for Daughterboard B i These terminals accept two AWG 20 wires each avg 54mm cross section plus one lead of a quarter Watt resistor optional used for bus termination The minimum recommended wire size is AWG 22 avg 36mm cross section Connect the Serial 1 terminal of each connector to the Serial 1 terminals of the previous device and the next device Connect the Serial 2 terminal of each connector to the Serial 2 terminals of the previous device and the next device If the PCIM has two daughterboards they may be connected to different busses or to the same bus Shield In of each connector must be connected to Shield Out of the preceding device For the first device on the bus Shield In can be left unconnected For the last device on the bus Shield Out can be left unconnected Start End 46356 Terminating BIOS BrBUS Terminating Resistor Resistor NEL s AMA Serial 1 e e Serial 1 Serial 2 2 Serial 2 Shield In 2 Shield In Shield Out or Iz Shield Out When making bus connections the maximum exposed length of bare wires should be two inches For added protection each shield drain wire should be insulated with spaghetti tubing to prevent the Shield In and Shield Out wires from touching each other GFK 0881 Chapter 3 Getting Started 3 3 Bus Termina
109. ll to access this message from the PCIM Memor y Access Datagrams Communications applications of the PCIM will for the most part be established between devices such as PLC CPUs and PCIM Hosts IBM PC AT XT These applications will use four memory access Datagrams Read Device the CPU may read the memory of another CPU on the bus through this message The CPU may use the SendMsgReply call then the GetMsg call in order to send the Read Device message and access the eventual reply respectively Read Device Reply When a Read Device message is received the PCIM and Host will service it by returning a Read Device Reply to the requesting CPU through the SendMsg call Write Device the CPU may write the memory of another CPU using this message Write Device allows byte writes Use the SendMsg call to transmit this message Bit Write the CPU may write the memory of another CPU using this message Bit Write is for setting or resetting a single circuit Use the SendMsg call to transmit this message These Datagrams allow the registers or I O Tables of a PLC CPU to be read or written from other bus devices If a Host wishes its internal database to be accessible user application programming must supply GetMsg calls to service Read Device and Write Device messages received by the PCIM The PCIM Host need not allow Write Device access to its memory This can be accomplished by rejecting all or specific Write Device messages Single Sl
110. m which input word will be read Offset 1 64 Input word offset in specified I O device in words Worddata 2 bytes Integer pointer used to store the word requested see above Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status GetWord will return SUCCESS if the device specified by IMnum is present on the serial bus and after the data is transferred to the DevData buffer If the target device is not present or is out of range GetWord will return FAIL If SUCCESS is returned then the requested word value will be saved in the location pointed to by Worddata The following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus devices 0 31 decimal or is that of the PCIM NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The device requested is currently not on the bus and data is NOT transferred OVERFLOW The Offset specified is greater than the devices InputLength in circuits UNDERFLOW The Offset is specified as zero 0 Coding Example Get the first word of device 8 on PCIM 1 include lt pcim h gt int status unsigned int Worddata status GetWord 1 8 1 amp Worddata GFK 0881 Chapter 4 C Programming for the PCIM 4 43 PutWord Write Output Word Value 4 44 Code Summary include lt pcim h gt int P
111. match the address shown on the screen For the default setting 222 hex the correct DIP Switch settings are HRH HF If communications are disrupted press any key to continue If you then want to exit the configuration software press the ESC key If you want to reset the PCIM press F10 Communications should be re established GFK 0881 Chapter 3 Getting Started 3 9 Writing the Configuration Data to the PCIM After you finish making the configuration entries for a PCIM if you want to write them to the PCIM press the F5 key The configuration software then reads the new configuration data back from the PCIM and displays it The Last Update field displays the time the configuration was updated If the two daughterboards have the same enabled memory or I O Base Address the update will NOT be performed If you want to read a configuration previously stored to the PCIM press F3 If you want to reset the PCIM press F10 Use the ESC key when you are ready to exit the configuration utility Running the Program in Tutorial Mode If you want to run the configuration software in tutorial mode but you do not want to change the I O Address type DPCIMCFG T In tutorial mode the software supplies default values for the entries and does not send entries you make to the PCIM Configuration Entries 3 10 The software displays the configuration for the specified PCIM s two daughterboards E N uGENI Module 0 Me
112. ming for the PCIM 5 31 PUTDEVOUT CALL Statement Syntax CALL PUTDEVOUT STATUS IMNUM DEVICENUM LENGTH DEVDATA 0 Action Write Device Data Only Description The PUTDEVOUT call allows you to write all of the control data outputs to a single serial bus device from the Host memory DEVDATA parameter IMNUM is the PCIM number configured during initialization The DEVICENUM parameter specifies the serial bus address of the device to which output data is to be written The LENGTH parameter is length of data to be sent to the device If the value differs from the PCIMs current data base an Overflow or Underflow error will be returned The DEVDATA parameter is a buffer where the data to be written is located The size of this buffer is determined by the LENGTH parameter located in the device s configuration data Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM DEVICENUM 0 31 Specifies device to which output word will be written LENGTH 0 128 Size of data buffer in bytes DEVDATA variable Buffer where the data to be written will be located see above STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value PUTDEVOUT will return SUCCESS if the device indicated is present on the given IMNUM and after the data is transferred to that device If the target device is not present or is out of range the following FAIL indications will be returne
113. n Duplicate IO Port values given GFK 0881 GFK 0881 Access from BASIC Every BASIC program which accesses the PCIM Software Driver must perform a short startup sequence to let BASIC know where each of the function call subroutines is located This startup sequence is listed below It is also included on the Driver diskette in the file PCIM BAS so you can copy it at the beginning of new programs rather than re code it every time you need it 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 OPTION BASE 0 DEFINT A Z DIM IMPARMS 383 IMFLAGS 63 IMSTATE 9 IMDATA 127 BUSCONFIG 223 DIM DEVDATA 127 IODATA 4095 MSG 139 DEVCONFIG 7 DIM INTR 6 DISABLEINTR 7 DEF SEG 0 SUBSEG PEEK amp H4F1 256 PEEK amp H4F0 DROFFSET PEEK amp H4F3 256 PEEK amp H4F2 IF SUBSEGO THEN 180 Non resident return PRINT PCIM Drivers not resident SYSTEM Continue normally DEF SEG SUBSEG INITIM 0 DROFFSET GETDEVIN 4 DROFFSET PUTDEVOUT 8 DROFFSET GETBUSIN 12 DROFFSET PUTBUSOUT 16 DROFFSET GETIMIN 20 DROFFSET PUTIMOUT 24 DROFFSET GETCIR 28 DROFFSET GETWORD 32 DROFFSET PUTCIR 36 DROFFSET PUTWORD 40 DROFFSET CHGIMSETUP 44 DROFFSET GETIMSTATE 48 DROFFSET GETBUSCONFIG 52 DROFFSET GETDEVCONFIG 56 DROFFSET DISABLEOUT 60 DROFFSET GETMSG 64 DROFFSE
114. n calls work together see Appendix A Example 2 GFK 0881 Chapter 4 C Programming for the PCIM 4 49 ChkMsgStat Read Message Progress Status 4 50 Summary include lt pcim h gt int ChkMsgStat IMnum Replystatus int IMnum char Replystatus Description The Check Message Status call allows you to determine the status of a previous SendMsg call that is to determine when a transmitted message has actually been received and its completion status IMnum is the PCIM number configured during initialization The Replystatus parameter is a pointer to a buffer where the Status will be stored The Replystatus parameter will contain the following Macro values IMFREE There is currently no activity IMBUSY Message is still in progress SUCCESS Message has successfully completed BADPARM Message contained a syntax error TXERR Message was not transmitted successfully Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Replystatus 0 1 Pointer to a buffer where the Status will be stored see above Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status ChkMsgStat will normally return the Status requested and a SUCCESS indication Other wise one of the following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitlM IMFAIL Th
115. n ie resia seaside engi Lal d Epp ais 2 1 PCIM Electrical Characteristics eee 2 1 Signal Conditioning E a eee eens 2 1 PCIM Status and Control 2 2 Daughterboard Shared RAM 6 6 eee eens 2 5 Chapter 3 Getting Started io sotisiutes Rao tame tenia ous bres Ge adis 3 1 Introduction eec etes OF rte ener bees epe tried 3 1 Hardware Required iaioe erren EE E E E A 3 1 Software Required zone hent uot ee rie RU Cete Rd 3 1 Setting the Board Address DIP Switch 6 6 eee eee 3 2 PCIM Installation si i e nh ea ar e 3 2 Connecting the Bus iiis cese ke hae a e ek dee Ee RE E RR 3 3 Removing the PCIM from the Bus 6 6 0 6 cece eee eee 3 4 Installing a Hand held Monitor Connector 0 000 c cece 3 5 PCIM Startup coss yon bande pex dee d er yg ite ed oe eae ya eke ea 3 7 Using the Configuration Software 6 6 6 6 eee eee 3 8 Notifying the Configuration Software of DIP Switch Change 3 8 Running the Configuration Software 6 cece eee ee 3 9 Configuration Entries ss iehi aae aa E EE EE EREE a EE E E 3 10 Configuration Example osna s nen ateta KAE AES ora nA AEE EENE ahai 3 13 Chapter 4 C Programming for the PCIM cece eee ee eee eens 4 1 Compiling your Application with Microsoft 0 000s cece eee ee 4 1 Software File Linkage ura eieae oiee eee eens 4 1 Software Driver Function Calls sees 4 2 Using Software Driver Function Calls
116. n is located The size of this buffer is determined by the GlobalLength parameter located in the PCIM s configuration data When PUTIMOUT is called it begins by Locking out the PCIM from reading from its Control Output Table ensures data coherency across bus scans PUTIMOUT then transfers all the data from this parm to the PCIMs Global Output buffer Once the transfer is complete the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM IMDATA variable Buffer where the data to be written will be located see above STATUS 0 1 Success Fail Status Value PUTIMOUT will return SUCCESS if the Global Data Length is non zero and the transfer is complete The following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 UNDERFLOW The GlobalLength parameter in IMPARMS is set to zero 0 Coding Example Write the specified global data to PCIM 1 2800 IMNUM 1 2810 IMDATA 0 amp H10 2820 Call PUTIMOUT STATUS IMNUM IMDATA 0 Chapter 5 BASIC Programming for the PCIM 5 35 GETCIRCALL Statement Syntax CALL GETCIR STATUS IMNUM DEVICENUM CIROFFSET STATE Action Read Input Circuit Value Description A Get Circuit call allows the state of a single input circuit to be read from the spec
117. nation 0 31 or broadcast Serial Bus Address of device unsigned char Function normally 20 h for Function Code Geniusmessages unsignedchar SubFunction hexvalue Sub Function Code See GEK 90486 2 unsignedchar Priority 1 0 Priority at which message is to be sent Normal Priority 0 High priority 1 unsignedchar Length 0 134 Length of message in bytes unsigned char Data 134 Actual message data in bytes Chapter 4 C Programming for the PCIM 4 11 Data Structures for Communications Send Message with Reply The following data structures are to be used for the SendMsgReply function call Type Name Range Description unsignedchar Destination 0 31 Serial Bus Address of device unsignedchar Function 10 20 h Function Code unsignedchar T SubFunction hexvalue Sub Function Code transmitted message See GEK 90486 2 unsignedchar R SubFunction hexvalue Sub Function Code expected re ply See GEK 90486 2 unsignedchar Priority 1 0 Priority at which message is to be sent Normal Priority 0 High priority 1 unsignedchar T Length 0 134 Length of message in bytes unsigned char Data 134 Actual message data in bytes Macros for the Message Functions The following Macro is to be used by the Destination variable in the message structures Macro Value Explanation define BROADCAST 255 Message to be sent in broadcast mode The following Macros are
118. nation address of Device Function code 0 111 Function Code normally 20 hex SubFunction code 0 255 Sub Function Code Priority 0 Normal 1 High Length Data field length length of message Data 0 134 Message Data depends on length parm You should check the status of the message using ChkMsgStat to determine if the message completed processing properly Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Msg see above Pointer to the buffer where the transmitted message will be stored see above Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status SendMsg will return SUCCESS if a message has been transferred from the Host memory to the PCIM Otherwise one of the following FAIL indications will be returned BADIMNUM Mnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 IMBUSY The PCIM is otherwise engaged and cannot accept the command Note You are responsible for defining the device the Function code the Sub F unction code and the length of the transmit Datagram Note You cannot issue a SendMsg call or read a received unsolicited message while a SendMsgReply call is in progress If this presents a timing problem use the SendMsg call See Also SendMsgReply GetMsg and ChkMsgstat
119. nd is SET DPCIMCFGzxxx where XXX is the new address Single Slot PCIM User s Manual January 1994 GFK 0881 Running the Configuration Software With the configuration software diskette installed or with the software files copied to your hard disk type the following command at the DOS prompt drive gt DPCIMCFG Pxxx T 46359 x i optional tutorial mode optional changed I O Address optional drive where software is located if different from present drive TheI O Address if entered must match the DIP Switch setting on the PCIM board If this flag is not used or if the value entered is not in the range 100 hex to 3FF hex the configuration software will use the default setting of 222hex Running the Program Normally In normal mode the software establishes communications with the PCIM Therefore the PCIM must already have its I O Address assigned using the DIP switches The software will look for it at its assigned address To run the configuration software in normal not tutorial mode type DPCIMCFG to run the software without specifying a new address or DPCIMCFG Pxxx to run the software with a new PCIM address The software establishes communications with the PCIM at the specified address Complete the configuration entries as explained on the following pages Lack of Communications If communications cannot be established check the DIP switch settings The DIP Switch address should
120. nected 46366 Bus In Bus Out DAD ane X1 Serial Uc 3i SA Shield In xi X2 sA SB SB Shield Out When making bus connections the maximum exposed length of bare wires should be two inches For added protection each shield drain wire should be insulated with spaghetti tubing to prevent the Shield In and Shield Out wires from touching each other As with other devices if the HHM Connector is at either end of its bus install an appropriate terminating resistor across the Serial 1 and Serial 2 terminals The Genius I O System and Communications User s Manual lists appropriate terminating resistors for each recommended bus cable type Single Slot PCIM User s Manual January 1994 GFK 0881 PCIM Startup You may now activate the PCIM as follows 1 25 Plug in and power ON the Host computer If the PCIM has not been configured insert the diskette containing the Software Driver and associated files into Drive B Set the disk drive to B Run the Configuration Software as described on the next page Beyond the self tests the PCIM will do nothing until it is explicitly taken out of RESET This is accomplished via the application program code you write specifically through the INITIM Software Driver function call GFK 0881 Chapter 3 Getting Started 3 7 Using the Configuration Software The configuration software is used to set up the characteristics of one or more PCIMs The PCI
121. nory base GCB8000 Enabled Iv0 base 220 Enabled Interrupt IRQ11 Enabled Device 31 Baud 153 6K Std Output Disabled Watchdog Disabled uGENI Module 1 Memory base OCCOO00 Enabled I 20 base 224 Enabled Interrupt IRQ10 Enabled Device 30 Baud 153 6K Std Output Disabled Watchdog Disabled Controller port 222 Source DPCIM environment variable System time Tue Dec 26 09 29 50 1993 Last update Tue Dec 28 09 28 40 1993 Ns Use the Up Arrow and Down Arrow keys to move between configuration fields and between daughterboards Type in entries where required see the following table or use the Right Arrow and Left Arrow keys to display the available choices for each field A configuration example follows the table Single Slot PCIM User s Manual January 1994 GFK 0881 GFK 0881 Definitions of Configuration Entries Option Entries Choices Comment Memory base If the daughterboard will be used enter a hexadeci Each daughterboard on a PCIM requires 16K of system memory This memory is used to store I O Address mal address The next field data buffers for communications data and a bid dd should be set to Enabled variety of other information You can locate this Enabled Disable f diedaughterbodid will memory anywhere space is available not be used it is not neces The memory base address is truncated down to sary to enter an address the nearest 16K boundary
122. nt diagnostic state of all circuits or controllers Use a SendMsgReply call then a GetMsg call to perform this function using the PCIM Read Configuration Read Configuration Reply allows the Host to read the current configuration of an I O Block or I O device Use a SendMsgReply call then a GetMsg call to perform this function with the PCIM Switch BSM allows the Host to switch a Bus Switching Module BSM to a specified bus and therefore test redundant bus operation while a system is running The Host requires a SendMsg call to send this message to an I O block Assign Monitor allows the Host to receive a Report Fault message from an I O block even though it is not defined as the controller of is not sending data to that device Use a SendMsg call to send this message to the block Pulse Test Pulse Test Complete allows the Host to toggle all outputs on a specific discrete I O block briefly to the opposite state Any faults are reported from the block to the Host through a Report Fault message and the block will reply with a Pulse Test Complete message when the test is finished The Host uses a SendMsgReply call to transmit this message to the block and a GetMsg call to retrieve the reply and any fault reports Configuration Change I O blocks and other I O devices will report any configuration changes of I O circuit configuration Status Table Reference Address HHM forces filter values etc The Host requires a GetMsg ca
123. nto the Host memory IODATA parameter IODATA must be an array buffer where the I O information will be saved The IODATA parm is 4096 in length 128 entries device times 32 devices Slots are in serial bus address order When GETBUSIN is called it begins by locking out the PCIM from updating its Input Table ensures data coherency across bus scans GETBUSIN then transfers the entire Input T ble to the IODATA parameter even for devices that are not active When the entire PCIM Input Table has been searched the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM IODATA 4096 bytes Data parameter will be copied to Host memory from specified PCIM STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value GETBUSIN will return SUCCESS if any of the devices specified by the IMNUM are active and data was transferred If no devices are present on the target IM if the target IM is currently offline has not been initialized or is out of range the following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE No devices are currently on the bus however the appropriate buffer is still returned and will contain data for devices once logged in Coding Ex
124. on software overview 1 6 running Connectors Control bits Index D Datagrams 63 y Daughterboard Device Configuration Table 2 ES co a uration dog EA 4 24 5 22 EN Device number DIP switch settings b 2 Directed Control Input Table DisableOut 14 2 4 26 5 2 5 24 DOS interrupt 5 10 DOS requirements i d Drive capability E Electrical characteristics Electrical specifications 1 5 Environmental specifications Error status File linkage for C program 4 1 Functions software 4 2 5 2 G GetBusConfig 4 4 2 4 EF 4 22 b GetBusIn 4 2 4 2 4 4 28 5 GetCir 4 2 l2 4 38 5 GetDevConfig 4 GetDevIn 4 2 4 3 GetIMIn 4 36 5 3 R q n2 c N E OQ foe eel KILN Id m S W Os 5 gi wu N N BAE N q oo an GetIMState 4 2 4 20 5 2 5 18 GetINTR 4 3 14 54 5 3 5 52 GetMsg 4 3 4 52 5 3 b 50 GetWord 4 4 2 4 42 b 5 21 b Global Data 6 1 7 3 sending 4 37 5 35 Index 1 Index Index 2 H Hand held Monitor Hand held Monitor connector B 5 Heartbeat Enable Heartbeat Timeout Multiplier HHM Test bit Host Clear I Oblocks I OTable Lockout Initialization function 4 2 4 15 5 2 5 13 InitIM 1 15 5 13 Inputs read 4 2 4 28 2 524 B30 E 36 Installation B 2 Interrupt Disable Table Interrupt request 2 3 Interrupt Status Table 2 5
125. ontroller which interfaces a Genius bus to a Series Six PLC This book describes the installation and operation of the Bus Controller It also contains the programming information needed to interface Genius I O devices to a Series Six PLC SeriesFive BusControllerUser s Manual GFK 0248 Reference manual for the Bus Controller which interfaces a Genius bus to a Series Five PLC This book describes the installation and operation of the Bus Controller It also contains the programming information needed to interface Genius I O devices to a Series Five PLC We Welcome Your Comments and Suggestions At GE Intelligent Platforms we strive to produce quality technical documentation After you have used this manual please take a few moments to complete and return the Reader s Comment Card located on the next page Jeanne L Grimsby Senior Technical Writer vi Single slot PCIM User s Manual January 1994 GFK 0881 Contents Chapter 1 ENGOd HCH ON a 44 065033 Zi idea id ied ad daban ID CR Ra duets 1 1 Deseription k2es edes I pee seg werd arg RR Re be ER eter pe e ed 1 2 Daughterboard reser edt eee he he PA he etc 1 3 Motherboard 5 te b eub ed E end 1 3 Paceplate c oed enc e A dtes MOM oa Ace ss esM D ca der 1 3 Genius I O System Overview 0 000 00 0c cece eee eee ees 1 4 Specifications Lii rane wee Reads vr tenet vb ip de In dert Tee aes aed 1 5 PEIM Sottwarte i200 tree betae vetu eed 1 6 Chapter 2 Operaio sesi eee
126. ord value will be saved in the location WORDDATA The following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus devices 0 31 decimal or is that of the PCIM NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The device requested is currently not on the bus and data is NOT transferred OVERFLOW The Offset specified is greater than the devices InputLength in circuits UNDERFLOW The Offset is specified as zero 0 Coding Example Get the first word of device 8 on PCIM 1 3300 IMNUM 1 3310 DEVICENUM 8 3320 CIROFFSET 1 3330 Call GETWORD STATUS IMNUM DEVICENUM CIROFFSET WORDDATA GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 41 PUTWORD CALL Statement 5 42 Syntax CALL PUTWORD STATUS IMNUM DEVICENUM CIROFFSET WORDDATA Action Write Output Word Value Description A Put Word call allows you to write a single output word from the Host memory WORDDATA parameter to the specified PCIMs Output Table The WORDDATA parameter is an integer which PUTWORD uses for the word to be transmitted IMNUM is the PCIM number configured during initialization The DEVICENUM parameter specifies the serial bus address of the device where the output word is to be sent The CIROFFSET parameter indicates which word of the specified device is to be writt
127. ot PCIM User s Manual January 1994 GFK 0881 Software Driver function calls are also used to transmit Datagram data The SendMsg call is used to send Read Device and Write Device datagams For More Information For applications using datagrams refer to the Genius I O System and Communications User s Manual GEK 90486 1 for detailed information GFK 0881 Chapter 6 Communications 6 5 Chapter Troubleshooting Introduction Aswith program debugging hardware firmware troubleshooting is accomplished by thinking logically of the function of each part of the system and how these functions interrelate A basic understanding of the various indicator lights will help you quickly isolate the problem to the PCIM a Bus Controller an I O rack an I O Block or the CPU The total system has to be considered when problems occur The CPU Host computer I O Blocks and external devices connected to or controlled by the Genius I O system must all be operating and connected properly All cable connections as well as all screw down or soldered connections should be checked carefully Sometimes you need someone to talk to who can answer your questions When you do first call your local authorized GE distributor After business hours please do not hesitate to call the Programmable Control Emergency Service Number 804 978 5747 Replacement Module Concept GFK 0881 When a problem arises first isolate it to the major assembly then to t
128. p on AO N Output disable flag for device 2 For more information about the content of the BUSCONFIG array see page 4 10 DEVCONFIG The user supplied DEVCONFIG array is a system return very similar to BUSCONFIG array except that it can only read the configuration of 1 device at a time The format of DEVCONFIG is Model number of device specified Output disable flag Device present flag Reference address for device Control Input data length for device Control Output data length for device oo A O N oO O Configuration for device For more information about the content of the BUSCONFIG array see page 4 10 5 6 Single Slot PCIM User s Manual January 1994 GFK 0881 IODATA The IODATA array is used to read and or write I O data to and from the PCIM input output tables to all the devices on the bus User supplied for PUTBUSOUT call Systemreturned for GETBUSIN call The format of IODATA is 46361 olii I J e circuit 4 if discrete 8 circuit block Device 1 128 a circuit 13 if discrete 129 ES 16 circuit block Device 2 4096 128 each device J 256 p 257 circuit 32 if analog 258 32 circuit block Device 3 259 J 384 DEVDATA The DEVDATA array is very similar to IODATA except that itis used to read and or write I O data to and from the PCIM input ou
129. pdating the Directed Control Input Table ensures data coherency across bus scans GETIMIN then transfers all the data in this table into Host memory Once the transfer is complete the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM IMDATA variable Buffer where the data read will be located see above STATUS Success Fail Status Value GETIMIN will return SUCCESS if the InputLength is non zero and the data transfer is complete The following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 UNDERFLOW The InputLength of the PCIM is set to zero 0 Coding Example Get the directed input data from PCIM 1 2700 IMNUM 1 2710 Call GETIMIN STATUS IMNUM IMDATA 0 Single Slot PCIM User s Manual January 1994 GFK 0881 GFK 0881 PUTIMOUT CALL Statement Syntax CALL PUTIMOUT STATUS IMNUM IMDATA 0 Action Write the Global Output Table Description The PUTIMOUT call allows you to write Global Data from the Host memory IMdata parameter to the Global Data Output Table of a specified PCIM This data is subsequently broadcast to all CPUs on the bus every bus scan IMNUM is the PCIM number configured during initialization The IMDATA parameter is a buffer where the data to be writte
130. puts STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value DISABLEOUT will return SUCCESS if the device specified by IMNUM is present on the serial bus Otherwise DISABLEOUT will return FAIL If DEVICENUM indicates ALL then DISABLEOUT will almost always return SUCCESS The following FAILindications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater BADSBA Specified DEVICENUM is not in the range for Genius bus devices 0 31 decimal NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 Coding Example Enable outputs to device 8 on PCIM 1 1600 DEVICENUM 8 1610 IMNUM 1 1620 FLAG 2 0 1630 Call DISABLEOUT STATUS IMNUM DEVICENUM FLAG Disable outputs to all devices on PCIM 1 1700 DEVICENUM 32 1710 IMNUM 1 1720 FLAG 1 1730 Call DISABLEOUT STATUS IMNUM DEVICENUM FLAG GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 25 GETBUSIN CALL Statement Syntax CALL GETBUSIN STATUS IMNUM IODATA 0 Action Read all Input Values Description A Get Bus Inputs call allows you to read input values from all active devices in the Input Table of the specified PCIM Active inputs are those for which the Device Present flag is set to 1 itis the application s responsibility to know which devices are present on the bus via the GETBUSCONFIG call Active input values are placed i
131. r 6 describes Global Data and datagram communications for a PCIM Chapter 7 Troubleshooting Chapter 7 lists basic diagnostic procedures Appendix A Example Applications Appendix A shows three programming examples for the PCIM Related Publications GFK 0881 For more information refer to these publications Genius I O System User s Manual GEK 90486 1 Reference manual for system designers programmers and others involved in integrating Genius I O products ina PLC or host computer environment This book provides a system overview and describes the types of systems that can be created using Genius products Datagrams Global Data and data formats are defined Preface Genius Discrete and Analog Blocks User s Manual GEK 90486 2 Reference manual for system designers operators maintenance personnel and others using Genius discrete and analog I O blocks This book contains a detailed description specifications installation instructions and configuration instructions for all currently available discrete and analog blocks Series 90 70 Remote I O Scanner User s Manual GFK 0579 Reference manual for the Remote I O Scanner which interfaces a drop containing Series 90 70 modules to a Genius bus Any CPU capable of controlling the bus can be used as the host This book describes the Remote I O Scanner features configuration and operation SeriesSix BusControllerUser s Manual GFK 0171 Reference manual for the Bus C
132. rintf nGetDevConfig successful print Device Present 9ed config Present print n Device reference address d n config Reference Use the PutCir driver to turn on pt 3 of the Genius I O block for x 0 x lt OXFFFF x for y 0 y OxF y if ret PutCir pnum dnum offset char 1 SUCCESS printf nPutCir failure returned d n ret else printf nPutCir driver successful Pt 3 should be ON n for x 0 x lt OXFFFF x for y 0 y lt OxF y Use the DisableOut driver to disable the updating of the block thus turning pt 3 off if ret DisableOut pnum dnum DISABLE SUCCESS GFK 0881 Appendix A Example Applications A 7 iE yi ri printf nDisableOut failure returned d n ret else printf nDisableOut driver successful Outputs shd be off n for x 0 x OxFFFF x for y 0 y lt OxF y DisableOut pnum dnum ENABLE Use the GetBusln driver to read all input data on the PCIM bus Display input data for device 1 if ret GetBusln pnum INdata SUCCESS printt nGetBusln failure returned d n ret else printf nGetBusIn successful printt n Input data X n Ndata Use the PutBusOut driver to write output data to the discrete block Turn on pt 3 4 5 OUTdata 128 0x1C if ret PutBusOut pnum OUTdata SUCCESS printf nPutBusOut failure r
133. serial bus terminals Sin a lein on jeas 1 27 cm 4 249cm A al Eun lt Hand held Monitor d Connector VA fen Sy l d A P SS NJ Panel Mounting Ear 2 834 in 7 198 cm UN E N DOL N Xi X2 SA SB P 2 Serial Bus Terminals ed eA xy seal X2 Serial2 SA Shield In shown at 10096 of actual size SB Shield Out Mounting the HHM Connector This unit can be easily mounted on a rail such as a standard 35mm shown below or 15mm DIN rail The panel mounting ears are not used if the unit is installed on a DIN rail 46358 35mm DIN rail d SS N LAE 7 Removable DIN rail Mounting Feet 91 side view shown at 5096 of actual size Altematively it can be installed directly on a panel using screws through its mounting ears The DIN rail feet on the back of the unit are removed when the unit is panel mounted GFK 0881 Chapter 3 Getting Started 3 5 Making the Bus Connections The HHM connector has two sets of terminals one for incoming cable and the other for outgoing cable Connect the Serial 1 Serial 2 and Shield In terminal of either connector to the previous device Connect the Serial 1 Serial 2 and Shield Out terminal of the other connector to the next device For the first device on the bus Shield In can be left unconnected For the last device on the bus Shield Out can be left uncon
134. skable The two daughterboards on the PCIM may have interrupt different interrupt levels They may also have the same interrupt level if you plan to poll both boards with the same interrupt service routine Device This is the Serial Bus Ad Each device on a Genius bus must have a unique dress Enter a decimal number from 0 to 31 serial bus address If two daughterboards on the same PCIM will be connected to the same bus they are considered independent devices and each must have a unique bus address Chapter 3 Getting Started Option Entries Choices Comment Baud Specify the baud rate of the serial bus 38 4K 76 8K 153 6K standard or 153 6K extended All devices on the same bus must be set to use the same baud rate If two daughterboards on the same PCIM are con nected to separate busses that operate at different baud rates their configuration should match the baud rates of the busses to which they are at tached Outputs Enabled or Disabled This entry selects whether outputs from a PCIM daughterboard to other devices on the bus will be enabled at startup Watchdog Timer Enabled or Disabled This timer is not used with the Software Library and should be disabled for Software Library applications For other applications it can be used to monitor the Host system and shut off the PCIM when the Host malfunctions When the timer is enabled you must pulse the t
135. stination 031 255 brdcst Destination address of Device Function code 0 111 Function Code T SubFunction code 0 255 Transmitted Reply Sub Function Code R_SubFunction code 0 255 Expected Reply Sub Function Code Priority 0 Normal 1 High T Length Data field length length of message Data 0 134 Message Data depends on length parm You can check the status of the message using ChkMsgStat to determine if the message completed processing properly Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Msg see above Pointer to the buffer where the transmitted message will be stored see above The advantage of the SendMsgReply call over the SendMsg call is that it reduces user programming since a 10 second timeout to a non responding device is automatically provided by the PCIM for a SendMsgReply call The Host program sequence for a SendMsgReply is as follows 1 Hostsends a SendMsgReply to the PCIM 2 Hostissues GetMsg calls until the Status indicates completion GetMsg will also return the reply message into Host memory Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status SendMsgReply will return SUCCESS if a message has been transferred from the Host memory to the PCIM Otherwise one of the following FAIL indications will be returned BADIMNUM Mnum is out of range a count of 64 or greater NOI
136. tCir PutWord Using the PCIM H library declare the following variables IMPARMS imparm IMSTATE imstate DEVICE device 32 DEVICE config The following arrays are declared for use as data storage in the program unsigned char INDdata 128 GFK 0881 INdata 4096 OUTdata 4096 Appendix A Example Applications main int ret X 0 y 0 pnum 1 dnum 1 offset 3 char val valword 1 flags JE i ie unsigned char Igth length Define the PCIM parameters This assignment reflects the hardware setup of the PCIM and it is DIP switches imparm im Segment 0xD000 imparm im IOPort Ox3E4 imparm IMRef 0x0000 imparm OutputLength 0 imparm InputLength 0 imparm Active ON Use the InitIM driver to initialize the PCIM for x 0 X OxFFF x if ret InitlM pnum amp imparm amp flags SUCCESS printf nInitIM failure returned d n ret else printf nInitlM driver successfuln for x 0 x lt OxFFFF x for y 0 y lt OxF y Use the ChglMSetup driver to change the IMREF value from 0 to 0x1212 Note that all parameters in the imparm array are transferred to the PCIM imparm IMRef 0x1212 if ret ChglMSetup pnum amp imparm SUCCESS printf nChgIMSetup failure returned d n ret printf nSegment x imparm im Segment printf nlOPort x imparm im OPort printf n
137. tINTR will return SUCCESS if the device specified by IMnum is present on the serial bus If the target device is not present or is out of range PutIntr will return FAIL The following FAIL indications will be returned BADIMNUM Mnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 Coding Example This example enables the Receive Datagram interrupt include lt pcim h gt int status X unsigned char Disablelntr 8 nitialize the Disable Table for x 20 x lt 8 X Disablelntr x DISABLE Disable all Interrupts Enable Receive Datagram Interupt Disablelntr RECEIVE D ENABLE Now call use the call if status PitiNTR 1 Disablelntr SUCCESS report err 1 status GFK 0881 Chapter 4 C Programming for the PCIM 4 57 Chapter BASIC Programming for the PCIM 5 This chapter explains programming for a PCIM in BASIC Programming requires BASIC MSOS Basic Software Driver Installation The Basic Software driver function call subroutines are made resident in your system when you execute the driver code file once under MS OS as follows Type PCIMX in response to the DOS prompt A gt if disk is in drive A The Driver code file is loaded into memory A short initialization sequence inside the Driver is executed The Driver code displays
138. tay turned off and will not put the PCIM into RESET If the watchdog timer is enabled by the configuration software this bit must be pulsed at least every 727mS to keep the watchdog timer from expiring This bit must be pulsed at least once to allow the daughterboard to come out of RESET 1 Clear RESET Request When the system is Reset or when the voltage detector on the motherboard detects a low voltage condition status bit 0 see previous page goes to 0 Command bit 1 Clear Reset clears the reset request when set to 0 To prepare for the next detection of RESET or low voltage condition it must be reset to 1 2 Clear Interrupt Request This bit is used to clear an interrupt to the motherboard from a daughterboard Setting the bit to 0 clears the interrupt It must then be set back to 1 to prepare it for the next interrupt 3 HHM Test An HHM present can be indicated even when one is not plugged in by raising this bitto 1 After power up and under normal conditions this bit should be 0 6 PCIM RESET When this bit is 0 it resets the PCIM Under normal conditions it should be left high Single Slot PCIM User s Manual January 1994 GFK 0881 Daughterboard Shared RAM Relative Location dec hex 0000 0000 2176 0880 2177 0881 2178 0882 2194 0892 2210 08A2 2226 08B2 2242 08C2 2258 08D2 2498 09C2 2632 0A48 2633 0A49 2634 OA4A 2635 OA4B 2699 0A8B 2747 OABB 2749 OABD 2751 OABF 7680 1E00 7936 1
139. th Control Output Data Length unsigned char Config Device Configuration 1 all inputs 2 all outputs 3 combination Device Configuration Not Used Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Config 256 bytes Device configuration information about all devices on a serial bus see above 4 22 Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status GetBusConfig will almost always return SUCCESS If the target PCIM is currently offline has not been initialized or is out of range the following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE No devices are currently active on the bus However the appropriate buffer is still returned and will contain configura tion data for devices once logged in Zeros will be returned if no device has logged in to a particular slot Coding Example Examine the configuration of the devices on PCIM 1 include lt pcim h gt int status DEVICE ConfigIMAXDEVICE status GetBusConfig 1 Config GFK 0881 Chapter 4 C Programming for the PCIM 4 23 GetDevConfig Get Device Configuration Code Summary include lt pcim h gt int GetDevConfig IMnum Devicenum Config
140. the function GetIMState Serial Bus Address Baud Rate 00 153 6 ext 01 38 4 10 76 8 11 153 6 std Outputs enable disable at powerup 1 disable 0 enable Macro Value Explanation define RAMERR 0 RandomAccess Memory error define EPROMERR 1 EPROM error define CPUERR 2 CPU error define COMMERR 3 Communications Bus error define SBAMASK Ox1F Serial Bus Addressmask define BAUDMASK 0x60 Baud Rate Mask define OUTPUTMASK 0x80 OutputEnable Disablemask GFK 0881 Chapter 4 C Programming for the PCIM 4 9 4 10 Data Structures for Bus Configuration The following data structures are to be used for the GetBusConfig function call Type Name Range Description unsignedchar Model 4 139 Model Number of serial bus de vice unsignedchar OutputDisable 1 0 Output Disable flag values shown below unsignedchar Present 1 0 Device Present flag shown below unsigned int Reference 0 8001 d Global Data Reference Begin 0 FFFF h ning address of the Global Data ofthe broadcasting CPU unsignedchar InputLength 0 128 Device input data length unsignedchar OutputLength 0 128 Device output data length unsignedchar 1 3 Device Configuration as shown Config below 7 6 5 4 3 2 1 0 Device Configuration Not Used Macros for GetBusConfig The following Macros are to be used with the function
141. the message PCIM Drivers Version x x are Resident and exits to DOS The Driver is resident in memory and available for use BASICA or GWBASIC can be loaded and calls to the Drivers performed If you need to recover the memory space occupied by the Driver you must perform a system reset In most cases this will not be necessary since Driver code occupies only a small amount of memory 13K If you plan to access the Driver frequently the Driver code file can be moved to your system disk and executed from inside your AUTOEXEC BAT file at startup This will automatically make the Driver resident GFK 0881 5 1 Software Driver Function Calls The PCIM Software Driver consists of easy to use macro oriented function calls you code appropriately in your C language or Basic language applications routines Function calls are summarized below Functions that deal with PCIM configuration InitIM assigns PCIM numbers and Global data parameters to all PCIMs Performs any required hardware activation and initialization of the PCIMs such as Reset ChgIMSetup writes to the Setup Table of the selected PCIM from the Host memory to change PCIM parameters GetIMState reads PCIM configuration and status from the selected PCIM Status Table and Setup Table into Host memory Functions that deal with bus configuration GetBusConfig reads all Device Configuration Tables from the selected PCIM into Host memory G
142. the specified Global Data to PCIM 1 include lt pcim h gt int status char IMdata 128 IMdata 2 0x10 status PutlMOut 1 IMdata Chapter 4 C Programming for the PCIM 4 37 GetCir Read Input Circuit Value Code Summary include lt pcim h gt int GetCir IMnum Devicenum Offset State unsigned int IMnum Devicenum unsigned int Offset char State Description A Get Circuit call allows the state of a single input circuit to be read from the specified PCIMs Input Table and be placed into the Host memory State parameter IMnum is the PCIM number configured during initialization The Devicenum parameter specifies the serial bus address of the device which contains the input circuit The Offset parameter indicates which bit of Devicenum is to be read This value ranges from 1 through 1024 in bits State is a character pointer in which GetCir will store the value of the circuit as indicated by the above parameters The contents of State will be either a 1 or 0 ON or OFF Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Devicenum 0 31 Specifies I O device from which input circuit will be read Offset 1 1024 Input circuit offset in specified I O device in bits State 0 1 ON or OFF condition of circuit read from PCIM Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status GetCir will return SUCCESS if the targ
143. tion A bus must be terminated at each end by impedance that is correct for that cable type Impedance will be 75 100 120 or 150 ohms If a PCIM connector is at either end of its bus install the appropriate terminating resistor across the Serial 1 and Serial 2 terminals The Genius I O System and Communications User s Manual lists appropriate terminating resistors for each recommended bus cable type Removing the PCIM from the Bus The PCIM s bus connectors are removable they can be removed while the system is operating without compromising data integrity on the bus To remove a bus connector hold it carefully by its top and bottom sides and pull it away from the PCIM If an operating cable is presently attached to the bus be very careful not to touch the bus wires to each other or to anything else Do not put the connector down on a conductuve surface Individual bus wires should never be removed from the connector terminals while the bus is in operation the resulting unreliable data on the bus could cause hazardous control conditions Single Slot PCIM User s Manual January 1994 GFK 0881 Installing a Hand held Monitor Connector The PCIM does not have a built in connector for a Genius Hand held Monitor However a Hand held Monitor connector can be added directly to the serial bus at any location The unit shown below catalog number 44A736310 001 RO001 is provided with the PCIM It provides a Hand held Monitor connector and
144. to be used by the Priority variable in the message structures Macro Value Explanation define NORMALP 0 Message to be sent at normalpriority define HIGHP 1 Message to be sent at high priority 4 12 Single Slot PCIM User s Manual January 1994 GFK 0881 Macros for Interrupts The following Macros are used in the PutINTR and GetINTR function calls Macro Value Explanation define I ENABLE 0 Enable the interruptlevel define I DISABLE 1 Disable the interruptlevel define I SUMMARY 0 Summary if interruptoccurred define I REQUEST Q 1 Receivedmemorydatagram define I PCIM STAT 2 PCIM Status Change unless initiated by the host this is usually fatal define I DEV STAT 3 DeviceStatus Change define I OUT SENT 4 Outputs sent end of bus access define I CCOMPLETE 5 Command Blockcompleted define I RECEIVE D 6 ReceivedDatagram Miscellaneous Character Buffers and Integers The following character buffers and integers are used in various calls Type Name Range Description int IMcount 1 64 Totalnumber of PCIMs int IMnum 1 64 Relativenumber of PCIM int Devicenum 0 31 Specifies device on Serial Bus unsigned int Offset 1 1024 Specifies device on Serial Bus unsigned int Worddata 0 FFFF Pointer to store the word re quested char IMflags 0 63 Tells you which PCIMs initialized properly orimproperly char Flag
145. tput tables to a device on the bus User supplied for PUTBUSOUT call System returned for GETBUSIN call The format of DEVDATA is 4 9e doeet cu p SESS 128 Data to from device specified Y 127 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 7 IMDATA The IMDATA array is a buffer where Global Data to be read will be located The size of this parameter is determined by the Inputlength parameter located in the PCIMs configuration data The format of IMDATA is A 0 46363 128 Data to from PCIM specified y 127 MSG The MSG array is a buffer where the message to be sent SENDMSG or message to be received GETMSG will be stored The format of MSG is A 0 46364 139 138 For explanations of the content of the MSG array see pages 4 11 and 4 12 5 8 Single Slot PCIM User s Manual January 1994 GFK 0881 INTR DISABLEINTR The INTR and DISABLEINTR arrays are used to read the selected PCIMs Interrupt Status Table and write to the selected PCIMs Interrupt Disable Table respectively The format of INTR and DISABLEINTR is Summary if interrupt occurred Received memory datagram PCIM status change usually fatal Device status change Outputs sent end of bus access Command Block completed oo A O N oO Receive
146. uffer where message to be sent is stored see above STATUS Success Fail Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value SENDMSG will return SUCCESS if a message has been transferred from the Host memory to the PCIM Otherwise one of the following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 IMBUSY The PCIM is otherwise engaged and cannot accept the command Note You are responsible for defining the device the Function code the Sub F unction code and the length of the transmit Datagram Note You cannot issue a SENDMSG call or read a received unsolicited message while a SENDMSGREPLY call is in progress If this presents a timing problem use the SENDMSG call See Also SENDMSGREPLY GETMSG and CHKMSGSTAT Coding Example Send a Read Diagnostics message to device 8 on PCIM 1 This message will read 10 bytes of diagnostic data beginning at offset 0 3800 IMNUM 1 3810 MSG 0 8 Destination 3820 MSG 1 amp H20 Function Code 3830 MSG 2 8 Sub Function Code 3840 MSG 8 0 Priority 3850 MSG 4 2 Message Length Sent 3860 MSG 5 0 Offset 3870 MSG 6 10 Length to be Read 3880 Call SENDMSG STATUS IMNUM MSG 0 To see how the message function calls work together see Appendix A Example 2 GFK 0881 Ch
147. um parameter specifies the serial bus address of the device from which input data is to be written The DataLngth parameter points to the location where the number of data bytes read from device is to be stored The Devdata parameter is a character pointer to a buffer where the data to be written will be located The size of this buffer is determined by the InputLength parameter located in the device s configuration data Parameters are summarized as follows Parameter Values Function IMnum 1 64 Devicenum 0 31 DataLngth 0 128 Devdata variable Relative number of PCIM Specifies device on serial bus from which input word will be read Character pointer to size of data buffer Character pointer to a buffer where the data to be read from device is written see above Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status GetDevIn will return SUCCESS if the device specified by IMnum is present on the serial bus and after the data is transferred to the DevData buffer If the target device is not present or is out of range the following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus de vices 0 31 decimal or is that of the PCIM itself NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The de
148. ur of the parameters should be allowed to be changed These are as follows IMPARMS I 2 Reference Address IMPARMS I 3 Global data length IMPARMS I 4 Input data length IMPARMS I 5 Active 1 ON 0 OFF IMNUM 1 6 Parameters are summarized as follows Parameter Values Function IMNUM 1 64 Relative number of PCIM IMPARMS varies shows the characteristics of each module see above STATUS 0 1 success fail 5 16 Single Slot PCIM User s Manual January 1994 GFK 0881 Status Value CHGIMSETUP will return SUCCESS if all changes were accepted by the target IM If the IM fails to change to the new parameters the following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 or never com pleted processing the config change command IMBUSY The PCIM is otherwise engaged and cannot accept the con fig change command BADCFG This PCIM rejected the configuration because a parameter was out of range NOCFG The PCIM after examining the received the config change command found no changes to make INITFAIL Change of Global Data output or Directed Data input length required a reset of PCIM daughterboard and the daughter board failed to reinitialize Coding Example Change the reference address for PCIM 1 600 IMNUM 1 610 IMPARMS 2 amp H6000 new referen
149. uracy completeness sufficiency or usefulness of the information contained herein No warranties of merchantability or fitness for purpose shall apply indicates a trademark of GE Intelligent Platforms Inc and or its affiliates All other trademarks are the property of their respective owners Copyright 2010 GE Intelligent Platforms Inc All Rights Reserved Contact Information If you purchased this product through an Authorized Channel Partner please contact the seller directly General Contact Information Online technical support and http www ge ip com support GlobalCare Additional information http Awww ge ip com Solution Provider solutionprovider ip ge com Technical Support If you have technical problems that cannot be resolved with the information in this guide please contact us by telephone or email or on the web at www ge ip com support Americas 1 780 420 2010 if toll free 800 option is unavailable Technical Support Email support ip ge com Europe the Middle East and Africa 4352 26 722 780 if toll free 800 option is unavailable or if dialing from a mobile telephone Asia Pacific support jp ip 2 ge com ini i 21 3217 4826 su cn i i customercare cn ip ge com China Preface The intent of this manual is to supply the user with enough information to establish the GE Single slot PC Interface Module PCIM as an entry point into the Genius I O System The PCIM is desi
150. ured during initialization The Devicenum parameter specifies the serial bus address of the device which contains the target output circuit The Offset parameter indicates which bit of Devicenum is to be written This value ranges from 1 through 1024 in bits State is a character in which PutCir will use as desired the value of the circuit The contents of State should be either a 1 or 0 ON or OFF Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Devicenum 0 31 Specifies I O device to which output circuit will be written Offset 1 1024 Output circuit offset in specified I O device in bits State 0 1 Variable State is written from the Host memory to the specified PCIM Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status PutCir will return SUCCESS if the target device is present on the given IMnum If the target device is not present or is out of range PutCir will return FAIL The following FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus de vices 0 31 decimal or is that of the PCIM NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The device requested is currently not on the bus and data is NOT transferred OVERFLOW The Offset specified is greater than the
151. utWord IMnum Devicenum Offset Worddata unsigned int IMnum Devicenum unsigned int Offset Worddata Description A Put Word call allows you to write a single output word from the Host memory Worddata parameter to the specified PCIMs Output Table The Worddata parameter is an integer which PutWord uses for the word to be transmitted IMnum is the PCIM number configured during initialization The Devicenum parameter specifies the serial bus address of the device where the output word is to be sent The Offset parameter indicates which word of the specified device is to be written This value ranges from 1 through 64 in word quantities When PutWord is called it begins by locking out the PCIM from updating the Shared RAM ensures data coherency across bus scans PutWord then transfers the word data to the device Once the transfer is complete the PCIM is unlocked Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Devicenum 0 31 Specifies device to which output word will be written Offset 1 64 Output word offset in specified device in words Worddata 2 bytes Integer used to store the word requested see above Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status PutWord will return SUCCESS if the device specified by IMnum is present on the serial bus If the target device is not present or is out of range PutWord will return FAIL The follo
152. valword 0 for x 0 x lt OxFFFF x for y 0 y lt OxF y Use the PutWord driver to turn on pt 4 on the discrete block offset 1 valword 1 0x08 if ret PutWord pnum dnum offset valword 1 SUCCESS printf nPutWord failure returned d n ret else printf nPutWord successful printt n Pt 4 should be ON for x20 x lt OxFFFF x for y20 y OxF y Exit the program by turning off the module imparm Active OFF ChglMSetup pnum amp imparm Appendix A Example Applications A 9 Example Application 3 This example shows in BASIC the way the SENDMSG or SENDMSGREPLY and CHKMSGSTATUS message functions must be used together The comments in the text provide a running commentary for the use of each driver 010 CALL SENDMSG or SENDMSGREPLY STATUS IMNUM MSG 0 2020 IF STATUS 12 THEN 2050 IF PCIM is busy go to 2050 2030 IF STATUS lt gt 0 THEN 2170 IF STATUS is anything other then O 2040 something is wrong go to 2170 2050 GO TO 2110 SENDMSQG was executed O K go to 9110 to 2060 check msg status 2070 CALL CHKMSGSTAT STATUS IMNUM MSGSTATUS 2080 IF STATUS lt gt 0 THEN 2170 If Sonos is anything other then 0 2090 something is wrong go to 2170 2100 If MSGSTATUS 12 THEN 3050 If PCIM busy stay in this loop and go 2110 sback to 2050 2120 IF MSGSTATUS 16 THEN 2010 If PCIM is free go back to 2010 and 2130 execute SENDMSG
153. ve number of PCIM STATUS 0 1 Success Fail 5 18 Single Slot PCIM User s Manual January 1994 GFK 0881 Status value GETIMSTATE will almost always return SUCCESS If the target IM is currently offline has not been initialized or is out of range the following FAIL indications will be returned BADIMNUM IMNUM is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized INITIM IMFAIL The indicated PCIM has failed PCIM OK 0 Coding Example Examine the state of PCIM 1 1000 IMNUM 1 1010 CALL GETIMSTATE STATUS IMNUM IMST ATE 0 GFK 0881 Chapter 5 BASIC Programming for the PCIM 5 19 GETBUSCONFIGCALL Statement Syntax CALL GETBUSCONFIG STATUS IMNUM BUSCONFIG 0 Action Get Serial Bus Configuration Description The Get Bus Configuration call allows you to read device configuration information about all devices on a serial bus except the PCIM GETBUSCONFIG reads all 32 Device Configuration Tables from the PCIM selected by IMNUM into the Host memory BUSCONFIG parameter BUSCONFIG parm 224 in length 7 entries per device The format of BUSCONFIG is BUSCONFIG 0 Model Model Number of device BUSCONFIG 1 OutputDisable Output disable flag BUSCONFIG 2 Present Device Present flag BUSCONFIG 3 Reference Status Table or Reference Address BUSCONFIG 4 InputLength Control Input Data Length BUSCONFIG 5 OutputLength Control Output Data Length
154. vice requested is currently not on the bus and data is NOT transferred Coding Example Get the inputs from device 8 on PCIM 1 include lt pcim h gt int status unsigned char Devdata expected data length Length status GetDevin 1 8 amp Length Devdata GFK 0881 Chapter 4 C Programming for the PCIM 4 33 PutDevOut Write Device Data Only Code Summary include lt pcim h gt int PutDevOut IMnum Devicenum DataLngth Devdata unsigned int IMnum Device unsigned char DataLngth Devdata Description The PutDevOut call allows you to write all of the control data outputs to a single serial bus device from the Host memory Devdata parameter IMnum is the PCIM number configured during initialization The Devicenum parameter specifies the serial bus address of the device to which output data is to be written The DataLngth parameter is the number of data bytes to write If the value differs from the PCIMs current data base an Overflow or Underflow error will be returned The Devdata parameter is a character pointer to a buffer where the data to be written is located The size of this buffer is determined by the OutputLength parameter located in the device s configuration data Parameters are summarized as follows Parameter Values Function IMnum 1 64 Relative number of PCIM Devicenum 0 31 Specifies device to which output word will be written Datalngth 0 128 Character size of data buffer in bytes Devdat
155. will be copied from Host memory to specified PCIM Single Slot PCIM User s Manual January 1994 GFK 0881 Return Value Status PutBusOut will return SUCCESS if any of the devices specified by the IMnum are active and data was transferred If no devices are present on the target IM if the target PCIM iscurrently offline has not been initialized or is out of range the following FAIL indications will be returned BADIMNUM Mnum is out of range a count of 64 or greater NOINIT Indicated PCIM has not been initialized InitlM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE Data was transferred to the Output Tables however no devices were found on the bus Coding Example Write all outputs to all active devices on PCIM 1 include lt pcim h gt int status unsigned char lOdata 4096 lOdata 128 1 IOdata 256 2 IOdata 384 4 lOdata 512 8 lOdata 640 0x10h status PutBusOut 1 lOdata GFK 0881 Chapter 4 C Programming for the PCIM 4 31 GetDevin Read Device Data Only Code Summary include lt pcim h gt int GetDevin IMnum Devicenum DataLngth Devdata unsigned int IMnum Device unsigned char DataLngth Devdata Description The GetDevIn function allows you to read the control data inputs received from a single serial bus device into the Host memory Devdata parameter IMnum is the PCIM number configured during initialization The Devicen
156. wing FAIL indications will be returned BADIMNUM IMnum is out of range a count of 64 or greater BADSBA Specified Devicenum is not in the range for Genius bus devices 0 31 decimal or is that of the PCIM NOINIT Indicated PCIM has not been initialized InitIM IMFAIL The indicated PCIM has failed PCIM OK 0 OFFLINE The device requested is currently not on the bus and data is NOT transferred OVERFLOW The Offset specified is greater than the devices OutputLength in circuits UNDERFLOW The Offset is specified as zero 0 Coding Example Set the second word of device 8 on PCIM 1 to 10 hex include lt pcim h gt int status status PutWord 1 8 2 0x10 GFK 0881 Chapter 4 C Programming for the PCIM 4 45 SendMsg Send a Message 4 46 Code Summary include lt pcim h gt int SendMsg IMnum Msg int IMnum SEND MESSAGE Msg Description The Send Message call allows you to write a memory or non memory message from the Host to the selected PCIM for transmission onto the serial bus using the Transmit Datagram command SendMsg will return control to the calling program without delay before the message has been processed or transmitted by the PCIM IMnum defines the PCIM as configured during initialization from which to transmit the message The Msg parameter is a pointer to the buffer where the transmit message is stored The format of SEND MESSAGE is Destination 0 31 255 brdcst Desti
157. x Chapter GFK 0881 Introduction This manual provides a description of the GE Genius I O IBM PC Interface Module PCIM It includes procedures for setup programming operation and troubleshooting in conjunction with the Genius I O System This manual also describes the PCIM Software Library software which is supplied with the PCIM The Software Library provides a high level interface between applications software you develop and the PCIM The PCIM Software Library consists of easy to use macro oriented function calls you code appropriately in your C language or Basic language applications routines Suitable Computers The PCIM has been tested successfully in many types of IBM PC XT and AT type computers It is fully compatible with the ISA backplane and provides host system address decoding over the full PC XT or AT memory maps However it has not been possible to test the PCIM with all computers that may be available Therefore proper operation of the PCIM in every type of host computer cannot be assured Using Other Interface Software A number of companies have developed software for the PCIM to be used in place of the PCIM Software Library If you are using such software and have questions or are experiencing problems please contact the software company GE cannot provide customer support for other companies PCIM software products 1 1 Description The Single Slot PC Interface Module PCIM is
158. yISAcompatible 4bytes 16Kbytes 0 to 60 degrees C ambient temperature at board 5 to 95 non condensing 10 000 feet 0 2 inch displacement 5 to 10 Hz 1G 10 to 200 Hz 5G 10 ms duration per MIL STD 810C method 516 2 40 to 125 degrees C ambient temperature at board 5 to 95 non condensing 40 000 feet 0 2 inch displacement 5 to 10 Hz 1G 10 to 200 Hz 5 G 10 ms duration per MIL STD 810C method516 2 1 5 PCIM Software 1 6 The PCIM is supplied with two types of software m Configuration software m Interface software the PCIM Software Library PCIM Configuration Software The configuration software is used to set up the characteristics of one or more PCIMs that will be installed in the computer Setup parameters include the base addresses used by the Single Slot PCIM and its daughterboard s baud rate serial bus address outputs enable and Watchdog Timer enable Configuration data is stored in EPROM memory on the PCIM and is retained if power is removed The configuration software can be run from diskette or the configuration files can be copied to a hard disk PCIM Software Library The PCIM Software Library provides a high level interface between applications software you develop and the PCIM and through the PCIM devices on the Genius serial bus The PCIM Software Library is accessed through a set of subroutine calls The PCIM Software Library is provided in versions compatible with C language and

Download Pdf Manuals

image

Related Search

Related Contents

LVQ-26HLA QSG  ACTi D64A surveillance camera  Sigma EF-610 User's Manual  Baroscope Barógrafo Barografo  Descargar Manual  Manuel d`utilisation TELIS  平成 24 年度独立行政法人都市再生機構東日本賃貸  取扱説明書 キーボード・エキスパンダー PIH-800EK  Parker Hannifin VO40 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file