opto22_fr.txt
1 = Opto22 PCI 2 3 PCI AC5 ADAPTER CARD / HAL DRIVER This page is considered current as 4 of November 2008. 5 6 == The Adapter Card 7 8 This is a card made by Opto22 for adapting the PCI port to solid state 9 relay racks such as their standard or G4 series. It has 2 ports that 10 can control up to 24 points each and has 4 on board LEDs. The ports use 11 50 pin connectors the same as Mesa boards. Any relay racks/breakout 12 boards thats work with Mesa Cards should work with this card with the 13 understanding any encoder counters, PWM, etc., would have to be done in 14 software. The AC5 does not have any 'smart' logic on board, it is just 15 an adapter. 16 17 See the manufacturer's website for more info: 18 19 http://www.opto22.com 20 21 I would like to thank Opto22 for releasing info in their manual, 22 easing the writing of this driver! 23 24 == The Driver 25 26 This driver is for the PCI AC5 card and will not work with the ISA AC5 27 card. The HAL driver is a realtime module. It will support 4 cards as 28 is (more cards are possible with a change in the source code). Load the 29 basic driver like so: 30 31 loadrt opto_ac5 32 33 This will load the driver which will search for max 4 boards. It will 34 set I/O of each board's 2 ports to a default setting. The default 35 configuration is for 12 inputs then 12 outputs. The pin name numbers 36 correspond to the position on the relay rack. For example the pin names 37 for the default I/O setting of port 0 would be: 38 39 opto_ac5.0.port0.in-00 They would be numbered from 00 to 11 40 41 opto_ac5.0.port0.out-12 They would be numbered 12 to 23 port 1 would 42 be the same. 43 44 == PINS 45 46 opto_ac5.[BOARDNUMBER].port[PORTNUMBER].in-[PINNUMBER] OUT bit 47 48 opto_ac5.[BOARDNUMBER].port[PORTNUMBER].in-[PINNUMBER]-not OUT bit 49 50 Connect a HAL bit signal to this pin to read an I/O point from the 51 card. The PINNUMBER represents the position in the relay rack. Eg. 52 PINNUMBER 0 is position 0 in a Opto22 relay rack and would be pin 47 on 53 the 50 pin header connector. The -not pin is inverted so that LOW gives 54 TRUE and HIGH gives FALSE. 55 56 opto_ac5.[BOARDNUMBER].port[PORTNUMBER].out-[PINNUMBER] IN bit 57 58 Connect a HAL bit signal to this pin to write to an I/O point of the 59 card. The PINNUMBER represents the position in the relay rack.Eg. 60 PINNUMBER 23 is position 23 in a Opto22 relay rack and would be pin 1 61 on the 50 pin header connector. 62 63 opto_ac5.[BOARDNUMBER].led[NUMBER] OUT bit 64 65 Turns one of the 4 onboard LEDs on/off. LEDs are numbered 0 to 3. 66 67 BOARDNUMBER can be 0-3 PORTNUMBER can be 0 or 1. Port 0 is closest to 68 the card bracket. 69 70 == PARAMETERS 71 72 opto_ac5.[BOARDNUMBER].port[PORTNUMBER].out-[PINNUMBER]-invert W bit 73 74 When TRUE, invert the meaning of the corresponding -out pin so that 75 TRUE gives LOW and FALSE gives HIGH. 76 77 == FUNCTIONS 78 79 opto_ac5.0.digital-read Add this to a thread to read all the input 80 points. 81 82 opto_ac5.0.digital-write Add this to a thread to write all the output 83 points and LEDs. 84 85 For example the pin names for the default I/O setting of port 0 would 86 be: 87 88 opto_ac5.0.port0.in-00 89 90 They would be numbered from 00 to 11 91 92 opto_ac5.0.port0.out-12 93 94 They would be numbered 12 to 23 port 1 would be the same. 95 96 == Configuring I/O Ports 97 98 To change the default setting load the driver something like so: 99 100 loadrt opto_ac5 portconfig0=0xffff portconfig1=0xff0000 101 102 Of course changing the numbers to match the I/O you would like. Each 103 port can be set up different. 104 105 Here's how to figure out the number: The configuration number 106 represents a 32 bit long code to tell the card which I/O points are 107 output vrs input. The lower 24 bits are the I/O points of one port. The 108 2 highest bits are for 2 of the on board LEDs. A one in any bit 109 position makes the I/O point an output. The two highest bits must be 110 output for the LEDs to work. The driver will automatically set the two 111 highest bits for you, we won't talk about them. 112 113 The easiest way to do this is to fire up the calculator under 114 APPLICATIONS/ACCESSORIES. Set it to scientific (click view). Set it 115 BINARY (radio button Bin). Press 1 for every output you want and/or 116 zero for every input. Remember that HAL pin 00 corresponds to the 117 rightmost bit. 24 numbers represent the 24 I/O points of one port. So 118 for the default setting (12 inputs then 12 outputs) you would push 1 119 twelve times (thats the outputs) then 0 twelve times (thats the 120 inputs). Notice the first I/O point is the lowest (rightmost) bit. 121 (that bit corresponds to HAL pin 00 .looks backwards) You should have 122 24 digits on the screen. Now push the Hex radio button. The displayed 123 number (fff000) is the configport number ( put a '0x' in front of it 124 designating it as a HEX number). 125 126 Another example: To set the port for 8 outputs and 16 inputs (the 127 same as a Mesa card). Here is the 24 bits represented in a BINARY 128 number. Bit 1 is the rightmost number. 129 130 000000000000000011111111 131 132 16 zeros for the 16 inputs and 8 ones for the 8 outputs 133 134 Which converts to FF on the calculator so 0xff is the number to use 135 for portconfig0 and/or portconfig1 when loading the driver. 136 137 == Pin Numbering 138 139 HAL pin 00 corresponds to bit 1 (the rightmost) which represents 140 position 0 on an Opto22 relay rack. HAL pin 01 corresponds to bit 2 141 (one spot to the left of the rightmost) which represents position 1 on 142 an Opto22 relay rack. HAL pin 23 corresponds to bit 24 (the 143 leftmost) which represents position 23 on an Opto22 relay rack. 144 145 HAL pin 00 connects to pin 47 on the 50 pin connector of each port. 146 HAL pin 01 connects to pin 45 on the 50 pin connector of each port. 147 HAL pin 23 connects to pin 1 on the 50 pin connector of each port. 148 149 Note that Opto22 and Mesa use opposite numbering systems: Opto22 150 position 23 = connector pin 1, and the position goes down as the 151 connector pin number goes up. Mesa Hostmot2 position 1 = connector pin 152 1, and the position number goes up as the connector pin number goes up. 153 154