Home
6008-6.5.11, VMEbus Remote I/O Scanner, User Manual
Contents
1. Figure 4 1 Components of a remote I O system A VME system with an SV1R or SV2R scanner e SES CERE Ie only one remote I O channel is shown being used a Each scanner channel maintains a scan list that b identifies all the racks connected to that channel d E c3 l c3 Remote I O link cable Belden 9463 LH tO LU Remote I O node adapters like the 1771 ASB modules 2 or PanelView operator interfaces addressed as remote I O racks T 2 LEO tH IO i 98 PLC 5 channel or a processor operating as l a remote I O adapter 0 l E 4 2 Chapter 4 Communicating with Remote I O The scanner keeps a list of all of the devices connected to each channel Figure 4 2 shows an example scan list for one channel Figure 4 2 Example scan list SV2R ChB Scan List ChA Rack Starting Rack ChB Address Group Size Range 1 0 Full 010 017 2 0 1 2 020 023 Rack 1 i 3 0 Full 030 037 Rack 2 Rack3 In this example channel B continually scans the three racks in its scan list The steps for setting up a remote I O system are Step See 1 configure the remote I O
2. Blah oie ola Oen 240 VME system with scanner a c scanner using only 1 channel j r3 In D E I el lS adapter 1 scan list E adapter 1 adapter 2 remote I O channel B zs 0 adapter 1 6008 SV2R only adapter 3 0 adapter 2 H Q adapter 3 Ci 5 example scan list scan adapter 3 adapter 1 adapter 2 adapter 1 adapter 3 ifthe VME master processor sent a command execute the command and then return to processing the scan list eon at eee ig if there is no command continue processing the scan list scan adapter 1 D scan adapter 1 adapter scan scanning the i adapters in the scan list Q scan adapter 2 scanner OOS ejeje RB H output data EEH J oca z DpsessebpHIesESE status and input data 1 7 Chapter 1 Scanner Overview Comparison to 6008 SV Scanner Getting the Scanner s Attention For a VME master processor to get the scanner s attention it must write a value any value to any byte in the scanner s identification area This area is located in the last 64 bytes of the global RAM for each scanner channel The scanner gets the attention of a VME master processor by generating a VMEbus
3. UalL l J Input S ESI Output Terminals S S Terminals Gi Q p RIR g Input och Jer Output a S Terminals Terminals 03 S S 03 JS uS 04 SI GS 04 00 S Sj 00 05 Q S 05 01 WII HS 01 06 S S 06 02 asus 02 Y S y 03 J E 03 14 SU 11 s xm 8 b J c J 05 mE c o e 4 BS i1 07 JS 07 18 S S 16 9 9 17 Si 17 HH dE b UE dm Group 4 Group 5 Group 6 Group 7 34 An 8 point input module in group 4 occupies the first 8 bits of input word 4 The 8 point output module occupies the first 8 output bits in output word 5 See 16 point I O modules occupy 16 bits an entire word in the image table See LL 1 slot addressing 1 1 0 chassis slot 1 I O group 1 input image word and 1 output image word 16 input bits and 16 output bits scanner memory Rack x Word NO c fF OO MPM c Word Output Image Table a a AP AP PP CLLLLILILLLLL LLL LLLLL LLL LLL 17 00 bits Input Image Table T 272 LLLLLLL 2 fff A IIIA V EEEIEE EP SLLLLLLLLLLLL LL 17 00 bits Chapter 3 Addressing I O
4. 17 16 15 14 13 12 11 10 07 06 05 o4fo3 02 ot 00 01 ru ilu OH i L L L i L I L L j L EA 0 zz Input Image Table Y c EZI 00 7 16 15 14 13 12 10 o7 06 o5 04 03 02 ot o0 Input Module 1771 IAD Important The scanner addresses the image table with hexadecimal values The addresses depend on the VME operating mode 2 07 Output Module 1771 OAD Chapter 3 Addressing I O Choosing an For each chassis in your I O system you must define how many I O Addressing Mode chassis slots make up an I O group one word each in the input image table and output image table this choice is the chassis addressing mode Choose from among these available modes 2 slot addressing 2 1 0 chassis slots 1 I O group 1 input image word and 1 output image word 16 input bits and 16 output bits scanner memory Rack x EN Output Image Table 16 bits input 16 bits output won 1 slot addressing PPP lg 1 1 0 chassis slot 1 I O group 1 input image word and 1 output image word X 16 input bits a
5. 11 coding sequence 000 indicates no interrupt Your code for the CONTINUOUS BT WRITE command should include these tasks 1 get the semaphore 2 set up the control status area 3 send the command interrupt 4 wait for the result either poll for confirmation status or wait for an interrupt 5 clear the semaphore 6 43 Chapter 6 Operating in SV Superset Mode RESET 6 44 description RESET causes the scanner to reset itself The VME master processor can channel A continuous block transfer read table issue RESET any time When the scanner stops running due to another VME module asserting SYSFAIL you can use RESET to reset the scanner which causes the scanner to re initialize itself RESET looks for the appropriate values in the 2 words right before the VME status ID area If the values are there the scanner resets itself performs its power on self test and enters the SLEEP state The application program has to wake up the scanner and then send a SETUP command to configure the scanner see chapter 8 for an example This applies to either channel During the RESET the scanner stops scanning the remote I O and all three LEDs on the scanner light RESET is different than a power cycle to the scanner in that with RESET the scanner doesn t assert SYSFAIL during the self tests and the scanner doesn t clear the I O image tables The scanner leaves the I O image tables in their last
6. clear the semaphore amp unmap channel res csa gt cnfstat unlock_gda chan unmap channel chan return int res Communicating with PLC 5 A common VME control system using a scanner has the scanner Processor in Adapter Mode communicating with a PLC 5 processor set for adapter mode In this system the scanner communicates with the PLC 5 processor over a remote I O link and the PLC 5 processor emulates a 1771 ASB module The PLC 5 processor in adapter mode has only local I O The rack number of the adapter mode processor determines the addresses you use Direct Transfer You specify configuration files output source file and input destination file in the adapter mode processor If you want the scanner to control outputs of the adapter mode processor write ladder logic in the adapter mode processor to move the data from its input destination file to its output image table Use XIC and OTE instructions for bit data use move and copy instructions for word data If you want the scanner to read data from a data file in the adapter mode processor write logic in the adapter mode processor to move that data to its output source file for transfer to the scanner s input image table The adapter mode processor transfers 2 4 6 8 words depending on whether it is configured as a 1 4 1 2 3 4 or full rack For example if the adapter mode processor is configured as a full rack scanner and adapter mode processor exch
7. print data buffer for i 0 i lt ptr gt datalen i fprintf stdout Ntbuffer d SXH n i ptr data i return 8 27 Chapter 8 Programming the Scanner k k BLOCKCPY copy far source buffer to far destination buffer in byte mode AE This routine replaces _fmemcpy which unfortunately uses 16 bit or 32 bit transfers ok fmemcpy is great for general purposes but unfortunately byte strings get shredded A when copied to the E page bus window k k SE parameters far pointer to destination buffer uid far pointer to source buffer FA number of bytes to copy KE return value none void blockcpy void far dst void far src size_t len char far dstptr char far dst char far srcptr char far src size t i for i 0 i lt len i dstptr i srcptr i return 8 28 Chapter 8 Programming the Scanner 6008sv2 h k k 6008SV2 H defines for 6008 SV2 Sample Code k k xf booleans define FALSE 0 define TRUE 1 6008 SV2 Operating Modes define MODE_COMPATIBLE 0 SV compatible mode define MODE SUPERSET 1 SV superset mode define MODE_ADAPTER 2 SV adapter mode VMEBUS Address Modes define ADRSPC A16 0 A16 non privileged define ADRSPC A16S 1 A16 supervisory define ADRSPC A24D 2 A24 non privileged data define ADRSPC_A24SD 3
8. 8 22 unsigned short far vid map channel amp establish pointers map channel chan vid unsigned short far chan VmeIdArea touch the scanner s channel location monitor vid unsigned short 0x0000 unmap the channel unmap channel chan return Chapter 8 Programming the Scanner ck k k a EAD CSA read control status area AX This function reads a 6008 SV2 channel s control status area and returns the data d to the caller ER parameters pointer to a csa_data struct d return value none kx 0 void read csa channel far chan csa data far param csa data far csaptr map channel amp establish pointers map channel chan csaptr csa data far chan ControlStatusArea copy VME csarea to local structure param opstat csaptr gt opstat param cnfstat csaptr gt cnfstat param cmd csaptr gt cmd param addr csaptr gt addr param tag csaptr gt tag param irq csaptr irg param semaphor csaptr semaphore param datalen csaptr datalen unmap the channel unmap channel chan return 8 23 Chapter 8 Programming the Scanner kx LOCK_GDA lock a channel s general data area kx kx kx kx kx xf int This function locks a channel s general data area semaphore parameters pointer to channel struct return va
9. Successful Any other value indicates an error 105 104 not used command 21H is both sent and returned 106 not used channel A control status 11B 11D 11C not used semaphore Bit 7 semaphore ME not used Aur m n number of entries in the scan list eng READ ONLY 120 4 16 bits per starting group 4 words per adapter adapter status words see Figure 5 3 and Figure 5 4 32 words READ ONLY channel A general data 15F 160 4 1 byte per adapter in the scan list scan list see Figure 5 5 as many as 64 bytes READ ONLY 17F 180 not used FBF 5 21 Chapter 5 Operating in SV Compatible Mode parameters The VME master processor writes 21 hex to the command byte There are no input parameters from the VME master processor The scanner writes these parameters to the selected channel s general data area Byte Offset Parameter Description 11F scan list length The scan list length indicates the number of entries in the scan READ ONLY list The scan list length is an 8 bit quantity that the scanner writes to the length of data byte in the control status area You can enter a scan list length of 0 120 I O adapter status word block This word block contains four 16 bit entries 4 words for each READ ONLY adapter 16 bits for each starting group per adapter maximum of 8 groups of entries See Figure 5 10 and Figure 5 11 160 scan list This list is a maximum of 64
10. Table 2 D Terminating the remote I O link the maximum number of use this resistor physical devices that you racks that you can If your remote I O link rating can connect on the link is scan on the link is operates at 230 4 K bit s operates at 57 6 or 115 2 K bit s and no devices listed below are linked Scanners 1771 SN 1772 SD SD2 1775 SR S4A S4B 82Q 32 16 6008 SQH1 SQH2 Adapters 1771 AS 1771 ASB series A only 1771 DCM Miscellaneous 1771 AF connects to any device listed below Scanners 1771 SN 1772 SD SD2 1775 SR S4A S4B 6008 SQH1 SQH2 1502 16 16 Adapters 1771 AS 1771 ASB series A only 1771 DCM Miscellaneous 1771 AF operates at 57 6 or 115 2 K bit s and you do not require over 16 physical devices You can connect a remote I O link in one of two ways trunkline dropline from the drop line to the connector screw terminals on the remote I O connectors of the scanner daisy chain to the connector screw terminals on the remote I O connectors of the scanner and then to the remote I O connector screw terminals of the next remote I O device Important The cable connections for the 6008 SV1R and 6008 SV2R scanner are opposite from those for the earlier 6008 SV scanner Make sure you follow the instructions in Figure 2 1 below 2 9 Chapter 2 Installing the Scanner Figure 2 1 Make remote I O connections To connect the remote I O cable do the following
11. int scanlist channel far chan scanlist_data far scancfg csa_data far csa unsigned short res map channel amp establish pointers map channel chan csa csa data far chan ControlStatusArea get the semaphore if lock gda chan 0 unmap channel chan fprintf stdout scanlist lock aquire FAILED n return 1 set up the control status area csa cnfstat 0x000F confirm status word csa gt cmd CMD_SCANLIST command word csa datalen scancfg scanlist len length of data word copy the scan list to the general data area blockcpy chan GeneralDataArea scancfg scanlist size t scancfg scanlist len send the command interrupt assert cmd chan poll for command result if wait for cmdcmpl chan FALS clear the semaphore unlock gda chan unmap channel chan fprintf stdout scanlist wait failure lock cleared in return 2 Ga clear the semaphore amp unmap the channel res csa gt cnfstat unlock_gda chan unmap_channel chan return int res 8 7 Chapter 8 Programming the Scanner FAULT DEPENDENT GROUP command k k FAULTGROUP configure 6008 SV2 channel fault dependent groups k Ee This function executes a FAULT GROUP command using the fault group block provided Ax by the caller in the fdg_data paramete
12. 32 point examples 1 slot addressing 32 point input module p 1 1 0 chassis slot 1 I O group 1 input image word and 1 output 1 image word 16 input bits and 16 output bits scanner memory zi S Rack x RS Word Output Image Table S 32 point I O modules use the entire word 0 T S of their group and borrow the entire word 1 V A IL P P PL S S of the next group See 2 S Since the module is in group 0 and the 3 OS inputs for group 0 and group 1 are used 4 S S you must 5 S install an output module in group 1 or 6 AS leave the slot empty 7 pU 17 00 bits Input Image Table Group 0 Word 7 of KKH amp LLLA 0i y point i 3 32 point input module et e 32 point output module 4 5 6 SE ge Q 17 00 bits S Ky CX So Vall S QS SS Since the input image table for group 1 is unavai
13. Lu clear the semaphore amp unmap the channel res csa gt cnfstat unlock_gda chan unmap channel chan return int res 8 9 Chapter 8 Programming the Scanner SET MODE command k k SETMODE configure 6008 SV2 channel operating mode Ee This function executes a SET MODE command using the mode passed by the caller in AK the mode parameter k k KE parameters pointer to channel structure KK mode parameter 1 PROGRAM 2 TEST 4 RUN KE return values 1 unable to lock general data area semaphore EK 2 did not get cmd complete interrupt ae ELSE channel confirmation status word Jeke int setmode channel far chan int mode csa_data far csa unsigned short res map channel amp establish pointers map channel chan csa csa data far chan ControlStatusArea get the semaphore if lock gda chan 0 unmap channel chan fprintf stdout set mode lock aquire FAILED n return 1 set up the control status area csa cnfstat 0x000F confirmation status word csa cmd CMD SETMODE command word csa datalen 0x0001 length of data word put mode parameter in general data area chan gt GeneralDataArea unsigned char mode send the command interrupt assert cmd chan poll for command result
14. return After Waking Up the After you wake up the scanner the scanner write 0x10 to the command Scanner status byte Now the scanner is ready to accept commands For example send these commands SETUP to configure the scanner AUTOCONFIGURE or to create a scan list SCAN LIST SET MODE to put the scanner in run mode If the VME master processor interrupts the scanner after waking the scanner up but without having a command ready to send to the scanner the scanner ends up resetting itself This is because there is no command for the scanner to execute so the scanner s watchdog timer which defaults at 500msec runs out The programming examples in chapter 8 show how to use the scanner management commands Each command description ends with a recommended procedure for using the command to avoid interrupting the scanner without having commands ready for the scanner to execute T 8 Using This Chapter Using the Semaphore Programming the Scanner This chapter provides programming examples that illustrate the scanner management commands If you want to read about go to page using the semaphore 8 1 knowing when a command is complete 8 2 programming examples of each scanner 8 2 management command programming block transfers 8 34 communicating with PLC 5 processor in 8 39 adapter mode Important The programming examples in this publication are examples only They will need modification befo
15. 1 2 10 Run the cable 1770 CD from the processor to each remote I O adapter in the remote I O system Connect the signal conductor with blue insulation to the 3 pin connector terminal labeled 1 on the scanner and to each remote I O adapter in the remote I O system Connect the signal conductor with clear insulation to the 3 pin connector terminal labeled 2 Connect the shield drain wire to the middle 3 pin terminal it is not labeled Tie wrap the remote I O network cable to the chassis to relieve strain on the cable Terminate the remote I O link by connecting an external terminator resistor between the remote I O terminals labeled 1 and 2 O gt esses Jaa a ico Important Last device on the remote 1 O link Terminate both ends of a remote I O link Blue s Shield rz Clear To another remote I O device mum emm m dE i E 82 Q or Ae eae 150 Q 1770 CD resistor Belden 9463 q lt Addressing I O Using This Chapter This chapter provides an overview of I O addressing This chapter also explains the basics of how the scanner processes discrete I O and block transfer data If you want to read about go to page I O addressing concept 3 1 choosing an addressing mode 3 3 addressing block transfe
16. Values greater than 64 are reserved If you write a reserved value to this field the scanner writes an illegal confirmation error 16H in the confirmation status byte 0220 BT data The BT data is the set of data words 0 64 sent to the target I O module The BT data block ends at offset length of data 1 Figure 6 14 Format for the address byte 0 terminals 00 07 1 terminals 10 17 6 34 Chapter 6 Operating in SV Superset Mode coding sequence Your code for the BT WRITE command should include these tasks R t get the semaphore set up the control status area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt clear the semaphore Chapter 6 Operating in SV Superset Mode CONTINUOUS BT READ command byte 06 description CONTINUOUS BT READ transfers a block of data from the specified adapter to the scanner s general data area at regular intervals When one block transfer read completes the scanner queues another one The cycle continues until you disable the continuous block transfer The scanner must be in Program mode to execute this command If the scanner isn t in Program mode the scanner returns error code 13H Program mode required to the confirmation status byte Once the command is running you can halt a continuous block transfer by switching the scanner to Program mode channel A c
17. command summary 6 7 CONTINUOUS BT READ 6 36 CONTINUOUS BT WRITE 6 40 FAULT DEPENDENT GROUP 6 18 global RAM descriptions 6 4 LINK STATUS 6 23 operating mode 6 1 operating status word 6 5 RESET 6 44 SCAN LIST 6 15 SET MODE 6 21 SETUP 6 8 SYSFAIL 1 5 7 4 SYSFAIL state 7 2 SYSRESET 1 5 semaphore 8 1 SET MODE T programming example 8 10 SV compatible 5 19 terminating remote I O link 2 9 Sisuperse 6 21 Terms pii setting switches 2 1 test mode 1 10 ae TEST state 7 2 programming example 8 3 SV compatible 5 7 timeout block transfer 4 14 SV superset 6 8 timer watchdog _1 11 signals scanner response 1 5 troubleshooting SLEEP state 7 2 error codes 9 2 ificati M4 indicators 9 1 specications A 1 scanner states 7 3 starting the scanner 5 6 6 7 7 1 7 4 suggestions 9 4 states scanner 7 1 suggestions for troubleshooting 9 4 U SV compatible x addressing global RAM _5 1 utility routines 8 22 AUTOCONFIGURE 5 9 BT READ 5 25 BT WRITE 5 27 Index V VME backplane jumpers 2 6 VME master processor watchdog timer 141 VME signals 1 5 VMEbus interrupt 1 5 operations 8 18 relationship 1 4 specifications A 2 W waking up the scanner 5 6 6 7 7 5 7 8 watchdog timer 1 11 OY Rockwell Automation Allen Bradley a Rockwell Automation Business has been helping its customers improve sae dic d productivity and quality for 90 years We design
18. 1E00 1FBB not used Rack 15 Input Group 6 A Rack 15 Input Group 7 T Reset Words 1FBC 1FBF operating status A Y confirmation command contains 1 ASCII character word scanner interrupt and not used V M E L D A B 6 0 0 8 S V2 R A A iFCO 1FFF VME ID area address or 32 words BT tag V M E LD A B 6 0 0 8 S V 1 R A A Y BT interrupt 200 21F Input Image Table Monitor control status Index Word 16 words 20E 21B not used WT semaphore Loser length of data Y continued Table 6 A describes the components of global RAM 6 3 Chapter 6 Operating in SV Superset Mode 6 4 This area Table 6 A Descriptions of the global memory areas stores the input and output image table input and output data for as many as 16 logical I O racks with no more than 32 adapters control status area operating status byte reflects the current status of the scanner lets the VME master processor poll the scanner s status without interrupting ongoing operations see Figure 6 2 on page 6 5 confirmation status byte contains the result of the executed command A result of 00 hex indicates the command completed successfully See chapter 9 for a list of error codes command byte identifies the command the VME master processor wants the scanner to execute next address byte contains I O rack group and slot parameters for block transfer commands For more information see BT READ command on page 6
19. Figure 6 15 Format for the continuous block transfer address byte 0 terminals 00 07 1 terminals 10 17 Figure 6 16 Format for the continuous block transfer interrupt level and status ID 15 14 13 11 coding sequence 000 indicates no interrupt Your code for the CONTINUOUS BT READ command should include these tasks 1 get the semaphore 2 set up the control status area 3 send the command interrupt 4 wait for the result either poll for confirmation status or wait for an interrupt 5 clear the semaphore 6 39 Chapter 6 Operating in SV Superset Mode CONTINUOUS BT WRITE command byte 07 description CONTINUOUS BT WRITE transfers a block of data from the scanner to the specified I O module at regular intervals When one block transfer write completes the scanner queues another one The cycle continues until you disable the continuous block transfer The scanner must be in Program mode to execute this command If the scanner isn t in Program mode the scanner returns error code 13 Program mode required to the confirmation status byte Once this command is running you can halt a continuous block transfer by switching the scanner to Program mode Chapter 6 Operating in SV Superset Mode aah Name a 00H transfer was succe
20. general data area at offset 220H chan gt GeneralDataArea char far amp base SVS GDA OFFSET continuous block transfer write table at offset 300H chan gt ConBTWTable char far amp base SVS CONBTW OFFSET continuous block transfer read table at offset COOH chan gt ConBTRTable char far amp base SVS CONBTR OFFSET reset area at offset 1FBCH chan gt ResetArea char far amp base SVS RESET OFFSET vme ID area at offset 1FCO chan VmeIdArea char far amp base SVS VIA OFFSET return k k UNMAP CHANNEL unmap a channel s VME shared memory k k ee This function accepts a channel structure as input and restores the EPC s VMEbus KE window to the state it had when the channel was last mapped k k KE parameters pointer to channel structure FE return value none Feke 4 void unmap channel channel far chan EpcRestState amp chan stash return 8 20 Chapter 8 Programming the Scanner k k WAIT_FOR_IRQ wait for scanner interrupt KE This function waits for an interrupt from the 6008 SV2 k k ee parameters timeout timeout interval in milliseconds ok return value FALSE interrupt not received or error ax TRUE interrupt received k k 0 int wait for cmdcmpl channel far chan short res unsigned long status unsigned short masks 8 0x0000 0x0002 0x0004 0x0008 0x0010
21. global RAM SV compatible descriptions 5 4 SV compatible structure 5 1 SV superset descriptions 6 4 SV superset structure 6 1 grounding the chassis 2 6 Index H handling the scanner 2 1 Hardware Required _p i I O addressing assigning racks 3 7 block transfer modules 3 6 choosing mode 3 3 concept 3 1 summary 3 6 indicators 9 1 inserting the scanner 2 7 installing connecting remote I O link 2 8 grounding the chassis 2 6 inserting the scanner 2 7 power supply requirements 2 7 scanner 2 1 setting switches 2 1 VME backplane jumpers 2 6 interrupts 1 5 1 8 introduction 1 1 K knowing when a command completes 8 2 L LINK STATUS programming example 8 11 SV compatible 5 21 SV superset 6 23 number of devices supported 2 8 O operating mode overview 1 9 SV compatible 5 1 SV superset 6 1 operating status word 5 5 6 5 overview 1 1 P performance specifications _A 1 POST state 7 2 power supply requirements 2 7 powering up the scanner 7 4 processing block transfer data 4 8 discrete I O 4 6 program mode 1 10 PROGRAM state 7 2 programming examples block transfers 8 34 PLC 5 adapter mode 8 39 sample command sequence 7 8 scanner management commands 8 2 starting the scanner 7 4 utility routines _8 22 VMEbus operations 8 18 waking up the scanner 7 5 R remote I O link cable lengths 2 8 4 4 communicating with _4 1
22. ioaswblk size unsigned short chan gt ScannerMode MODE COMPATIBLE SVC IOASWBLK SIZ SVS IOASWBLK SIZE 14 get the semaphore if lock gda chan 0 unmap channel chan fprintf stdout linkstat lock aquire FAILED n return 1 set up the control status area csa cnfstat 0x000F confirmation status word csa cmd CMD LINKSTAT command word csa datalen 0 length of data word send the command interrupt assert cmd chan 8 11 Chapter 8 Programming the Scanner 8 12 poll for command result if wait for cmdcmpl chan FALS clear the semaphore unlock gda chan unmap channel chan fprintf stdout fdg wait failure lock clearedn return 2 Gl check autoconfigure result res csa gt cnfstat if res 0 link status failed unlock_gda chan unmap_channel chan return int res place scan list size in autocfg structure linkcfg gt scanlist_len csa datalen copy I O adapter status word block to autocfg structure for i 0 i lt ioaswblk size i linkcfg gt ioaswblk i gda il copy the scan list to the autocfg structure scanlist unsigned char far amp gda ioaswblk_size blockcpy linkcfg gt scanlist scanlist size t csa datalen clear the semaphore amp unmap channel unlock_gda chan
23. scanning the racks in the scan list blinking green is on line in Run mode and scanning only some of the racks in the scan list red has an unrecoverable fault blinking red has a recoverable fault 1 3 Chapter 1 Scanner Overview VMEbus Relationship The scanner complies with the VMEbus specification revision C 1 and responds to VME masters on the VMEbus The scanner appears as an area of global VME RAM to other master processors on the VMEbus This area contains the I O image area control status area general data area and interrupt ID area memory map for one channel SV compatible mode SV superset mode output image table 64 words input image table 64 words output image table 128 words control status area 16 words input image table 128 words general data area 1872 words control status area 16 words interrupt VME ID area 32 words general data area 112 words continuous BT write 16 entries 72 words each continuous BT read 32 entries 72 words each interrupt VME ID area 32 words For more details on these memory areas see chapter 5 or 6 for SV compatible mode or SV superset mode respectively There is no direct communication between a VME master processor and the discrete I O rather the VME master processor communicates with the I O image table in the scanner shown above The VME
24. A24 supervisory data 6008 SV2 Scanner Management Commands define CMD AUTOCFG unsigned short 0x0010 autoconfigure define CMD SCANLIST unsigned short 0x0011 scan list define CMD FDGROUP unsigned short 0x0012 fault group define CMD SETUP unsigned short 0x0013 setup define CMD SETMODE unsigned short 0x0020 set mode define CMD LINKSTAT unsigned short 0x0021 link status define CMD OSBTREAD unsigned short 0x0001 one shot BT read define CMD OSBTWRITE unsigned short 0x0002 one shot BT write define CMD CONBTREAD unsigned short 0x0006 continuous BT read define CMD CONBTWRITE unsigned short 0x0007 continuous BT write 6008 SV2 Scanner Operating Modes define MODE PROGRAM unsigned char 0x01 program mode define MODE TEST unsigned char 0x02 test mode define MODE RUN unsigned char 0x04 run mode 6008 SV2 Scanner Channel Offsets Compatible Mode define SVC OTABLE OFFSE 0x0000 output table define SVC ITABLE OFFSE 0x0080 input table define SVC CSA OFFSE 0x0100 control status area define SVC GDA OFFSE 0x0120 general data area define SVC RESET OFFSE
25. Ty Allen Bradley VMEbus Remote I O U Ser Scanner M anu al Cat No 6008 SV1R 6008 SV2R Important User Information Because of the variety of uses for the products described in this publication those responsible for the application and use of this control equipment must satisfy themselves that all necessary steps have been taken to assure that each application and use meets all performance and safety requirements including any applicable laws regulations codes and standards The illustrations charts sample programs and layout examples shown in this guide are intended solely for purposes of example Since there are many variables and requirements associated with any particular installation Allen Bradley does not assume responsibility or liability to include intellectual property liability for actual use based upon the examples shown in this publication Allen Bradley publication SGI 1 1 Safety Guidelines for the Application Installation and Maintenance of Solid State Control available from your local Allen Bradley office describes some important differences between solid state equipment and electromechanical devices that should be taken into consideration when applying products such as those described in this publication Reproduction of the contents of this copyrighted publication in whole or in part without written permission of Allen Bradley Company Inc is prohibited Throughout this manu
26. include busmgr h k k INIT BUS OPS initialize VMEbus access k k EA This function checks for the EPC Bus Manager driver then enables interrupts Ax on IRQ4 the VMEbus interrupt used by the 6008SV2 as a default kx a4 void init bus ops void int ds check for bus manager if EpcCkBm EPC SUCCESS fprintf stderr Bus Manager not loaded in exit 1 for i 1 i lt 8 i EpcEnIntr unsigned short i return 8 18 Chapter 8 Programming the Scanner k k MAP CHANNEL map a 6008SV2 channel k k KE This function accepts a channel structure as input and maps the E page VM EE to the specified channel The function then initializes the channel struc ex pointers to the various objects in the channel window e g discrete I O Ak control status area and so forth k k xe parameters pointer to channel structure KK return value none x void map channel channel far chan char far base save current bus state EpcSaveState amp chan gt stash get pointer to base of scanner memory if EpcSetAmMap chan AddressMode chan ScannerAddress void far far amp base EPC SUCCESS fprintf stderr cannot map target scanner memoryNn exit 1 establish pointers to scanner objects x if chan gt ScannerMode MODE COMPATIBLE ou
27. semaphore 021E not used SE un T number of entries in the scan list eng READ ONLY 0220 16 bits per starting group 4 words per adapter adapter status words see Figure 6 3 and Figure 6 4 64 words READ ONLY channel A general data 029F UP scan list lt 1 byte per adapter as many as 32 bytes see Figure 6 5 _02BF READ ONLY 02C0 not used 02FF 6 11 Chapter 6 Operating in SV Superset Mode parameters The VME master processor writes 10 hex to the command byte There are no input parameters from the VME master processor The scanner writes these parameters to the selected channel s general data area Byte Parameter Description offset 021F scan list length The scan list length indicates the number of entries in the scan READ ONLY list The scan list length is an 8 bit quantity that the scanner writes to the length of data byte in the control status area You can enter a scan list length of 0 0220 I O adapter status word block This word block contains four 16 bit entries 4 words for each READ ONLY adapter 16 bits for each starting group per adapter maximum of 16 groups of entries See Figure 6 3 and Figure 6 4 02A0 scan list This list is a maximum of 32 bytes long 1 byte per adapter READ ONLY The list contains one byte sized entry for each adapter found on the I O link See Figure 6 5 on page 6 14 Figure 6 3 Format of the I O adapter status word block and sca
28. 0x0020 0x0040 0x0080 enable specified VMEbus interrupt EpcEnIntr chan CmdCmplIrq wake up on the specified VMEbus interrupt res EpcWaitIntr masks chan gt CmdCmplirg amp status chan TimeOut check result for timeout or error if res 0 res ERR FAIL printf wait no interrupt received timeout n return FALSE check result for correct level if res amp masks chan CmdCmplIrq masks chan CmdCmplIrq printf wait incorrect interrupt level received Wn return FALSE check status for correct vector if status amp 0x000000FF chan gt CmdCmplVec printf wait incorrect interrupt vector received n return FALSE return TRUE 8 21 Chapter 8 Programming the Scanner kx sample code for utility routines UTTLS C sample code utility routines kx include 6008sv2 h include bus h include utils h k k ASSERT CMD touch scanner channel location monitor xx kx k k kk K kx kx x void This function does a word write to the base of a 6008 SV2 channel VME ID Scanner interrupt area This triggers a local interrupt on the 6008 SV2 alerting it that a command has been placed in the channel s control status area for processing parameters pointer to channel structure return value none assert cmd channel far chan
29. Chapter 5 Operating in SV Compatible Mode parameters The VME master processor writes 13 hex to the command byte Then the VME master processor writes these parameters to the first 7 bytes of the selected channel s general data area Byte Parameter Description Byte Parameter Description offset offset 120 1 O link Write one of these values hex 124 command The VME master processor writes an 8 bit value baud rate complete here that the scanner will pass to the VME interrupt 01 57 6 kbps default 02 1152 s interrupt handler during the VMEbus interrupt cycle The FF no change status ID default value is 40H Values 00 03 FE are reserved If you write a reserved value to this field the scanner writes error 11H in the confirmation status byte 121 master Write one of these values hex 125 command Write one of these values hex Va 00 500 ms default idus 00 generate VMEbus interrupt Mii e ite OA FE valuex100 ms 1000 25400ms n in upon command completion default med FF no change nane 01 do not generate VMEbus interrupt Values 01 09 are reserved If you write a reserved FF a a eai completion value to this field the scanner writes error 11H in no cnange the confirmation status byte Values 02 FE are reserved If you write a reserved value to this field the scanner writes error 11H in the confirmation status byte 122 master Write one of these values hex 126 SYSFAIL Write one of these values hex MM 01 disable
30. Product Catalog Number classic PLC 5 processors 1785 LT 1785 LT2 1785 LT3 enhanced PLC 5 processors 1785 L11B 1785 L20B 1785 L30B 1785 L40B 1785 L60B 1785 L80B PLC processors ethernet PLC 5 processors 1785 L20E in adapter mode 1785 L40E 1785 L80E local PLC 5 processors 1785 L40L 1785 L60L VME PLC 5 processors 1785 V30B 1785 V40B 1785 V40L Direct Communication Module for SLC Processors 1747 DCM SLC 500 Remote I O Adapter Module 1747 ASB 1791 Block I O 1791 series FLEX I O 1794 series to remote I O Remote I O Adapter Module 1771 ASB 1 slot I O Chassis with Integral Power Supply and Adapter 1771 AM1 2 slot I O Chassis with Integral Power Supply and Adapter 1771 AM2 Direct Communication Module 1771 DCM DL40 Dataliner 2706 series operator RediPANEL 2705 series interfaces PanelView Terminal 2711 series drives Remote I O Adapter for 1336 AC Industrial Drives 1336 RIO Remote I O Adapter for 1395 AC Industrial Drives 1395 NA third party any devices incorporating A B node adapter chip sets under the devices ENABLED Technology program 4 1 Chapter 4 Communicating with Remote I O Introduction to Remote I O A remote I O system lets you control Allen Bradley I O that is not within a VME master processor s chassis The SV1R has one remote I O channel the SV2R has two remote I O channels Each channel transfers discrete and block transfer data with remote I O devices These components make up a remote I O system
31. The command DES is then asserted and its results returned to the caller k k ex parameters pointer to channel structure pointer to the bt data structure AX return values 1 unable to lock general data area semaphore KE 2 did not get cmd complete interrupt Kx ELSE channel confirmation status word k k int configure_continuous_bt channel far chan bt_data far block csa_data far csa unsigned short far gda unsigned short res map channel amp establish pointers map channel chan csa csa data far chan ControlStatusArea gda unsigned short far chan GeneralDataArea get the semaphore if lock gda chan 0 unmap channel chan fprintf stdout osbtread lock aquire FAILED n return 1 set up the control status area csa cnfstat 0x000F confirmation status word csa cmd block cmd command word csa gt addr block gt addr address word csa gt tag block gt tag tag word csa irq block gt irq interrupt word csa datalen block datalen length of data word 8 38 Chapter 8 Programming the Scanner send the command interrupt assert cmd chan poll for command result if wait for cmdcmpl chan FALSE clear the semaphore unlock gda chan unmap channel chan fprintf stdout continuous bt wait failure lock cleared n return 2
32. connecting 2 8 design guidelines 4 3 introduction _4 2 scan list 4 5 selecting devices 4 1 terminating 2 9 transferring block data 4 8 transferring direct data 4 6 Required hardware _p i RESET programming example 8 17 SV compatible 5 29 SV superset 6 44 run mode 1 10 RUN state 7 2 S SCAN LIST programming example 8 7 SV compatible 5 13 SV superset 6 15 scanner addressing I O 3 1 assigning racks 3 7 communicating with remote I O 4 1 comparison to 6008 SV 1 8 connecting to remote I O link 2 8 error codes 9 2 front panel 1 3 grounding the chassis 2 6 Index 1 3 command summary _5 6 FAULT DEPENDENT GROUP 5 16 global RAM descriptions 5 4 LINK STATUS 5 21 operating mode 5 1 operating status word 5 5 RESET 5 29 SCAN LIST 5 13 SET MODE 5 19 handling 2 1 SETUP 57 how it scans 1 6 SV superset inserting 2 1 addressing global RAM _6 1 installing 2 1 AUTOCONFIGURE 6 11 interrupt 1 8 BT READ 6 28 number of devices supported _2 8 BT WRITE 6 32 operating mode 1 9 overview 1 1 power supply requirements 2 7 processing block transfer 4 8 processing discrete I O 4 6 programming mode 1 10 response to VME signals 1 5 setting switches 2 1 specifications A 1 specifying scan list 4 5 states 7 1 7 3 system connection 1 2 troubleshooting 9 1 troubleshooting suggestions 9 4 VME backplane jumpers 2 6 VMEbus relationship 1 4
33. modules that respond to read or write block transfers These modules handle data such as analog input analog output positioning and communication data Block transfer instructs the scanner to transfer as many as 64 words of data to from a selected I O module The operating mode of the scanner determines how many block transfer requests the scanner can queue as many as 42 requests when operating in SV compatible mode only 1 request when operating in SV superset mode Figure 4 5 shows how the scanner handles a block transfer Figure 4 5 Block transferring data to remote I O gt Rack3 amp Y E s scanner scanner Er block Rack2 3 transfer 4 3 table Q block transfer request VME ere A lt lt _________ master processor al 4 blocitransfer Q queue Raki amp sent to adapter A active 3 v 4 8 Chapter 4 Communicating with Remote I O The scanner processes block transfers differently depending on the VME operating mode In general though block transfer allows the VME master processor to read or write up to 64 16 bit words from an adapter In SV compatible mode The scanner processes single block transfer operations You must program a read or write command for each data transfer in your application The scanner can queue as many as 42 block transfer requests from the VME master processor In SV superset mo
34. 102 not used confirmation Successful Any other value indicates an error 105 104 not used command 10H is both sent and returned 106 not used channel A control status 11B 11D 11C not used semaphore Bit 7 semaphore ME not used is B n number of entries in the scan list eng READ ONLY 120 4 16 bits per starting group 4 words per adapter adapter status words see Figure 5 3 and Figure 5 4 32 words READ ONLY channel A general data 15F 160 j scan list 1 byte per adapter as many as 16 bytes see Figure 5 5 46F READ ONLY 170 not used FBF 5 9 Chapter 5 Operating in SV Compatible Mode parameters The VME master processor writes 10 hex to the command byte There are no input parameters from the VME master processor The scanner writes these parameters to the selected channel s general data area Byte Parameter Description offset TF scan list length The scan list length indicates the number of entries in the scan READ ONLY list The scan list length is an 8 bit quantity that the scanner writes to the length of data byte in the control status area 120 I O adapter status word block This word block contains four 16 bit entries 4 words for each READ ONLY adapter 16 bits for each starting group per adapter maximum of 8 groups of entries See Figure 5 3 and Figure 5 4 160 scan list This list is a maximum of 16 bytes long 1 byte per adap
35. 2 Chapter 5 Operating in SV Compatible Mode global RAM structure for SV compatible mode Channel A Rack 0 Output Group 0 Rack 0 Output Group 1 Rack 0 Output Group 2 Rack 0 Output Group 3 Rack 0 Output Group 4 Rack 0 Output Group 5 Rack 0 Output Group 6 Rack 0 Output Group 7 Rack 1 Output Group 0 Rack 1 Output Group 1 Rack 7 Output Group 6 Rack 7 Output Group 7 Rack 0 Input Group 0 Rack 0 Input Group 1 Rack 0 Input Group 2 Rack 0 Input Group 3 Rack 0 Input Group 4 Rack 0 Input Group 5 Rack 0 Input Group 6 Rack 0 Input Group 7 Rack 1 Input Group 0 Rack 1 Input Group 1 Rack 7 Input Group 6 Rack 7 Input Group 7 byte offset hex continued byte offset hex N operating status A confirmation not used command address BT tag 100 11F control status 16 words 000 07F 010A 011B not used output image table 64 words semaphore not used length of data General Data Area Y A 120 FBB general data area 1872 words 080 0FF input image table 64 words Reset Words FBC FBF Y contains 1 ASCII character word b scanner interrupt VM ELD A B 60 0 8 9 M2R A A ppg ppp and VME ID area Y or 32 words V M E I D A B 6 0 0 8 S V 1 R A A Y continued Table 5 A describes the components of global RAM 5 3 Chapter
36. 2FH block transfer put in queue OK 0202 not used confirmation any other value indicates an error 0204 not used 0205 command 01H is both sent and returned 0207 0206 not used address address of I O module channel A not used 0209 control status 0208 BT tag 0 1 unique number transfer 020A not used 021D 021D 021C not used semaphore 4 Bit 7 semaphore v F length of 0 64 number of words to read 021E not used data from the I O module 0220 BT read data returned as many as 64 words channel A general data length 1 length not used 02FF 6 29 Chapter 6 Operating in SV Superset Mode parameters The VME master processor writes 01 hex to the command byte Then the VME master processor writes these parameters to the selected channel s control status area Byte Parameter Description offset 0207 module address The module address is the address of the I O module from which to read the block data It contains the rack 0 15 group 0 7 and slot 0 or 1 numbers of the I O module See Figure 6 13 0209 block transfer tag number The block transfer tag number is an 8 bit integer that uniquely identifies each block transfer The scanner writes a value of 0 or 1 to the block transfer request tag number in the control status area Values greater than 1 are reserved If you write a reserved value to this field the scanner writes an illegal confi
37. 6 Operating in SV Superset Mode L Address global RAM L Command summary How will the scanner operate chap 7 chap 8 chap 9 Starting the Scanner Programming the Scanner Troubleshooting J Understand the scanner states J Use the scanner management commands LJ Check indicators L Power up the scanner Program block transfers LI Check scanner states Communicate with PLC 5 adapters Check error codes 1 Other suggestions chap 4 Communicating with Remote I O chap 1 chap 2 chap 3 Scanner Overview Installing the Scanner Addressing I O CL VMEbus relationship Set the switches L Choose the addressing mode Select remote I O devices L How the scanner scans Ground the chassis L1 Address block transfer modules Design the remote I O link L1 Operating modes L Insert the scanner L Assign racks LI Specify the scan list Determine the power requirements L Connect to remote I O chap 5 Operating in SV Compatible Mode 1 Address global RAM LJ Command summary chap 6 Operating in SV Superset Mode L Address global RAM L Command summary How will the scanner operate chap 7 chap 8 chap 9 Starting the Scanner Programming the Scanner Troubleshooting 1 Understand the scanner states L Use the scanner management commands Check indicators L Power up the scanner Program block transfers LI Check scanner states Communicate with PLC 5 adapters C
38. Block Transfer Result unsigned short tag Block Transfer Tag Word unsigned short addr Block Transfer Address Word unsigned short datalen Block Transfer Length Word unsigned short irg Block Transfer Interrupt Word Block Transfer Data Buffer unsigned short data MAX_BT_DATALEN bt_data Block Transfer Table Entry x typedef struct unsigned short tag Block Transfer Tag Word unsigned short addr Block Transfer Address Word unsigned short datalen Block Transfer Length Word unsigned short irg Block Transfer Interrupt Word unsigned short sv2_flag semaphore sv6008 write unsigned short vmp_flag semaphore VME host write unsigned short turn_flag semaphore turn flag unsigned short status status field Block Transfer Data Buffer unsigned short data MAX_BT_DATALEN btentry 8 32 Chapter 8 Programming the Scanner cmds h k k CMDS H function prototypes for cmds c k k void wakeup channel far int setup channel far setup_data far int autocfg channel far link_config far int scanlist channel far scanlist_data far int faultgroup channel far fdg_data far int setmode channel far int int linkstatus channel far link_config far void reset channel far void read_input_word channel far int int unsigned short far void write_output_wo
39. Format item Figure 6 9 Format for one entry in the fault dependent group block reserved Description in fault dependent group bit 3 Write one of these values 1 adapter is in the fault dependent group identified by the fault dependent group number bits 2 0 0 adapter is not in a fault dependent group fault dependent group number The value 0 7 binary identifies the fault dependent group to bits 2 0 which this adapter belongs coding sequence Your code for the FAULT DEPENDENT GROUP command should include these tasks get the semaphore set up the control status area copy the fault dependent group data to the general data area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt 6 clear the semaphore Uo t bea Chapter 6 Operating in SV Superset Mode SET MODE command byte 20 description SET MODE changes the operating mode of the scanner Byte offset Hex Name um 00H returned means the command was 0202 not used confirmation successful Any other value indicates an error 0204 not used 705 command 20H is both sent and returned 0206 not used channel A control status 021B 021D 021C not used semaphore Bit 7 semaphore 021E not used Mode 0220 Ds mode not used 01 Program 02 Test channel A general data 04 Run Ps not u
40. Parameter Description offset TF scan list length The scan list length indicates the number of entries 0 64 in the scan list The scan list length is an 8 bit quantity that the scanner writes to the length of data byte in the control status area You can enter a scan list length of 0 120 scan list This list is a maximum of 64 bytes long 1 byte per adapter but it can contain only 16 distinct physical adapter addresses The list contains one byte sized entry for each adapter you want to place in the list An adapter can appear in the list multiple times See Figure 5 6 and Figure 5 7 5 13 Chapter 5 Operating in SV Compatible Mode Figure 5 6 Example scan list Byte Byte offset offset 120 rack 0 staring group 2 rack 1 starting group 2 121 122 rack 2 staring group 2 rack 3 starting group 0 123 124 rack 4 staring group 0 rack 5 starting group 2 125 126 rack 6 staring group 0 rack 7 starting group 4 127 e e e up to as many as 64 bytes e Figure 5 7 Format for one entry in the scan list 7 6 5 4 83 2 1 0 e o Ds Q Format item Description rack size Write one of these values D 00 1 4 rack 01 1 2 rack 10 3 4 rack 11 full rack These bits function differently than with the AUTOCONFIGURE command With this command you must specify the rack size you want which could be larger than the actual rack size to allow for future expansion The AUTOCONFIGURE
41. READ command byte 01 0 00 cece eee eee 6 28 description 0 eect e eee 6 28 parameters epe keen xir Sete ae ese ela an orca 6 30 coding sequence 1 eee 6 31 BT WRITE command byte 02 000 e eee eee 6 32 description 0 eee eee eens 6 32 Parameters 2 0 cette enna 6 34 coding sequence 1 eee tee eens 6 35 CONTINUOUS BT READ command byte 06 6 36 description llllsessesee RII 6 36 parameters ils eee Hews deen tod wens oes seed Seed 6 38 coding sequence 1 ett eens 6 39 CONTINUOUS BT WRITE command byte 07 6 40 GOSCIIDUON ce ge Rr eR v eee eed RE Ug i 6 40 parameter ra 25 docks es ea dee raten eee EUR e 6 42 coding sequence 1 eee tenes 6 43 RESET 5s id nep Adoro a Pd edd SRI pe be ui utet 6 44 iv Table of Contents descuplloli uuo un a Paros dE OE WATE TE Eu wees Eb 6 44 parameters i coi e dae lb eR cde Re es E deber eni 6 45 coding sequence 1 eee teens 6 45 Starting the Scanner lues 7 1 Using This Chapter 2222s Edna ERR ERES TA Understanding the Scanner States 0 00005 TA Powering Up the Scanner 000 c cece cece ees 1 4 After Waking Up the Scanner 0000 cece eeaes 18 Programming the Scanner L suee 8 1 Using This Chapter 2 02 cece eee eee eee ees 8 1 Using the Semaphore 000 c cece eee eee eee 8 1 Knowing
42. VME master processor to the scanner The scanner interrupt area and VME ID area can be read anytime without causing an interrupt to the scanner It contains 32 words in which the odd lower byte only is used the information is an ASCII character string V M E 1 D A B 6 0 0 8 S V 2 R x y or V M E I D A B 6 0 0 8 S V 1 R x y where x y are the series and revision levels of the scanner For example V M E I D A B 6 0 0 8 S V 2 R A A for series A revision A Writing to any byte in this area interrupts the scanner The scanner then looks at the command byte to determine which command to execute All even bytes have the value OxFF all odd bytes without ASCII characters have the value 0x00 see the following table for descriptions of these bits Operating Status Byte The operating status byte holds scanner status information for the VME master processor The scanner updates this byte every time it completes either a block transfer or a command The master processor can clear bits 4 and 7 the remaining bits are read only The structure is as follows Figure 6 2 Structure of the operating status byte 6 5 Chapter 6 Operating in SV Superset Mode These bits Considerations bits 0 2 These bits specify the programming mode of the scanner These bits are mutually exclusive the scanner can be in only one of these modes bit 3 If the debug mode bit is
43. When a Command Is Complete 8 2 Programming Examples of Each Scanner Management Command 8 2 Programming Block Transfers 00cceeeeeeues 8 34 Communicating with PLC 5 Processor in Adapter Mode 8 3 Troubleshooting 222r rrr nx cease mona 9 1 Using This Chapter 0 0 c cece eee eee eee 9 1 Indicators 0 0 eee teenies 9 1 ENO CodeS ux cs scichynouachad lt TEATA EA ah ioe gon n at sone 9 2 Troubleshooting Suggestions 0 0 00 cee cece 9 4 Specifications 3 253 63 169 Oe RR RR UC Oo wee wan A 1 Environmental Specifications c eee eee A 1 Performance Specifications s nuunuu aaa AA VMEbus Specifications 0 00 e eee eee A 2 Introduction Audience Required Hardware Preface Using This Manual This manual describes how to install and use the VMEbus remote I O scanners catalog numbers 6008 SV1R and 6008 SV2R You should have experience in system development and integration and in writing software for VMEbus master processors You should also have a working knowledge of the C programming language including the concepts of structures and pointers Knowledge of Allen Bradley 1771 I O products is helpful but not essential You need a VMEbus compatible VME master processor to set up and control the VMEbus remote I O scanner You install the scanner in a standard 6U full height VME rack The 1771 I O modules that the scanner monit
44. and then it updates this data in the following order 1 address 2 block transfer tag 3 length of data 4 confirmation status 5 block transfer read data 6 command complete interrupt if enabled Byte offset Hex Name m Y FH block transfer ut in queue OK me obliged confirmation any other value indicates an error 105 104 not used command lt 02H is both sent and returned 106 not used d address address of I O module channel A 109 control status 108 not used BT tag 0 41 unique number transfer 10A not used 11B 11D 11C not used semaphore Bit 7 semaphore FR length of 0 64 number of words to write ME not used Stata t to the l O module 120 BT write data as many as 64 words channel A general data length 1 length FBF not used parameters The VME master processor writes 02 hex to the command byte Then the VME master processor writes these parameters to the selected channel s control status area 5 27 Chapter 5 Operating in SV Compatible Mode Byte Parameter Description offset 107 module address The module address is the address of the I O modules that is to receive the block data The module address is the address of the I O module that is to receive the block data It contains the rack 0 15 group 0 7 and slot 0 or 1 numbers of the I O module See Figure 5 14 109 block tran
45. bytes long The list contains one READ ONLY byte sized entry for each adapter in the scan list but it contains only 16 distinct physical adapter addresses An adapter can appear in the list multiple times See Figure 5 12 on page 5 24 Figure 5 10 Format of the I O adapter status word block and scan list Byte Byte offset offset 120 rack 0 starting group 0 121 122 rack 0 starting group 2 123 124 rack 0 starting group 4 125 126 rack 0 starting group 6 127 channel A adapter status words 128 rack 1 starting group 0 129 oe Each block represents 1 word Only those words representing starting groups of 12A rack 1 starting group 2 12B existing racks should contain the data described in Figure 5 11 e e e e 15C rack 7 starting group 4 15D 15E rack 7 starting group 6 15F 160 rack 0 staring group 2 rack 1 starting group 2 161 162 rack 2 staring group 2 rack 3 starting group 0 163 cial example scan list 164 rack 4 staring group 0 rack 5 starting group 2 165 Each block represents 1 byte 166 rack 6 staring group 0 rack 7 starting group 4 167 See Figure 5 12 e up to as many e e as 64 bytes e 5 22 Chapter 5 Operating in SV Compatible Mode Figure 5 11 Format of one entry in the I O adapter status word block as shown in Figure 5 3 15 14 13 reserved Format item Description Format
46. command determines the actual rack size and writes the appropriate value rack number Write the value 0 7 binary of the rack number to be scanned bits 4 2 starting I O group number Write one of these values bits 1 0 00 group 0 01 group 2 10 group4 11 group 6 5 14 Chapter 5 Operating in SV Compatible Mode coding sequence Your code for the SCAN LIST command should include these tasks we wh get the semaphore set up the control status area copy the scan list to the general data area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt clear the semaphore Chapter 5 Operating in SV Compatible Mode FAULT DEPENDENT GROUP command byte 12 description FAULT DEPENDENT GROUP associates a set of adapters such that if one adapter in the group faults all the other adapters in the group fault going to their fail safe mode of operation The scanner must be in Program mode to issue this command You can specify as many as 8 fault groups Sen Name m 00H returned means the command was 102 not used confirmation Successful Any other value indicates an error 105 104 not used command 12H is both sent and returned 106 not used channel A control status 11B 11D 11C not used semaphore Bit 7 semaphore 11E not used 120 1 byte per starting group 4 bytes per adapter fau
47. continuous BT read 32 entries 72 words each SF CO interrupt VME ID area 32 words The physical address is the base address plus the byte offset Important Add 2000 hex to channel A addresses to get the corresponding addresses for channel B 6 2 Chapter 6 Operating in SV Superset Mode global RAM structure for SV superset mode Channel A byte offset hex continued byte offset hex Rack 0 Output Group 0 n A Rack 0 Output Group 1 General Data Area Rack 0 Output Group 2 general o area Rack 0 Output Group 3 220 2FF MES Rack 0 Output Group 4 Rack 0 Output Group 5 Rack 0 Output Group 6 000 0FF Y Rack 0 Output Group 7 output image table A Rack 1 Output Group 0 128 words continuous block transfer Rack 1 Output Group 1 Continuous Block Transfer 300 BFF ey aaa Write Table F sixteen 72 word entries Rack 15 Output Goup 6 Rack 15 Output Group 7 M A Rack 0 Input Group 0 n Rack 0 Input Group 1 A Flack 0 Input Group 2 Continuous Block Transfer ack U Inp p Read Table Rack 0 Input Group 3 C00 1DFF Rack 0 Input Group 4 continuous block transfer Rack 0 Input Group 5 read area 2304 words Rack 0 Input Group 6 100 1FF thirty two Rack 0 Input Group 7 F 72 word entries input image table Rack 1 Input Group 0 128 words Y Rack 1 Input Group 1
48. continuous block transfer address configure this parameter at byte offset 0207 see above READ ONLY 0C05 continuous block transfer configure this parameter at byte offset 021F see above length of data READ ONLY 0C06 continuous block transfer configure this parameter at byte offset 020A see above status ID READ ONLY 0C07 continuous block transfer configure this parameter at byte offset 020B see above interrupt level READ ONLY 0C09 continuous block transfer Used for Peterson semaphore See sample code in chapter 8 scanner flag 0COB continuous block transfer Used for Peterson semaphore See sample code in chapter 8 VME flag 0COD continuous block transfer Used for Peterson semaphore See sample code in chapter 8 turn flag OCOF continuous block transfer Indicates the status of the continuous block transfer status 0100 block transfer disabled READ ONLY 0200 block transfer pending 0400 block transfer sent 0800 block transfer received 0C10 0C50 continuous block transfer Contains as many as 64 words of write or read data write read data 64 words Chapter 6 Operating in SV Superset Mode Use the SV2 flag VME flag and turn flag to determine who has access to the continuous block transfer write table If the scanner has the lock so that it can update the block data the scanner copies 64 words at 6 4 msecs before releasing the lock The VME master processor would at most busy wait 7 msecs before it could acquire the lock
49. eeeeeee 2 6 Inserting the Scanner 00 00 ccc eee eee eens 2 7 Determining Power Supply Requirements 2 7 Connecting to the Remote I O Link 00 eee aes 2 8 Addressing WO 2 sen eied eeewedew eee eee ens 3 1 Using This Chapter 0000s cece cece eee ees 3 1 I O Addressing Concept 00c cece eee e eens 3 1 Choosing an Addressing Mode 00 cee eeeeeee 3 3 Addressing Block Transfer Modules 0005 3 6 Assigning Racks ax csses edes hb ERE Ra ps IRR ee RES 37 Communicating with Remote I O 4 1 Using This Chapter 2 ivevetaterasaes RE ERE RAE oda 4 i Selecting Devices that You Can Connect 4 1 Introduction to Remote I O 00 ec eee eee eee 4 2 Designing a Remote I O Link 00 00 eee eee 4 3 Specifying a Scan List 2 2 ozlsi cse ive El RR reas 4 5 Processing Discrete I O 2 c cece eee e eens 46 Processing Block Data 0200ee eee eee eee 4 8 Table of Contents Operating in SV Compatible Mode Using This Chapter 0 2c cece eee eee eee Addressing Global RAM 00 cece eee e cece Command Summary 0 0 e cece eee eee eee SETUP command byte 13 6 554505 e00de dade ese wed en eo Ss description 22 2 ro 5 ans Sieetas Se edada niente dete ca sake parameters TEE ETT EET TEE aqua EET coding sequence sssssessssee eee ees AUT
50. global RAM L Command summary How will the scanner operate chap 7 chap 8 chap 9 Starting the Scanner Programming the Scanner Troubleshooting 1 Understand the scanner states L Use the scanner management commands Check indicators L Power up the scanner Program block transfers LI Check scanner states Communicate with PLC 5 adapters Check error codes 1 Other suggestions chap 4 Communicating with Remote I O chap 1 chap 2 chap 3 Scanner Overview Installing the Scanner Addressing I O CL VMEbus relationship L Set the switches L Choose the addressing mode Select remote I O devices L How the scanner scans Ground the chassis L1 Address block transfer modules Design the remote I O link L1 Operating modes L Insert the scanner L Assign racks LI Specify the scan list L Determine the power requirements L Connect to remote I O chap 5 Operating in SV Compatible Mode 1 Address global RAM LJ Command summary chap 6 Operating in SV Superset Mode L Address global RAM L Command summary How will the scanner operate chap 7 chap 8 chap 9 Starting the Scanner Programming the Scanner Troubleshooting 1 Understand the scanner states L Use the scanner management commands Check indicators L Power up the scanner Program block transfers LI Check scanner states Communicate with PLC 5 adapters Check error codes 1 Other suggestions c
51. interrupt to which the VME master processor must respond This interrupt is sent when the scanner finishes commands that a VME master processor initiated The 6008 SV1R and 6008 SV2R scanners replace and are backward compatible with the Allen Bradley 6008 SV VMEbus remote I O scanner The 6008 SV1R and 6008 SV2R scanners offers these improvements each remote I O channel controls as many as 32 adapters configurable communication rate of 230 4 115 2 or 57 6 kbps lets you select I O scan time embedded communication microprocessor increases scanner performance VME interrupt signals change in the scanner input table configurable VME operating mode lets you select the scanner features you need for your application Important The SCAN LIST command is the only difference between the 6008 SV1R and 6008 SV2R scanners and the 6008 SV scanner If you use that command you must modify the command to specify the rack size The 6008 SV1R and 6008 SV2R also offer improved block transfer operations In addition to single block transfer operations the 6008 SV1R and 6008 SV2R support continuous block transfer operations A single block transfer is a single read or write transfer to a specific intelligent I O module If your application needs to continuously poll a module to receive up to date data use a continuous block transfer request The continuous block transfer requests uses less programming overhead than programming a single block t
52. k xx kx kx ay void Chapter 8 Programming the Scanner PRINT BT DATA print contents of bt data structure This routine prints the contents of a bt data structure which is used by the queue oneshot bt oneshot bt complete configure continuous bt and continuous bt update routines parameters pointer to bt data structure return value none print bt data bt data far ptr unsigned short Ts print command type if ptr cmd CMD OSBTWRITE fprintf stdout Ntcmd ONE SHOT BT WRITENn else if ptr gt cmd CMD OSBTREAD fprintf stdout Ntcmd ONE SHOT BT READ n else if ptr gt cmd CMD CONBTWRITE fprintf stdout Ntcmd CONTINUOUS BT WRITEMn else fprintf stdout Ntcmd CONTINUOUS BT READ n print tag word fprintf stdout Nttag XHWNn ptr gt tag print address fprintf stdout Ntaddress XH rack d group d slot d n ptr addr ptr addr amp 0x00F0 gt gt 4 ptr addr amp Ox000E gt gt 1 ptr addr amp 0x0001 print data length fprintf stdout Ntdatalen d words n ptr datalen if continuous operation print irq if ptr cmd CMD_CONBTWRITE ptr cmd CMD CONBTREAD fprintf stdout Ntinterrupting on IRQ d with vector XHWn ptr irq amp 0x0007 ptr irq amp OxFF00 8
53. k EF If the specified operation is a write block transfer the routine copies data from the AX bt_data parameter s data buffer to the table entry data buffer If the specified KE operation is a read block transfer the routine copies data from the table entry s XE data buffer to the bt_data parameter s data buffer k k ee parameters pointer to channel structure EE pointer to the bt_data structure KA return values 0 success Ae 1 could not lock table entry s data buffer k k int continuous_bt_update channel far chan bt_data far block csa_data far csa unsigned short far gda btentry far xpt btentry far entry unsigned short aly map channel amp establish pointers map channel chan csa csa data far chan ControlStatusArea gda unsigned short far chan gt GeneralDataArea make pointer to continuous BT table if block gt cmd CMD CONBTREAD read operation bt btentry far chan gt ConBTRTable else write operation bt btentry far chan gt ConBTWTable make pointer to continuous BT table entry entry btentry far amp bt block gt tag update transfer parameters block gt tag entry gt tag block gt addr entry addr block datalen ntry datalen block irq entry gt irg 8 15 Chapter 8 Programming the Scanner try to lock the table entry buffer if lock co
54. master processor reads the status of inputs from the input image table and controls the outputs by writing data to the output image table Chapter 1 Scanner Overview These VMEbus transfers are asynchronous to the scanner s I O update This means there is no way to know exactly when the data being put in the output image table will be sent to the appropriate I O rack Data is sent to an adapter only when that adapter is being scanned Best case timing is if the data is placed in the output image table just before the specified adapter is scanned worst case timing is if the data is placed in the output image table just after the specified adapter was scanned In the worst case scenario the data does not reach the specified I O rack until the next time that adapter is scanned How the Scanner Responds to VME Signals The scanner can generate interrupts on any of seven request levels IRQI IRQ7 When a VMEbus master acknowledges the interrupt the scanner replies with a vector status id using the odd 8 bits of the data bus Important The VME master processor might crash if there is no software routine written to process an interrupt from the scanner Or you can use the SETUP command to configure the scanner so that it never generates interrupts in case no interrupt software routine has been written If the scanner does not generate interrupts the application program must poll the scanner to see when commands have been p
55. master processor in this time period as counted by the watchdog timer the scanner resets itself and repeats its startup initialization sequence This causes the I O racks on the link to fault within 100 msec and the I O all turn off or remain in their last state depending on the switch setting on the I O chassis You can disable the watchdog timer or change its timeout period with the SETUP command To keep the watchdog from shutting down the scanner periodically issue a LINK STATUS command This command provides the application program with important diagnostic information about the status of the I O link and at the same time causes the least amount of overhead for the scanner to complete the command To debug your application program you can select debug mode and disable the watchdog timer using the SETUP command disabling the VME master processor watchdog When the VME master processor watchdog is disabled the scanner has no way of knowing that communication has been lost with your VME master processor and will continue to send data from the output image table to the output modules 1 ATTENTION Unwanted machine action can result from 1 11 Using This Chapter Handling the Scanner o o o j Wrist strap Setting Switches Installing the Scanner This chapter explains how to install the scanner and connect it to a remote I O link For information about programming and using the sc
56. master processor writes 12 hex to the command byte Then the VME master processor writes this parameter to the selected channel s general data area Byte Parameter Description offset 0220 fault dependent group block There are 4 configurable bits for each starting group entry An adapter must be in the current scan list to be assigned to a fault dependent group If you specify an adapter that is not in the scan list the scanner writes an illegal configuration error 16H to the confirmation status byte See Figure 6 8 and Figure 6 9 6 18 Chapter 6 Operating in SV Superset Mode Figure 6 8 Format of the fault dependent group block Byte Byte offset offset 0220 0221 starting group 0 starting group 2 rack 0 ve starting group 4 starting group 6 0223 tees starting group 0 starting group 2 0259 rack 1 tee starting group 4 starting group 6 0227 vee starting group 0 starting group 2 0253 e rack 2 022A starting group 4 starting group 6 UB eri e e e e e e vee starting group 0 starting group 2 923D 025E x 025F rack 15 starting group 4 starting group 6 Each block represents 1 byte There is 1 byte for each starting group for each adapter Only those entries representing starting groups of existing racks should contain the data described in Figure 6 9 Zero all entries for which adapters do not exist 6 19 Chapter 6 Operating in SV Superset Mode
57. operating modes 1 9 VME master processor watchdog timer 1 11 The VMEbus scanners catalog number 6008 SV1R and 6008 S V2R monitor and control remote Allen Bradley I O modules without using a PLC processor Use your VME master processor s to manage as many as 32 racks of remote A B I O 16 per scanner channel The scanner communicates with I O adapters that reside in the left slot of a remote chassis and with other products that have node adapters built into them The scanner transfers the information necessary to control discrete and block transfer data to and from the VMEbus The VMEbus scanner physically resides in the VME chassis The scanner occupies one 6U full height VME slot The scanner uses the P1 connector to interface to the VMEbus You can use more than one scanner in your VME system to create large and flexible I O subsystems To the VMEbus the scanner is a memory mapped slave that responds to 8 bit or 16 bit accesses in either A16 or A24 address space The scanner can act as a VME interrupter on any of the seven VMEbus interrupt lines The SV1R and SV2R scanners replace the Allen Bradley 6008 SV scanner The SV1R has one remote I O channel the SV2R has two remote I O channels The SV1R and SV2R scanners have an extra embedded communication microprocessor which gives them more flexibility and faster performance than the 6008 SV scanner The new scanners are backward compatible with the 6008 S V scanner and offer
58. param cmdcmpl irq vector map the channel amp establish pointers map channel chan csa csa data far chan ControlStatusArea vid unsigned short far chan VmeldArea determine length of setup data setup len unsigned short chan gt ScannerMode MODE COMPATIBLE SVC SETUP SIZE SVS SETUP SIZE get the semaphore if lock gda chan 0 fprintf stdout setup lock aquire FAILED Nn unmap channel chan return 1 set up the control status area csa cnfstat 0x000F confirmation status word csa gt cmd CMD_SETUP command word csa datalen setup len length of data word copy the setup parameters blockcpy chan gt GeneralDataArea setup param size t setup len 8 3 Chapter 8 Programming the Scanner 8 4 send the command interrupt assert cmd chan wait for command result if wait for cmdcmpl chan unlock gda chan unmap channel chan fprintf stdout setup return 2 ud FALSI ie wait failure locked cleared n clear the semaphore bit amp unmap the channel res csa gt cnfstat unlock_gda chan unmap_channel chan return int res Chapter 8 Programming the Scanner AUTOCONFIGURE command k k AUTOCFG autoconfigure a 6008 SV2 channel xor This f
59. queue and sends a confirmation status code The scanner then interrupts the VME master processor 4 The application program should acknowledge the interrupt and clear the semaphore Upon issuing a block transfer request the scanner writes Ox2F in the confirmation status byte to indicate that the scanner accepted the request and put it into its queue When the scanner actually completes the block transfer the scanner sets the semaphore and then it updates this data in the following order address block transfer tag length of data confirmation status block transfer read data command complete interrupt if enabled SURE Ur The scanner executes block transfers in run and test modes In program mode the scanner only queues block transfers The programming example on page 8 13 shows how to program a single block transfer command in the scanner These following examples show how to update block transfer data and how to test for complete block transfer operations Chapter 8 Programming the Scanner Programming Examples k k READ INPUT WORD read from selected input image table entry k KE This routine reads the specified entry in the discrete input table k zy parameters pointer to channel structure i target rack number MOM target IO group word 0 7 AN pointer to rack IO group word value TA return values none k void read_input_word channel far chan int rack int iogrp unsi
60. the specified I O module The scanner queues at most one block transfer request write or read In SV superset mode each scanner channel can queue only one block transfer request If you need to send multiple block transfer requests use the continuous block transfer commands See pages 6 40 and 6 36 Upon issuing a block transfer request the scanner writes Ox2F in the confirmation status byte to indicate that the scanner accepted the request and put it into its queue When the scanner actually completes the block transfer the scanner sets the semaphore and then it updates this data in the following order address block transfer tag length of data confirmation status block transfer read data command complete interrupt if enabled See Se Chapter 6 Operating in SV Superset Mode Byte offset Name Hex OOH transfer was successful 0208 firmat 2FH block transfer put in queue OK 0202 not used confirmation any other value indicates an error 0204 not used 03 command 02H is both sent and returned 0207 0206 not used address address of I O module channel A not used 0209 control status 0208 BT tag 0 1 unique number transfer 020A not used 021D 021D 021C not used semaphore Bit 7 semaphore v F length of 0 64 number of words to write 021E TEST data to the I O module 0220 BT write data as many as 64 words ch
61. unmap channel chan return int res Chapter 8 Programming the Scanner BT WRITE BT READ k k QUEUE ONESHOT BT queue a one shot block transfer read or write Ead This function is driven by the data contained in the bt data structured provided by Aw the caller The command word OSBTW OSBTR BT address word tag word and TE BT transfer length word are placed in the Control Status Area If the command is a XE OSBTW then data is copied from the bt data struct s data buffer to the channel s do General Data Area The command is then asserted and its results returned to AE the caller k k EF parameters pointer to channel structure pointer to the bt data structure KE return values 1 unable to lock general data area semaphore kE 2 did not get cmd complete interrupt EK ELSE channel confirmation status word k k int queue_oneshot_bt channel far chan bt_data far block csa_data far csa unsigned short far gda unsigned short res unsigned short i map channel amp establish pointers map channel chan csa csa data far chan ControlStatusArea gda unsigned short far chan gt GeneralDataArea get the semaphore if lock gda chan 0 unmap channel chan fprintf stdout osbtwrite lock aquire FAILED in return 1 set up the control status area csa cnfstat 0x000F confirmati
62. use these examples on other VME systems search for and replace all EPC calls with the appropriate functions for your system The scanner operates in one of several different states depending on what commands you have sent the scanner as well as the scanner s health The following figure shows the possible scanner states the inputs that result in the states and the states that follow a given state 7 1 Chapter 7 Starting the Scanner possible scanner states power cycle SYSRESET DEAD state FLT LED on scanner blinks must cycle power POST state successful self test scanner set for SV compatible or SV superset mode SET MODE command TEST VME master writes any value to scanner ID area SET MODE command RESET command wake up the scanner PROGRAM SETMODE SET MOD PROGRAM state command command TEST RUN SET MODE command RUN SET MODE command PROGRAM SYSFAIL SYSFAIL SYSFAIL FLT LED on scanner lights FAULTED state remote I O communication shuts down adapters go to their failsafe modes scanner waits for power cycle VME SYSRESET command or scanner RESET command 7 2 In this state Chapter 7 Starting the Scanner The following table describes each scanner state the scanner enters this state POST at power up as a result of a VME SYSRESET or as a result of the RESET command In this state the scanner executes its self
63. 12 1 adapter is in the current scan list bit 7 1 fault exists in the fault dependent group 0 adapter not in current scan list associated with the adapter 0 no fault exists in the fault dependent group associated with the adapter adapter attached Contains one of these values line status Contains one of these values hex bit 11 1 adapter resides at this address bit 6 4 000 adapter is off line 0 no adapter resides at this address any other adapter is on line value valid configuration Contains one of these values in fault dependent Contains one of these values bit 10 1 adapter type size and address are valid Ned 1 adapter is in the fault dependent group 0 adapter type size and or address not identified by the fault dependent group valid adapter is improperly configured number bits 2 0 0 adapter is not in a fault dependent group adapter size Contains one of these values hex fault dependent The value 0 7 binary identifies the fault bits 9 8 group number dependent group to which this adapter belongs 00 1 4 rack addressing 01 1 2 rack addressing 10 3 4 rack addressing 11 full rack addressing bits 2 0 5 11 Chapter 5 Operating in SV Compatible Mode 5 12 Format item Figure 5 5 Format for one entry in the scan list Description rack number bits 4 2 The value 0 7 binary identifies the rack number starting I O group number bits 1 0 One of the follo
64. 1D 021C not used semaphore Bit 7 semaphore 021E not used SE un T number of entries in the scan list eng READ ONLY 0220 16 bits per starting group 4 words per adapter adapter status words see Figure 6 3 and Figure 6 4 64 words READ ONLY channel A general data 029F 02A0 scan list 1 byte per adapter in the as many as 64 bytes scan list see Figure 6 5 02DF READ ONLY 02E0 not used 02FF 6 23 Chapter 6 Operating in SV Superset Mode parameters The VME master processor writes 21 hex to the command byte There are no input parameters from the VME master processor The scanner writes these parameters to the selected channel s general data area Byte Parameter Description offset 021F scan list length The scan list length indicates the number of entries in the scan READ ONLY list The scan list length is an 8 bit quantity that the scanner writes to the length of data byte in the control status area You can enter a scan list length of 0 0220 I O adapter status word block This word block contains four 16 bit entries 4 words for each READ ONLY adapter 16 bits for each starting group per adapter maximum of 16 groups of entries See Figure 6 10 and Figure 6 11 02A0 scan list This list is a maximum of 64 bytes long 1 byte per adapter READ ONLY but it contains only 32 distinct physical adapter addresses The list contains one byte sized entry for each adapter in the s
65. 2 kbps 0220 0221 03 230 4 kbps 0220 baud rate Watchdog FF no change acs m watchdo 01 disable watchdog 0222 tr disable Inn pis Xx enable watchdog m complete 025 complete 00 FF status ID 0224 Status ID interrupt enable channel A 00 SYSFAIL enabled 22 v5 SYSFAIL 27 input image general data 0226 t t t level 01 SYSFAIL disabled Oe FF no change 0228 input image 0 input image 00 FF status ID 0228 Status ID monitor enable A 022 input image 0228 input image 00 high bound low oas lowbound high bound 022C not used 02FF OOH returned means the command was 4 successful Any other value indicates an error 4 13H is both sent and returned Bit 7 semaphore 00 500 ms default 7 4 0A FE value x 100 ms 1000 25400ms FF no change 4 01 07 interrupt level 00 interrupt enabled 401 interrupt disabled FF no change 4 01 07 interrupt level 00 interrupt enabled 401 interrupt disabled FF no change low bound 7E high parameters The VME master processor writes 13 hex to the command byte Then the VME master processor writes these parameters to the first 12 bytes of the selected channel s general data area 6 8 Chapter 6 Operating in SV Superset Mode Byte Parameter Description Byte Parameter Description offset offset 0220 O link Write one of these values hex 0226 SYSFAIL Write on
66. 28 BT WRITE command on page 6 32 CONTINUOUS BT READ command on page 6 36 CONTINUOUS BT WRITE command on page 6 40 block transfer tag byte provided by the VME master processor to uniquely identify each one shot block transfer request or continuous block transfer entry block transfer interrupt byte indicates the VME interrupt level and interrupt acknowledgement vector for when a continuous block transfer periodically completes For more information see BT WRITE command on page 6 32 or BT READ command on page 6 36 Use the SETUP command to specify the interrupt level and interrupt vector input image table monitor index word when the input image table monitor is enabled this word contains the index of the last entry that changed in the input image table when the input image table monitor is disabled this word is undefined Use the SETUP command to enable or disable the input image table monitor semaphore byte provides for the integrity of command requests command responses and completed one shot block transfers If bit 7 is set a VME master processor is using the control status and general data area or the scanner just completed a block transfer and set the semaphore so no other VME master processor will overwrite the data If the semaphore is set because of a block transfer the appropriate VME master will know to come and retrieve the data and reset the semaphore If the semaphore bit is clear the general dat
67. 5 Operating in SV Compatible Mode Table 5 A Descriptions of the global memory areas This area stores the input and output image tables input and output data for as many as 8 logical I O racks with no more than 16 adapters control status area operating status byte reflects the current status of the scanner Figure 5 2 lets the VME master processor poll the scanner s status without interrupting ongoing operations confirmation status contains the result of the executed command byte A result of 00 hex indicates the command completed successfully See chapter 9 for a list of error codes command byte identifies the command the VME master processor wants the scanner to execute next address byte contains I O rack group and slot parameters for block transfer commands For more information see BT READ command on page 5 25 or BT WRITE command on page 5 27 block transfer tag byte provided by the VME master processor to uniquely identify each block transfer request semaphore byte provides for the integrity of command requests command responses and completed block transfers If bit 7 is set a VME master processor is using the control status and general data area or the scanner just completed a block transfer and set the semaphore so no other VME master processor will overwrite the data If the semaphore is set because of a block transfer the appropriate VME master will know to come and retrie
68. 8 S V 1 R x y where x y are the series and revision levels of the scanner For example V M E I D A B 6 0 0 8 S V 2 R A A for series A revision A Writing to any byte in this area interrupts the scanner The scanner then looks at the command byte to determine which command to execute All even bytes have the value OxFF all odd bytes without ASCII characters have the value 0x00 54 Operating Status Byte Chapter 5 Operating in SV Compatible Mode The operating status byte holds scanner status information for the VME master processor The scanner updates this byte every time it completes either a block transfer or a command The master processor can clear bits 4 and 7 the remaining bits are read only The structure is as follows Figure 5 2 Structure of the operating status byte These Considerations These Considerations bits bits bits 0 2 These bits specify the programming mode of the scanner bits 5 If bit 5 is set the scanner has at least one block transfer These bits are mutually exclusive the scanner can be in only request in its internal queue When the queue is empty the one of these modes scanner clears the bit bit 3 If the debug mode bit is set by the scanner the scanner cannot bit 6 If bit 6 is set at least one adapter has faulted lost power or be shutdown by the internal watchdog has been dropped from the I O link The VME master ATTENTI
69. 8 17 sample code for VMEbus operations bus c 8 18 sample code for utility routines utils c 8 22 6008sv2 h defines and data structures for 8 29 scanner management commands cmds h function prototypes for cmds c 8 33 bus h function prototypes for bus c 8 33 utils h function prototypes for utils c 8 33 your own programs They need modification to work correctly ATTENTION These examples are meant to help you create on your processor system 8 2 Chapter 8 Programming the Scanner SETUP command k k SETUP set up a 6008 SV2 channel KR a This function executes a SETUP command using the parameters provided by the caller Ao in the setup data structure k k KE parameters pointer to channel structure KK pointer to setup_data structure ok return values 1 unable to lock general data area semaphore EK 2 did not get cmd complete interrupt ae ELSE channel confirmation status word k k KE NOTE this routine overwrites the channel structure CmdCmplIrq amp CmdCmplVec fields kE with the interrupt level and vector contained in the setup_param structure k k int setup channel far chan setup_data far setup_param csa_data far csa unsigned short far vid unsigned short setup len unsigned short res update the command complete interrupt settings chan CmdCmplIrq unsigned short setup param cmdcmpl irq level chan CmdCmplVec unsigned short setup
70. BBEH SW1 um for manufacturing use only No do not jumper these pins al E J J A23 A22 A21 A20 A19 A18 A17 A16 pieni al 123 4 5 6 7 8 t slide switch pushed up on closed 0 9 slide switch pushed down off open 1 reserved A15 A14 A13 A12 Rd 12 3 4 gm In this VME these bits are valid for this Operating mode address space SV compatible A23 through A12 1 channel active A24 A23 through A13 2 channels active A15 through A12 1 channel active A16 A15 through A13 2 channels active SV superset A23 through A13 1 channel active A24 A23 through A14 2 channels active If there are switches not accounted for in a particular address space such as the switches for A16 A23 for SV compatible A16 address space the switch position does not affect scanner operation 2 2 Chapter 2 Installing the Scanner Determine the Operating Mode Address Space Scanner Response and Rack Configuration Use this diagram and Table 2 A on page 2 4 to set SW3 L HEBREEEE BBHBBBBB QBBBBBBH t V slide switch pushed on closed 0 slide switch pushed off open 1
71. C ITABLE OFFSET control status area at offset 100H chan gt ControlStatusArea char far amp base SVC CSA OFFSET general data area at offset 120H chan gt GeneralDataArea char far amp base SVC GDA OFFSET continuous block transfer write table chan gt ConBTWTable char far NULL continuous block transfer read table chan gt ConBTRTable char far NULL reset area at offset FBCH chan gt ResetArea char far amp base SVC RESET OFFSET vme ID area at offset FCOH chan gt VmelIdArea char far amp base SVC VIA OFFSET 7 6 K kx kx kx kx kx Af void Chapter 7 Starting the Scanner else if chan gt ScannerMode MODE SUPERSET output table at base of global memory chan gt OutputTable amp base SVS OTABLE OFFSET mS input table at offset 100H han gt InputTable char far amp base SVS ITABLE OFFSET Q mS control status area at offset 200H han ControlStatusArea char far amp base SVS CSA OFFSET Q general data area at offset 220H han GeneralDataArea char far amp base SVS GDA OFFSET Q continuous block transfer write table at offset 300H han ConBTWTable char far amp base SVS CONBTW OFFSET Q continuous block transfer read table at offset COOH han ConBTRTa
72. EEP state writes OxFO to the command byte writes the scanner s name firmware version and copyright notice to the VME ID area sets input and output image tables to 0 deasserts SYSFAIL write 0x90 to the confirmation status byte The VME master should monitor the confirmation status word to determine if the power up is successful When the scanner is in the SLEEP state you have to wake up the scanner which moves the scanner to the PROGRAM state so it can accept scanner management commands How the Scanner Uses SYSFAIL During Power Up While the scanner is doing its self tests during power up the scanner asserts SYSFAIL on the VMEbus When the scanner successfully completes its self tests it no longer asserts SYSFAIL During a power up sequence many other VME boards also assert SYSFAIL During normal operation in a VME system the scanner watches the SYSFAIL line and shuts itself down whenever the SYSFAIL signal is asserted However during a system power up sequence some VME boards might assert SYSFAIL longer than the scanner In this situation the scanner doesn t start monitoring for a SYSFAIL until SYSFAIL is no longer asserted by another board during power up You can also use the SETUP command to instruct the scanner to ignore SYSFAIL signals There are some VME boards that assert SYSFAIL while the operating system is booting up which is after power has been applied and the other boards have finished the
73. OCONFIGURE command byte 10 description llleslsseleee RII parameters occa miaresacederesaaumds aes ELE eR ine coding sequence lt a i255 sco sors ees parie De RO Ree gt SCAN LIST command byte 11 0 0 00 eee eee description llllssessese RII parameters used spese ede Eua Doku duck dart coding sequence 1 eee m FAULT DEPENDENT GROUP command byte 12 UOSCHIDIIOTL isea iaa m bre oe pope d qu dpa Re Er ERE O D DaranmelBiS ose cree eire e Rods Dos onde coding sequence ssssssssseee eens SET MODE command byte 20 0 0 00 cece eee description uunc AP Sere bI ede OLA ee Lod SETA Dardmelplo s aor keane Sede Roos bu eie v cadis coding sequence damen RR EXER E IA ERE Repas LINK STATUS command byte 21 0 0 cece eee description 1323 36e dinie niae adhd oe cauere ex parameters s oou Eb UE CETUR Pedic es eee 8S coding sequence lsssssessseee eens BT READ command byte 01 lillslullsslsess description ol eeii eieiaeo 2 ki exu eR Y an parameters Llxscussal xd Rer a n vee EROR eens coding sequence 1 ee I BT WRITE command byte 02 00 000 cece eee description 0 eee eee eens parameters 0 0 ccc ccc eect n coding sequence 1 ee teens HESET posuere axo bate ease ge ane eae ea ee eee Skee COSCIIDUON ic nus cie Eu RE RES Ch aa Oh tt Soe XO eee parameters mq ep Rc coding sequence ssssssss
74. ON Unwanted machine motion can result from processor can issue the LINK STATUS command for fault disabling the VME master processor watchdog Only use the sas Misa E nie css rad eod i debug mode when you are debugging the application program i um AVE JEEN THEOCR OO AD ME scanner wI esar for the VME master processor ae bit 4 The scanner sets bit 4 when it detects an unsolicited bit 7 If bit 7 is set an adapter s operating status has changed The block transfer An unsolicited block transfer results if a VME master processor accidentally writes discrete information to an output image table byte that is mapped to an I O slot requiring a block transfer When this bit is set take action to correct this situation because it can seriously degrade scanner response time The scanner can only set this bit the VME master processor must clear it scanner uses this bit to tell VME master processors of a change in status of one of the adapters on the I O link An example is that if an operator temporarily pulled the swing arm from an adapter the scanner would lose communications with that adapter Maybe the operator could quickly put it back and the status LED and the adapter fault bit bit 6 would say everything is working properly but the adapter fault change bit would be left set indicating that an adapter was temporarily off line A VME master processor can issue the LINK STATUS command to make sure the I O link and all adapters are operating
75. SET command 92 ACFAIL ACFAIL has been asserted on the VMEbus Power to the system is going to be removed shortly 93 Spurious interrupt to the scanner CPU Reset the scanner with the RESET command Eliminate any electrical noise to the VMEbus Troubleshooting The following table describes some problems you may encounter and Suggestions possible solutions to them Problem Possible Solution The scanner won t communicate with the Make sure the address of the global RAM is what you think it is VME master processor as indicated by the front panel LEDs See chapter 2 for information on configuring the scanner Check the SETUP parameters for error and re issue the command Check the memory map to ensure a clear 2K memory window Scanner is in sync with the VME master Check status of LEDs at the adapter processor but there is no communications with the I O racks as indicated by the front panel LEDs red light ON indicates a rack fault green light ON indicates normal operation in run mode green light blinking indicates normal operation in the program mode Check the communication rate of the adapter and the SETUP command Send an AUTOCONFIGURE command Check the LEDs at the adapter Send a LINK STATUS command determine if the adapter numbers returned correspond to those of the adapters Use this formula to determine adapter number Adapter 4 x rack starting group 2 Check I O cable for p
76. T OxOFBC soft reset register define SVC VIA OFFSE OxOFCO VME ID area 6008 SV2 Scanner Channel Offsets Superset Mode define SVS_OTABLE_OFFSE 0x0000 output table define SVS_ITABLE_OFFSE 0x0100 input table define SVS_CSA_OFFSE 0x0200 control status area define SVS_GDA_OFFSE 0x0220 general data area define SVS_CONBTW_OFFSE 0x0300 cont BT write table define SVS_CONBTR_OFFSE 0x0C00 cont BT read table define SVS_RESET_OFFSET OxlFBC soft reset register define SVS VIA OFFSET Ox1lFCO VME ID area 8 29 Chapter 8 Programming the Scanner 6008 SV2 Scanner Constants define SVC_SETUP_SIZE J define SVC_IOASWBLK_SIZE 32 define SVC_FAULTGRP_SIZE 32 define SVS_SETUP_SIZE 12 define SVS_IOASWBLK_SIZE 64 define SVS_FAULTGRP_SIZE 64 6008 SV2 Scanner Channel semaphore define SEMAPHORE 0x0080 bit 7 of semaphore word Channel Context structure typedef struct unsigned long ScannerAddress VME address unsigned short AddressMode VME address mode int ScannerMode operating mode SVC SVS unsigned short CmdCmplirq cmd complete IRQ level unsigned short CmdCmplVec cmd complete IRQ vector unsigned long TimeOut interrupt timeout in ms char far ScannerBase local ptr to channel char far OutputTable cha
77. TUS 21 program 6 23 scanner operation test run transfer a block of data from a specified I O module to BT READ 01 program 6 28 the scanner test run transfer a block of data from the scanner to a specified BT WRITE 02 program 6 32 1 0 module test run continuously transfer a block of data from a specified I O CONTINUOUS BT READ 06 program 6 36 module to the scanner continuously transfer a block of data from the scanner to a CONTINUOUS BT WRITE 07 program 6 40 specified I O module cause the scanner to reset itself RESET none program 6 44 test run Waking up the scanner When the scanner is first turned on it does a self test and then goes to sleep A VME master processor must wake the scanner up by interrupting it writing any value to the scanner s ID area which moves the scanner from sleep mode to program mode Chapter 7 explains how to wake up the scanner Chapter 8 provides additional programming examples 6 7 Chapter 6 Operating in SV Superset Mode SETUP command byte 13 description SETUP configures the scanner The scanner must be in Program mode to execute this command This is normally the first command sent to the scanner Byte offset Hex Name 0203 0202 not used confirmation 0204 not used 0205 command 0206 not used channel A control status 021B 021C not used 021D semaphore 01 57 6 kbps default 021E not used 02 115
78. The value 0 7 binary identifies the rack number bits 4 2 starting I O group number One of the following values identifies the starting I O group bits 1 0 00 group 0 01 group 2 10 group 4 11 group 6 coding sequence Your code for the LINK STATUS command should include these tasks 1 get the semaphore set up the control status area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt check the result 6 clear the semaphore t m Chapter 5 Operating in SV Compatible Mode BT READ command byte 01 description BT READ transfers a block of data from the specified I O module into the scanner Upon issuing a block transfer request the scanner writes Ox2F in the confirmation status byte to indicate that the scanner accepted the request and put it into its queue When the scanner actually completes the block transfer the scanner sets the semaphore and then it updates this data in the following order 1 address 2 block transfer tag 3 length of data 4 confirmation status 5 block transfer read data 6 command complete interrupt if enabled Byte offset Hex Name B 00H transfer was successful 102 not used confirmation 2FH block transfer put in queue OK any other value indicates an error 105 104 not used command 01H is both sent and returned 106 not used 2 address address of I O modu
79. a Programming Mode Select the appropriate programming mode for programming the scanner Table 1 C Programming modes If you want these conditions select this programming mode e the scanner doesn t send output information to the adapters Program all module outputs are reset off outputs are disabled so they remain reset e discrete input information is updated e the scanner doesn t send block transfer requests to the adapters but the scanner will queue the requests from the VME master processor e the scanner sends output information to the adapters Test all module outputs are held reset off outputs are disabled so they remain reset discrete input information is updated e the scanner sends block transfer requests to the adapters but actual outputs are disabled reset e the scanner sends output information to the adapters Run e input information is updated e the scanner sends block transfer requests to the adapters all outputs are allowed to energize When your application program first starts the scanner with the SETUP command the scanner is in the Program mode Your program must issue a SET MODE command to change the scanner to Run mode 1 10 VME Master Processor Watchdog Timer Chapter 1 Scanner Overview The VME master processor must issue a valid command to the scanner at least once in a user specified time period the default is 500 msec If the scanner fails to see a valid command from a VME
80. a area is available for access by any VME master processor Important A VME master processor doesn t use the semaphore when it accesses the I O image table The VME master processor can access the I O image table anytime For command requests the scanner returns status either confirmation or error when the command is complete When the VME master processor receives the confirmation status it must retrieve the data from the general data area and clear the semaphore Important Only 1 command can be issued at a time A status confirmation or error must be received before a new command is issued This area Chapter 6 Operating in SV Superset Mode stores the length of data byte specifies the amount of data associated with a command or response Only the lower byte is used Interpret the length of data based on the context of the requested command or received confirmation i e number of words for block transfers and bytes for scanner management requests general data area contains input parameters and result data for scanner commands continuous block transfer read and write table each table contains either write or read data for continuous block transfers The write table has 16 72 word buffers the read table has 32 72 word buffers For more details see the CONTINUOUS BT WRITE command on page 6 40 or the CONTINUOUS BT READ command on page 6 36 scanner interrupt and VME ID interrupt from the
81. adapter devices the device s user manual 2 layout and connect the remote I O link cable page 4 3 for design your adapter s installation information 3 specify a scan list page 4 5 Designing a Remote I O Link Designing a remote I O link requires applying 1 remote I O link design guidelines cable design guidelines Link Design Guidelines Keep these rules in mind as you design remote I O links All devices connected to a remote I O link must communicate using the same communication rate The rate you choose depends on the VME operating mode This VME operating mode supports these communication rate SV compatible 57 6 kbps 115 2 kbps SV superset 57 6 kbps 115 2 kbps 230 4 kbps 4 3 Chapter 4 Communicating with Remote I O 4 4 Design Tip Two channels on the same scanner cannot scan the same partial or full rack address Assign unique partial and full racks to each channel You can split rack addresses between scanner channels however issues arise when performing block data transfer If you split remote rack addresses between scanner channels channel A has priority over channel B A scan list can have a maximum of 16 rack numbers or a maximum of 64 physical devices connected to it using 82 O termination resistors Cable Design Guidelines Specify 1770 CD Belden 9463 cable Connect a remote I O network using a daisy chain or trunk line drop line configuration Importan
82. addressing use the assigned rack number and the lowest group number and 0 for the module number double slot modules assigned rack number and the lowest group number and 0 for the module number 3 6 Assigning Racks Design Tip Chapter 3 Addressing I O The number of racks in a chassis depends on the chassis size and the addressing mode If using this 2 slot 1 slot 1 2 slot chassis size addressing addressing addressing rack type is rack type is rack type is 4 slot 1 4 rack 1 2 rack 1 rack 8 slot 1 2 rack 1 rack 2 racks 12 slot 3 4 rack 1 1 2 racks 3 racks 16 slot 1 rack 2 racks 4 racks One I O rack number is eight I O groups regardless of the addressing mode that you select When assigning remote I O rack numbers use the following guidelines Each scanner channel supports as many as 16 physical I O adapters The number of racks the scanner supports depends on the VME operating mode This operating mode supports as many as with a total maximum number of adapters SV compatible 8 full racks 16 SV superset 16 full racks 32 SV adapter 1 rack 0 For example you can configure 8 racks as 8 full racks of 128 1 0 each 8 adapters or 16 half racks of 64 I O each 16 adapters or 6 full racks of 128 I O each and 8 quarter racks of 32 I O each 14 adapters 3 7 3 8 Chapter 3 Addressing I O You can assign a remote I O rack to a fraction of a chassi
83. al we use notes to make you aware of safety considerations practices or circumstances that can lead to personal injury or ATTENTION This notation identifies information about death property damage or economic loss Attention statements help you to identify a hazard avoid the hazard recognize the consequences Important This notation identifies information that is critical for successful application and understanding of the product Table of Contents Using This Manual leere pi Introduction icu pid us pp REDE DP RER RRROEXESeE cs ramia pi Audience colis by ere RW Re p Bho eee eet pi Required Hardware 00 0 ccc cece eee nee aes pi TP EP pii Scanner Overview 00cee cece eee eee eee 1 1 Using This Chapter 00 c cece eee eee eee eens 4 4 Introduction MP 1 1 VMEbus Relationship n on nunana anana 1 4 How the Scanner Scans 000 cece eee eee eens 1 6 Comparison to 6008 SV Scanner 0 00000 eee 1 8 Operating Modes 0 cece eee eee eee eee 1 9 VME Master Processor Watchdog Timer 1 11 Installing the Scanner L 2 1 Using This Chapter 0 0 ccc eee cece eee ees 2 1 Handling the Scanner 0 000 cece annn 2 1 Setting Switches eR ep nannaa aaee 2 1 Removing VME Backplane Jumpers 2 005 2 6 Grounding the VME Chassis 00 cee
84. and returned 106 not used 111B 11D 11C not used semaphore Bit 7 semaphore 11E not used 120 120 mode not used e not used FBF parameters The VME master processor writes 20 hex to the command byte Then the VME master processor writes this parameter to the selected channel s general data area Byte Parameter Description offset 120 mode Write one of these values hex 01 Program mode 02 Test mode 04 Run mode Values 00 03 and 05 FF are reserved If you write a reserved value to this field the scanner writes an illegal confirmation error 16H in the confirmation status byte 5 19 Chapter 5 Operating in SV Compatible Mode coding sequence Your code for the SET MODE command should include these tasks wPwh e get the semaphore set up the control status area copy the mode value to the general data area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt check the confirmation status clear the semaphore Chapter 5 Operating in SV Compatible Mode LINK STATUS command byte 21 description LINK STATUS determines the current status of the adapters on the selected channel s I O link LINK STATUS doesn t affect the scanner The VME master processor can issue LINK STATUS any time Byte offset Hex Name m 00H returned means the command was 102 not used confirmation
85. ange 8 input words and 8 output words each I O scan Important Of the words that are transferred back and forth between the scanner and PLC 5 processor the first word in the input and output image table contains rack status and block transfer status Don t program any data in these words 8 39 Chapter 8 Programming the Scanner 8 40 Design Tip Use the remaining input words and output words to move data between the scanner and the PLC 5 processor If you need to transfer more than 7 words use a block transfer which can transfer up to 64 words of data Block Transfer Adapter mode block transfers are essentially continuous As soon as a transfer is completed another block transfer is queued immediately in the PLC 5 processor the processor then waits with a buffered snap shot of the data for the scanner to perform another block transfer request The data that is transferred after the request is data from the previous block transfer For example if the scanner performs a block transfer request from the adapter more processor every 500 msec the data is at least 500 msec old The scanner controls the actual communication transmission of the block transfer request The adapter mode processor controls the actual number of words of data that is transferred location from which the data is transferred Do not use ladder logic block transfer instructions for the adapter mode processor You configure the block transfers w
86. annel A general data length 1 length not used 02FF 6 33 Chapter 6 Operating in SV Superset Mode parameters The VME master processor writes 02 hex to the command byte Then the VME master processor writes these parameters to the selected channel s control status area Byte Parameter Description offset 0207 module address The module address is the address of the I O module that is to receive the block data It contains the rack 0 15 group 0 7 and slot 0 or 1 numbers of the I O module See Figure 6 14 0209 block transfer tag number The block transfer tag number is an 8 bit integer that uniquely identifies each block transfer The scanner writes a value of 0 or 1 to the block transfer request tag number in the control status area Values greater than 1 are reserved If you write a reserved value to this field the scanner writes an illegal confirmation error 16H in the confirmation status byte This tag is returned with the status when the block transfer is complete so the VME master processor can match the block transfer status with the request 021F length of data block The length of data byte is an 8 bit value that specifies the number of 16 bit words 0 64 decimal to be written to the target 1 0 module Use the value 0 to let the I O module determine how many words the scanner can write When the block transfer completes the 0 is replaced by the actual number of words written
87. anner poll for command result if wait_for_cmdcmpl chan FALS clear the semaphore unlock_gda chan unmap_channel chan fprintf stdout autocfg wait failure lock cleared return 2 Gl check autoconfigure result res csa gt cnfstat if res 0 autoconfigure failed unlock_gda chan unmap_channel chan return int res place scan list size in autocfg structure linkcfg gt scanlist_len csa datalen copy I O adapter status word block to autocfg structure for i 0 i lt ioaswblk size i linkcfg gt ioaswblk i gda il copy the scan list to the autocfg structure scanlist unsigned char far amp gda ioaswblk_size blockcpy linkcfg gt scanlist scanlist size t csa datalen clear the semaphore amp unmap channel unlock gda chan unmap channel chan return int res 8 6 Chapter 8 Programming the Scanner SCANLIST command SCANLIST configure a 6008 SV2 channel scan list Ead This function executes a SCANLIST command using the scanlist provided by the Aw caller in the scanlist data parameter uid parameters pointer to channel structure XS pointer to scanlist data structure AE return values 1 unable to lock general data area semaphore Ak 2 did not get cmd complete interrupt Be ELSE channel confirmation status word
88. anner use the flow chart preceding each chapter to determine where to find the information you need If you want to read about go to page handling the scanner 2 1 setting switches 2 1 removing VME backplane jumpers 2 6 grounding the VME chassis 2 6 inserting the scanner 2 7 determining power requirements 2 7 connecting to the remote I O link 2 8 The scanner is shipped in a static shielded bag to guard against electrostatic damage Electrostatic discharge can damage integrated circuits or semiconductors in the scanner Avoid electrostatic damage by observing these precautions Remain in contact with an approved ground point while handling the scanner by wearing a properly grounded wrist strap Do not touch the backplane connector or connector pins When not in use keep the scanner in its static shielded bag The scanner has several on board switches you set to configure address space VME operating mode VME address space scanner responses to VME accesses 2 1 Chapter 2 Installing the Scanner Determine the VMEbus A24 A16 Address Space Use this diagram and the example to set SW1 and SW2 for the correct VMEbus address space AAAHHEBS ERES Sw A Important These pins are BEBB
89. as set the scanner holds the block transfer information until the semaphore is reset by a VME master processor After receiving the status the VME master processor must copy the data from the global RAM and reset the semaphore Processing One Block Transfer Request The order in which the scanner sends block transfer requests to adapters depends on the scanner s scan list The scan list tells the scanner when to poll an adapter an adapter can be in a scan list multiple times Figure 4 8 Adapter scan sequence scanner sends discrete output data which includes a code identifying upcoming block transfer if any Rakn amp lt scanner S lt 6 adapter accepts output data and sends discrete input data which includes a status bit that tells the scanner to send 3 remote I O the block transfer Rack2 amp S buffer oO scanner recognizes status bit and sends block transfer lt Rack 1 d adapter O adapter receives block transfer and processes the request 4 13 Chapter 4 Communicating with Remote I O 4 14 Important Do not accidentally write data in the output image table in global RAM of the scanner Any data in an output byte for an intelligent I O module overrides the scanner block transfer command and ruins any block transfer request Such an error is detected as a bit being set in the operating status wo
90. ble char far amp base SVS CONBTR OFFSET Q PSs reset area at offset 1FBCH han gt ResetArea char far amp base SVS RESET OFFSET Q vme ID area at offset 1FCO han VmeIldArea char far amp base SVS VIA OFFSET Q return UNMAP CHANNEL unmap a channel s VME shared memory This function accepts a channel structure as input and restores the window to the state it had when the channel was last mapped parameters pointer to channel structure return value none unmap channel channel far chan EpcRestState amp chan gt stash return Chapter 7 Starting the Scanner k k ASSERT_CMD touch scanner channel location monitor k k AE This function does a word write to the base of a 6008 SV2 channel VME ID Scanner Apu interrupt area This triggers a local interrupt on the 6008 SV2 alerting it EU that a command has been placed in the channel s control status area for processing k k KR parameters pointer to channel structure KE return value none K xf void assert_cmd channel far chan unsigned short far vid map channel amp establish pointers map_channel chan vid unsigned short far chan VmeIdArea touch the scanner s channel location monitor vid unsigned short 0x0000 unmap the channel unmap channel chan
91. can list An adapter can appear in the list multiple times See Figure 6 12 on page 6 26 6 24 Chapter 6 Operating in SV Superset Mode Figure 6 10 Format of the I O adapter status word block and scan list Byte Byte offset offset 0220 rack 0 starting group 0 0221 0222 rack 0 starting group 2 0223 0224 rack 0 starting group 4 0225 0226 rack 0 starting group 6 0227 channel A adapter status words 0228 rack 1 starting group 0 0229 pM Each block represents 1 word Only those words representing starting 022A rack 1 starting group 2 022B groups of existing racks should contain the data described in Figure 6 11 e e e e 029C rack 15 starting group 4 029D 029E rack 15 starting group 6 029F 02A0 rack 0 staring group 2 rack 1 starting group 2 02A1 02A2 rack 2 staring group 2 rack 3 starting group 0 02A3 channel A example scan list 02A4 rack 4 staring group 0 rack 5 starting group 2 02A5 Each block represents 1 byte 02A6 rack 6 staring group 0 rack 7 starting group 4 02A7 See Figure 6 12 e up to as many e e as 64 bytes e Figure 6 11 Format of one entry in the I O adapter status word block 15 14 13 Pad reserved 6 25 Chapter 6 Operating in SV Superset Mode Format item Description Format item Description in scan list Contains one of these values group faulted Contains one
92. canner states L Use the scanner management commands Check indicators L Power up the scanner Program block transfers LI Check scanner states Communicate with PLC 5 adapters Check error codes 1 Other suggestions chap 4 Communicating with Remote I O chap 1 chap 2 chap 3 Scanner Overview Installing the Scanner Addressing I O CL VMEbus relationship Set the switches L Choose the addressing mode Select remote I O devices L How the scanner scans Ground the chassis L1 Address block transfer modules Design the remote I O link L1 Operating modes L Insert the scanner L Assign racks LI Specify the scan list Determine the power requirements L Connect to remote I O chap 5 Operating in SV Compatible Mode 1 Address global RAM LJ Command summary chap 6 Operating in SV Superset Mode L Address global RAM L Command summary How will the scanner operate chap 7 chap 8 chap 9 Starting the Scanner Programming the Scanner Troubleshooting 1 Understand the scanner states L Use the scanner management commands Check indicators L Power up the scanner Program block transfers LI Check scanner states Communicate with PLC 5 adapters Check error codes 1 Other suggestions chap 4 Communicating with Remote I O chap 1 chap 2 chap 3 Scanner Overview Installing the Scanner Addressing I O CL VMEbus relationship Set the switches L C
93. command should include these tasks 1 2 3 4 tn get the semaphore set up the control status area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt check the result clear the semaphore Chapter 6 Operating in SV Superset Mode SCAN LIST command byte 11 description SCAN LIST replaces the current scan list The scanner must be in Program mode You can issue a SCAN LIST command without first issuing an AUTOCONFIGURE command iene Name cm 00H returned means the command was 0202 not used confirmation A successful Any other value indicates an error 0204 not used 0205 command 11H is both sent and returned 0206 not used channel A control status 021B 021D 021C not used semaphore Bit 7 semaphore 021F scan list number of entries 0 64 021E not used length in the scan list 0220 lt 1 byte per adapter you can enter the same adapter scan list multiple times channel A as many as 64 bytes see Figure 6 5 general data 025F 0260 not used 02FF parameters The VME master processor writes 11 hex to the command byte Then the VME master processor writes these parameters to the selected channel s general data area Byte Parameter Description offset 021F scan list length The scan list length indicates the number of entries 0 64 in the scan list The scan li
94. connector fit firmly into the connector on the backplane Tighten the screws on the top and bottom of the front panel to prevent the scanner from loosening WEA N Determining Power Supply The scanner operates on 5V dc 2 3A typical 2 5A maximum Requirements 2 7 Chapter 2 Installing the Scanner 2 8 Connecting to the Remote I O Link Each scanner channel supports as many as 32 physical adapters Use 1770 CD or Belden 9463 cable Connect a remote I O network using a daisy chain or trunkline dropline configuration Table 2 B Total number of devices the scanner supports In this mode the maximum number and the maximum of logical racks per number of physical channel is adapters per channel is SV compatible 8 16 SV superset 16 32 Important The maximum cable length for remote I O depends on the transmission rate Configure all devices on a remote I O link to communicate at the same transmission rate Table 2 C Choose the correct cable length based on the link s communication rate A remote I O link using this cannot exceed this communication rate cable length 57 6 kbps 3 048 m 10 000 ft 115 2 kbps 1 524 m 5 000 ft 230 4 kbps 762 m 2 500 ft For proper operation terminate both ends of a remote I O link by using external resistors See Table 2 D for information on whether to use a 150 2 or 82 terminator Chapter 2 Installing the Scanner
95. continuous block transfer operations each remote I O channel supports as many as 16 racks of remote I O configurable scan rate at 57 6 115 2 or 230 4 kbps VME interrupt signals change in the scanner input table Chapter 1 Scanner Overview Figure 1 1 System connection overview VAX computer HP 9000 computer O O Ethernet network 6008 SV2R VME CPU Y Vision VME CPU p OO PDA UE D A CIC OOO I Cd aue o 2 5 Ere i Oo i co ai lt Data gt VME chassis Sal iyo Ho co L3 II TAI remote I O remote I O channel B channel A Ethernet PanelView i 1336 drive Bee baad H Wa 3 LITERE PLC 5 processor Q T GR H E S D Flex I O e S E chassis with 1771 ASB Note The 6008 SV1R scan
96. correct value for the length of data words The value for the length of data words must equal the number of words the I O module expects to transfer If these two values are not the same the transfer will never happen The best way to avoid a block transfer timeout is to give the scanner a transfer length of zero This lets the I O module decide how many words to send When the transfer completes the I O modules replaces the 0 in the length of data words with the actual number of how many words were transferred Using This Chapter Addressing Global RAM Operating in SV Compatible Mode The SV compatible mode supports these features each channel supports as many as 8 logical racks 16 physical adapters the global data area is 1872 words long using the SETUP command you can enable or disable the VME master processor watchdog timer change the timeout interval of the watchdog timer select the command complete interrupt level and status ID select whether to monitor SYSFAIL conditions and select a communication rate of 57 6 or 115 2 kbps Use this mode if you are replacing a 6008 SV scanner and want the 6008 SV1R or 6008SV2R scanner to operate exactly as the scanner you are replacing Your programs for the 6008 SV scanner work for the 6008 SV1R or 6008 SV2R scanner However you need to change any reference in your application to the VME ID for the 6008 SV scanner to the VME ID for the 6008 SV1R or 6008 SV2R scanner Importan
97. d i Confirmation Status Word m Command Word Address Word The scanner writes a BI Tag Word Sn Ton ds word e See chapters 5 or 6 BT n e e During the adapter scan the scanner polls each adapter in the scan list If a block transfer is pending for that adapter the scanner sends a block transfer request to the adapter The scanner doesn t receive or send the block data until the next scan The scanner transmits only one block transfer request per adapter per scan input output e 1771 1 O modules modules chassis n n scan n adapter n scanner gt BT n 4 10 Chapter 4 Communicating with Remote I O Figure 4 7 Block transfer sequence receiving data from a completed transfer On the previous adapter scan the scanner sent a block transfer request During this scan the adapter returns the response data to the scanner input output 1771 1 0 modules modules scann 1 chassis PE ces coe The scanner adapter 1 tests and sets the semaphore iin p 2 places the block transfer data in the general data area 3 places a completion code in the confirmation area 4 provides the proper block transfer tag number 5 generates a VME interrupt optional L5 gt BT BT n scanner data BT data scanner s global RAM BT n The application program must move the block transfer BT data out
98. d not complete within 4 seconds and slot specified was aborted 2 Make sure the chassis holding the module is turned on 3 Make sure the adapter is in the scan list 4 Make sure the scanner is not in the program mode 5 Check the length of data value to make sure it matches the module or make the value zero 6 Check the manual for the module in use 25 2E 1 0 link error A failure occurred in the transfer of 1 Check the block transfer hardware configuration 30 43 information between the I O module and the scanner An application program cannot cause these errors 2 Eliminate electrical noise that may interfere with because they are associated with the communication remote I O communication protocol on the I O link 3 Use 57 6 kbps instead of 115 2 kpbs 4 Ensure proper grounding of your I O racks 5 Consult the factory and or replace the block transfer module 6 An error occurred within the scanner Try cycling power before removing the scanner 2F Block transfer accepted The block transfer was none accepted by the scanner and is now in the scanner s queue 9 3 Chapter 9 Troubleshooting Code Significance Corrective Action hex 90 Ready confirmation Used only when the scanner none module is turned on and shows that the scanner has passed its self tests 91 SYSFAIL SYSFAIL has been asserted on Remove the card that is asserting SYSFAIL on the the VMEbus VMEbus Reset the scanner with the RE
99. de The scanner processes single block transfer operations and continuous block transfer operations The single block transfer operations work the same as in SV compatible mode The only difference is that the scanner can only queue one request from the VME master processor Use continuous block transfer requests for applications that need to continuously poll an adapter The continuous block transfer requests uses less overhead than programming a single block transfer request each time you need the data For specifics on block transfers based on VME operating mode see chapter 5 or 6 for SV compatible or SV superset mode respectively Understanding the Block Transfer Sequence The VME master processor and scanner alternately access the scanner s global RAM while transferring a block transfer See Figure 4 6 and Figure 4 7 4 9 Chapter 4 Communicating with Remote I O Figure 4 6 Block transfer sequence sending a request The VME master processor sends a o BT WRITE request to scanner VME master Bn processor The scanner copies the request parameters and data into its internal queue In SV compatible mode the scanner can queue as many as 42 block transfer requests in SV superset mode the scanner can queue Only one block transfer request i queue scanner Output Image Table PIS Input Image Table Operating Status Wor
100. dule would conflict with the block transfer module e You cannot use 32 point I O modules 1 slot One I O module slot 1 group e Each physical slot in the chassis corresponds to one word 16 bits in the input image table and one word 16 bits in the output image table e When you use 32 point I O modules you must install as a pair an input module and an output module in an even odd pair of adjacent I O group if you use an input module in slot 0 you must use an output module in slot 1 or it must be empty This configuration gives you the maximum use of I O Use any mix of 8 and 16 point I O modules block transfer or intelligent modules in a single I O chassis Using 8 point modules results in fewer total 1 0 1 2 slot e One half of an I O module slot 1 group e Each physical slot in the chassis corresponds to two words 32 bits in the input image table and two words 32 bits in the output image table Use any mix of 8 16 and 32 point I O or block transfer and intelligent modules Using 8 point and 16 point I O modules results in fewer total I O Addressing Block Transfer Block transfer modules occupy 8 bits in the I O image table Since all Modules block transfer modules are bidirectional they cannot be used to complement either input or output modules To address use the single slot modules assigned I O rack and group number of the slot in which the module resides and 0 for the module number When using 1 2 slot
101. e is that if an operator temporarily pulled the swing arm from an adapter the scanner would lose communications with that adapter Maybe the operator could quickly put it back and the status LED and the adapter fault bit bit 6 would say everything is working properly but the adapter fault change bit would be left set indicating that an adapter was temporarily off line A VME master processor can issue the LINK STATUS command to make sure the I O link and all adapters are operating properly upon seeing this bit set Only the scanner can set this bit The VME master processor must clear it 6 6 Chapter 6 Operating in SV Superset Mode Command Summary The SV superset mode of the scanner supports these commands If you want to Use this command With this The scanner must See page command byte be in this hex programming mode set the baud rate watchdog rate VMEbus interrupt level how SETUP 13 program 6 8 the scanner responds to SYSFAIL command complete interrupt and the input image table interrupt establish a default scan list and provide status of the I O AUTOCONFIGURE 10 program 6 11 system to the VME master processor establish your own scan list SCAN LIST 11 program 6 15 establish a fault dependent group structure FAULT DEPENDENT GROUP 12 program 6 18 change the operating mode of the scanner SET MODE 20 program 6 21 test run check adapter status and the scan list without affecting LINK STA
102. e of these values hex baud rate o1 57 6 kbps default e 00 SYSFAIL monitor enabled default 02 115 2 kbps iic 01 SYSFAIL monitor disabled 03 230 4 kbps FF no change FF no change Values 02 FE are reserved If you write a reserved Values 00 04 FE are reserved If you write a value to this field the scanner writes error 11H in reserved value to this field the scanner writes error the confirmation status byte 11H in the confirmation status byte 0221 master Write one of these values hex 0227 inputimage Write one of these values hex E 500 ms default table 01 leveli 05 level 5 watchdog o4 FE valuex100 ms 1000 25400ms dad 02 level2 06 level 6 timeout FF no change dedo 03 level3 07 level7 Values 01 09 are reserved If you write a reserved 04 level 4 default value to this field the scanner writes error 11H in Values outside the range 01 07 are reserved If the confirmation status byte you write a reserved value to this field the scanner writes error 11H in the confirmation status byte 0222 master Write one of these values hex 0228 inputimage The VME master processor writes an 8 bit value processor gy disable watchdog timer table here that the scanner will pass to the VME interrupt watchdog 00 enable watchdog timer default monitor handler in response to an input image table monitor disable 02 FF interrupt interrupt The default value is 42H status ID Disable the watchdog timer when you want to run a master
103. e the requests from the VME master processor TEST when the scanner in PROGRAM or RUN state receives a SET MODE command In the TEST state e the scanner sends output information to the adapters all module outputs are held reset off discrete input information is updated e the scanner sends block transfer requests to the adapters but actual outputs are held reset off RUN when the scanner in PROGRAM or TEST state receives a SET MODE command In the RUN state e the scanner sends output information to the adapters e input information is updated e the scanner sends block transfer requests to the adapters all outputs are allowed to energize SYSFAIL when the VME SYSFAIL monitor is enabled and SYSFAIL is asserted In the SYSFAIL state the scanner places a failure code in the confirmation status word lights the Fault indicator and enters a program loop waiting for a RESET command The scanner ignores all other commands or interrupts from VME processors and ignores all packets from the I O link When the scanner receives a RESET command it enters the POST state 7 3 Chapter 7 Starting the Scanner Powering Up the Scanner 7 4 You only power up the scanner after you ve installed the scanner or when you are trying to recover from a faulted state When you power up the scanner the scanner does a self test POST state If the self test is successful the scanner moves into the SL
104. el Byte Parameter Description offset 0207 continuous block transfer address The module address is the address of the I O module that is to receive the block data It contains the rack 0 15 group 0 7 and slot 0 or 1 numbers of the I O module See Figure 6 17 on page 6 43 0209 continuous block transfer tag The VME master processor writes a number 0 15 that is an index into the continuous block transfer write table Only the lower byte is used 020A continuous block transfer Specifies the VME status ID used when the block transfer is completed See status ID Figure 6 18 on page 6 43 020B continuous block transfer Specifies the VME interrupt level used when the block transfer is completed See interrupt level Figure 6 18 on page 6 43 021F continuous block transfer The VME master processor writes the number of words of continuous length of data block transfer data 0 64 Use the value 0 to let the I O module determine how many words the scanner can write When the block transfer completes the 0 is replaced by the actual number of words written 0301 continuous block transfer tag configure this parameter at byte offset 0209 see above READ ONLY 0303 continuous block transfer address configure this parameter at byte offset 0207 see above READ ONLY 0305 length of data configure this parameter at byte offset 021F see above READ ONLY 0306 continuous block transfer configure this parameter at by
105. en a bit is set to 1 the corresponding output turns on block transfer transfer of data between an intelligent I O module and a scanner A block transfer sends as many as 64 words of data at a time general data area designated area of global VME memory existing within the scanner that is used to pass information between the scanner and a VME master processor Scanner commands are processed in this data area global RAM an area of global VME memory in the scanner that can be accessed by both the scanner and the VME master processor s This area of memory is the key means for communication between the scanner and the VME master semaphore bit bit that indicates whether part of the global RAM the general data area is being used Typically this bit is used to prevent multiple masters or the scanner from writing to the general data area simultaneously scan list list that the scanner maintains internally to determine the I O racks that it is to scan and the order in which it is to scan them You create the scan list using the AUTOCONFIGURE command or the SCAN LIST command p ii Using This Chapter Introduction Scanner Overview This chapter provides an overview of the scanner This chapter describes how the scanner relates to the VMEbus and to the remote I O link If you want to read about go to page introduction 1 1 VMEbus relationship 1 4 how the scanner scans 1 6
106. en detected 9 1 Chapter 9 Troubleshooting A B OO channel status B green red Note channel B is on the 6008 SV2R scanner only Error Codes 9 2 Table 9 B Significance of channel status indicators When the status indicator is the scanner off is off line green is on line in run mode and scanning the racks in the scan list blinking green is on line in run mode and scanning only some of the racks in the scan list red has an unrecoverable fault blinking red has a recoverable fault Table 9 C lists the error codes the scanner can write to the confirmation status word in the control status area for a scanner channel The error code uses the lower byte of the confirmation status word The scanner cannot generate any error codes that are not listed below If an error code shows up in the confirmation status word that is not listed here it is likely that another VME master processor accidentally wrote a value into that word Table 9 C Error Codes Code Significance Corrective Action hex 00 Successful command none 01 Unspecified error The error is unknown and indicates Consult the factory and or replace the scanner board serious scanner malfunction 10 Unknown command The VME master processor put Use a valid command code an unknown command in the command field 11 Illegal command The VME master processor issued a Check the
107. es quo G4 bytes Chapter 5 Operating in SV Compatible Mode 5 30 parameters There are no parameters for the RESET command Before the scanner executes the RESET command the VME master processor writes these parameters to the last 2 words of the selected channels general data area Byte Parameter Description offset FBC second to last word in the selected Write the value 0080 hex to this word channel s general data area FBE last word in the selected channel s Write the value AOAO hex to this word general data area coding sequence Your code for the RESET command needs to write the above words to byte offsets FBC and FBE Using This Chapter Addressing Global RAM Operating in SV Superset Mode The SV superset mode provides these features in addition to those supported by the SV compatible mode each channel supports as many as 16 logical racks per channel 32 physical adapters the SV compatible mode supports as many as 8 logical racks per channel 16 physical adapters the global data area is 224 bytes long you can configure the scanner to interrupt the VME master processor when the scanner detects a change in a specified range of input image table the scanner also provides the offset for the first changed data the scanner supports continuous block transfers and each channel has a table for continuous block transfer read data and a table for continuous block transfer write da
108. fy the scan list Determine the power requirements L Connect to remote I O chap 5 Operating in SV Compatible Mode 1 Address global RAM LJ Command summary chap 6 Operating in SV Superset Mode L Address global RAM L Command summary How will the scanner operate chap 7 chap 8 chap 9 Starting the Scanner Programming the Scanner Troubleshooting 1 Understand the scanner states L Use the scanner management commands Check indicators L Power up the scanner Program block transfers LI Check scanner states Communicate with PLC 5 adapters Check error codes 1 Other suggestions chap 4 Communicating with Remote I O chap 1 chap 2 chap 3 Scanner Overview Installing the Scanner Addressing I O CL VMEbus relationship Set the switches L Choose the addressing mode Select remote I O devices L How the scanner scans Ground the chassis L1 Address block transfer modules Design the remote I O link L1 Operating modes L Insert the scanner L Assign racks LI Specify the scan list Determine the power requirements L Connect to remote I O chap 5 Operating in SV Compatible Mode 1 Address global RAM LJ Command summary chap 6 Operating in SV Superset Mode L Address global RAM L Command summary How will the scanner operate chap 7 chap 8 chap 9 Starting the Scanner Programming the Scanner Troubleshooting 1 Understand the s
109. gned short far rval unsigned short far wordptr unsigned offset rack 8 iogrp map channel amp establish pointers map_channel chan wordptr unsigned short far chan gt InputTable wordptr offset read the word rval wordptr unmap the channel unmap_channel chan return 8 35 Chapter 8 Programming the Scanner WRITE OUTPUT WORD write to selected output image table entry Xx This routine writes the specified entry in the discrete output table with the EA given value Cu parameters pointer to channel structure eR target rack number AUN target IO group word 0 7 TX word value to write XE return values none void write output word channel far chan int rack int iogrp unsigned short wval unsigned short far wordptr unsigned offset rack 8 iogrp map the channel amp establish pointers map channel chan wordptr unsigned short far chan OutputTable wordptr offset write the word wordptr wval unmap the channel unmap channel chan return k ONESHOT BT COMPLETE process a completed one shot block transfer k KW This function should be called when it is known that a one shot block transfer has XE completed This is typically signalled via a VME interrupt The routine will FA access the channel s Contr
110. hap 4 Communicating with Remote I O chap 1 chap 2 chap 3 Scanner Overview Installing the Scanner Addressing 1 0 CL VMEbus relationship Set the switches L Choose the addressing mode Select remote I O devices L How the scanner scans Ground the chassis LJ Address block transfer modules Design the remote I O link L1 Operating modes L Insert the scanner L Assign racks LI Specify the scan list Determine the power requirements L Connect to remote I O chap 5 Operating in SV Compatible Mode 1 Address global RAM LJ Command summary chap 6 Operating in SV Superset Mode L Address global RAM L Command summary How will the scanner operate chap 7 chap 8 chap 9 Starting the Scanner Programming the Scanner Troubleshooting 1 Understand the scanner states L Use the scanner management commands Check indicators L Power up the scanner Program block transfers LI Check scanner states Communicate with PLC 5 adapters Check error codes 1 Other suggestions chap 4 Communicating with Remote I O chap 1 chap 2 chap 3 Scanner Overview Installing the Scanner Addressing I O CL VMEbus relationship Set the switches L Choose the addressing mode Select remote I O devices L How the scanner scans Ground the chassis L1 Address block transfer modules Design the remote I O link L1 Operating modes L Insert the scanner L Assign racks LI Speci
111. he actual hardware configuration except for racks that have their global rack inhibit bit set In this case the global rack bit overrides the automatic configuration Discrete I O devices include such external devices as switches relay contacts indicator lights control relays motor starters A scanner channel exchanges discrete data digital and analog with remote I O node adapters like 1771 ASB modules via the scanner I O image table Figure 4 3 Figure 4 3 Remote I O scan 3 Rack 3 8 amp e data exchange yy Rack2 s gt scanner _ master qu o0 3 VO table processor Rack 1 8 e The remote I O scan is the time it takes for the scanner to communicate with all of the entries in its scan list once Chapter 4 Communicating with Remote I O Important The remote I O scan for one channel is independent of and asynchronous to the remote I O scan for the other channel The status of the discrete devices is represented by a single bit in an input or output group word The scanner is related to these devices as shown in Figure 4 4 Figure 4 4 The Relationship between the scanner and I O VMEbus Subrack VMEbus backplane gt input output VME 1771 1 0 modules modules master chassis processor 1 sca
112. heck error codes Other suggestions Numbers 6008 SV comparison to 1 8 A ACFAIL 1 5 adapter scan 4 13 address modifier codes _1 6 addressing I O assigning racks 3 7 block transfer modules 3 6 choosing mode 3 3 concept 3 1 summary 3 6 assigning racks 3 7 Audience _p i AUTOCONFIGURE programming example 8 5 SV compatible 5 9 SV superset 6 11 block transfer adapter scan 4 13 addressing 3 6 block integrity 4 13 multiple 4 12 processing 4 8 programming examples 8 34 sequence 4 9 timeout 4 14 BT READ programming example 8 13 SV compatible 5 25 SV superset 6 28 BT WRITE programming example 8 13 SV compatible 5 27 SV superset 6 32 C cable length 2 8 4 4 cables remote I O 4 4 command summary SV compatible 5 6 SV superset 6 7 Index comparison to 6008 SV 1 8 completed command 8 2 connecting remote I O link 2 8 CONTINUOUS BT READ programming example 8 15 SV superset 6 36 CONTINUOUS BT WRITE programming example 8 15 SV superset 6 40 Conventions p ii D data integrity 8 1 DEAD state 7 2 design guidelines remote I O link 4 3 E enabling channel B 2 4 environmental specifications _A 1 error codes 9 2 examples programming 7 1 8 1 sample command sequence 7 8 starting 7 1 waking up the scanner 7 5 F FAULT DEPENDENT GROUP programming example 8 8 SV compatible 5 16 SV superset 6 18 FAULTED state 7 2 G
113. hen you configure the adapter channel Important Adapter mode block transfer reads and writes in the same group module location must have the same length Affects of block transfers on direct transfers You can have as many as 15 writes and 15 reads Each block transfer to a particular group module location uses the I O addresses for that rack group for status bits These locations are lost to direct transfer Therefore if you configure all available 15 block transfer read write pairs no bits will be available for direct transfer Do not program a block transfer to group 0 module 1 because this area of the direct transfer configuration file is used for communication status exchanges between the scanner and the adapter mode processor Using This Chapter Indicators VMEBus 1 0 Scanner CO pwr power green BPLN com RT VMEbus backplane communication l green fault red Troubleshooting If you want to read about go to page indicators 9 1 error codes 9 2 troubleshooting suggestions 9 4 Table 9 A Significance of scanner indicators When this indicator is it means PWR illuminated power is applied to the module power green LED BPLN COM illuminated for a VMEbus access is made to the backplane communication approximately a scanner board green LED half second FLT illuminated the scanner board is reset fault performing a self test or a fault red LED has be
114. hoose the addressing mode Select remote I O devices L How the scanner scans Ground the chassis L1 Address block transfer modules Design the remote I O link L1 Operating modes L Insert the scanner L Assign racks LI Specify the scan list Determine the power requirements L Connect to remote I O chap 5 Operating in SV Compatible Mode 1 Address global RAM LJ Command summary chap 6 Operating in SV Superset Mode L Address global RAM L Command summary How will the scanner operate chap 7 chap 8 chap 9 Starting the Scanner Programming the Scanner Troubleshooting d Understand the scanner states 1 Use the scanner management commands Check indicators Power up the scanner Program block transfers LI Check scanner states Communicate with PLC 5 adapters Check error codes 1 Other suggestions chap 4 Communicating with Remote I O chap 1 chap 2 chap 3 Scanner Overview Installing the Scanner Addressing I O CL VMEbus relationship Set the switches L Choose the addressing mode Select remote I O devices L How the scanner scans Ground the chassis L1 Address block transfer modules Design the remote I O link L1 Operating modes L Insert the scanner L Assign racks LI Specify the scan list Determine the power requirements L Connect to remote I O chap 5 Operating in SV Compatible Mode 1 Address global RAM LJ Command summary chap
115. if wait for cmdcmpl chan FALS clear the semaphore unlock gda chan unmap channel chan fprintf stdout setmode wait failure lock cleared return 2 Eu clear the semaphore amp unmap the channel res csa gt cnfstat unlock_gda chan unmap channel chan return int res 8 10 Chapter 8 Programming the Scanner LINK STATUS command k k LINKSTATUS get 6008 SV2 channel link status KE E This function executes a LINK STATUS command The results of the LINK STATUS are AX placed in the link_config structure provided by the caller k k KS parameters pointer to channel structure ok pointer to link config structure ok return values 1 unable to lock general data area semaphore EK 2 did not get cmd complete interrupt OR ELSE channel confirmation status word k k A Note that if the confirmation status word is not 0000H the contents of the KE link_config structure passed by the caller are NOT defined k k int linkstatus channel far chan link_config far linkcfg csa_data far osas unsigned short far gda unsigned char far scanlist unsigned short ioaswblk size unsigned short res unsigned short 3 map channel amp establish pointers map channel chan csa csa data far chan ControlStatusArea gda unsigned short far chan gt GeneralDataArea determine I O Adapter Status Word block size
116. information see the VMEbus specification revision C 1 published by VITA VMEbus International Trade Association 10229 N Scottsdale Rd Suite B Scottsdale AZ 85253 602 951 8866 Contact a VITA representative for a copy VMEbus Address Modifier Codes The scanner can respond to the following VMEbus address modifier codes depending on how you configure the scanner s address space and response to VME accesses This code means hex 3D standard A24 supervisory access 39 standard A24 non privileged access 2D short A16 supervisory access 29 short A16 non privileged access The scanner runs asynchronously to other VME master processors Once in Run mode the scanner continuously scans all the adapters in its scan list The scan list identifies which adapters to scan and in what order to scan them An adapter can appear several times in the scan list For more information about using the scan list see chapter 4 When the scanner scans an adapter it brings in digital input data and places the data in the scanner s input image table At the same time the scanner sends digital output data to the adapter Chapter 1 Scanner Overview remote I O system
117. ing any value to the scanner s ID area which moves the scanner from sleep mode to program mode Chapter 7 explains how to wake up the scanner Chapter 8 provides additional programming examples 5 6 Chapter 5 Operating in SV Compatible Mode SETUP command byte 13 description SETUP configures the scanner The scanner must be in Program mode to execute this command This is normally the first command sent to the scanner Byte offset Hex Name ie OOH returned means the command was 102 not used confirmation Successful Any other value indicates an error 105 104 not used command 13H is both sent and returned 106 not used channel A control status 11B 11D 11C not used semaphore Bit 7 semaphore 11E not used 01 57 6 kbps default 120 121 watchdog 00 __ 500 ms default 02 115 2 kbps 120 baud rate timeout lt 4 0A FE value x 100 ms 1000 25400ms FF no change eM FF no change watchdog complete 07 i 01 disable watchdog 122 disable interrupt level 01 07 command complete interrupt level A dn 124 complete 25 complete 00 interrupt enabled 00 FF command 124 status ID interrupt enable 01 interrupt disabled FEN complete status ID FF no change 126 5 SYSFAIL not used general data 00 SYSFAIL monitor monitor enabled 01 SYSFAIL monitor disabled es nou ped FF no change FBF 5 7
118. ir self tests In this case the scanner will light the FLT LED and go into the FAULTED state And because the scanner is faulted it asserts SYSFAIL You can RESET the scanner with the RESET command kx WAKI kx kx kx xx kx k k A void wakeup Chapter 7 Starting the Scanner Waking Up the Scanner Only a VME master processor can wake up the scanner The VME master wakes up the scanner by interrupting the scanner writing any value to the scanner s ID area The scanner responds to the interrupt by moving to the PROGRAM state As soon as the scanner receives the first command usually a SETUP command the operating status byte gets set to 0x01 and the scanner starts the VME master processor watchdog timer The scanner must receive a valid command at least every 500 msec or the scanner will reset itself You can adjust this time value by using the SETUP command The following example function shows one way to wake up the scanner EUP wake up the 6008 SV2 When the 6008 SV2 is first powered up it enters the SLEEP state Writing a scratch value to the VME ID Area will assert a local interrupt on the scanner transitioning it from the SLEEP state to the PROGRAM state I parameters pointer to channel structure return value none channel far chan csa data far csa map the channel amp establish pointers map channel chan csa csa_data fa
119. item Description in scan list Contains one of these values group faulted Contains one of these values bit 12 1 adapter is in the current scan list bit 7 1 fault exists in the fault dependent group 0 adapter not in current scan list associated with the adapter 0 no fault exists in the fault dependent group associated with the adapter adapter attached Contains one of these values line status Contains one of these values hex bit 11 1 adapter resides at this address bit 6 4 000 adapter is off line 0 no adapter resides at this address any other adapter is on line value valid configuration Contains one of these values in fault dependent Contains one of these values bit 10 1 adapter type size and address are valid Ned 1 adapter is in the fault dependent group 0 adapter type size and or address not identified by the fault dependent group valid adapter is improperly configured number bits 2 0 0 adapter is not in a fault dependent group adapter size Contains one of these values hex fault dependent The value 0 7 binary identifies the fault bits 9 8 group number dependent group to which this adapter belongs 00 1 4 rack addressing 01 1 2 rack addressing 10 3 4 rack addressing 11 full rack addressing bits 2 0 5 23 Chapter 5 Operating in SV Compatible Mode 5 24 Figure 5 12 Format for one entry in the scan list e b e Q Format item Description rack number
120. lable because it is Q S SIS being used by the input module of group 0 installing a 32 point output S S S module makes use of output image table of group 0 and 1 See Sis S You can also install 8 or 16 point output modules But you cannot S Q SS install another input module since all the input image space for groups S S mj 0 and 1 is used by the input module of group 0 e 8 0 qr p m Group 0 Group 1 3 5 Chapter 3 Addressing I O When planning your system design consider the densities of the I O modules you are using and choose an addressing mode that most efficiently uses processor memory Choose the addressing mode for each I O chassis by setting the chassis backplane switch assembly Addressing Summary Addressing Guidelines Mode 2 slot e Two I O module slots 1 group e Each physical 2 slot I O group corresponds to one word 16 bits in the input image table and one word 16 bits in the output image table e When you use 16 point I O modules you must install as a pair an input module and an output module in an I O group if you use an input module in slot 0 you must use an output module in slot 1 or it must be empty This configuration gives you the maximum use of I O e You cannot use a block transfer module and a 16 point module in the same I O group because block transfer modules use 8 bits in both the input and output table Therefore 8 bits of the 16 point mo
121. le channel A 109 3 control status 108 not used BT tag 00 41 unique number transfer 10A not used 11B 11D 11C not used semaphore Bit 7 semaphore B length of 0 64 number of words to read ME not used Visa s from the I O module 120 BT read data returned as many as 64 words channel A general data length 1 length FBF not used 5 25 Chapter 5 Operating in SV Compatible Mode parameters The VME master processor writes 01 hex to the command byte Then the VME master processor writes these parameters to the selected channel s control status area Byte Parameter Description offset 107 module address The module address is the address of the I O module from which to read the block data It contains the rack 0 15 group 0 7 and slot 0 or 1 numbers of the I O module See Figure 5 13 109 block transfer tag number The block transfer tag number is an 8 bit integer that uniquely identifies each block transfer The scanner writes a value 0 41 to the block transfer request tag number in the control status area Values greater than 41 are reserved If you write a reserved value to this field the scanner writes an illegal confirmation error 16 in the confirmation status byte This tag is returned with the status when the block transfer is complete so the VME master processor can match the block transfer status with the request 11F length of data The
122. length of data byte is an 8 bit value that specifies the number of 16 bit words 0 64 decimal to be read from the target I O module Use the value 0 to let the I O module determine how many words the scanner can read When the block transfer completes the 0 is replaced by the actual number of words read Values greater than 64 are reserved If you write a reserved value to this field the scanner writes an illegal confirmation error 16 in the confirmation status byte 120 BT data The BT data is the set of data words 0 64 read from the target I O module The BT data block ends at offset length of data 1 Figure 5 13 Structure of the address byte 0 terminals 00 07 1 terminals 10 17 coding sequence Your code for the BT READ command should include these tasks 1 get the semaphore 2 set up the control status area 3 send the command interrupt 4 wait for the result either poll for confirmation status or wait for an interrupt 5 clear the semaphore 5 26 Chapter 5 Operating in SV Compatible Mode BT WRITE command byte 02 description BT WRITE transfers a block of data from the scanner to the specified T O module Upon issuing a block transfer request the scanner writes Ox2F in the confirmation status byte to indicate that the scanner accepted the request and put it into its queue When the scanner actually completes the block transfer the scanner sets the semaphore
123. lt dependent group blocks see Figure 5 8 and Figure 5 9 channel A 32 bytes general data 13F 140 not used FBF parameters The VME master processor writes 12 hex to the command byte Then the VME master processor writes these parameters to the selected channel s general data area Byte Parameter Description offset 120 fault dependent group block There are 4 configurable bits for each starting group entry An adapter must be in the current scan list to be assigned to a fault dependent group If you specify an adapter that is not in the scan list the scanner writes an illegal configuration error 16H to the confirmation status byte See Figure 5 8 and Figure 5 9 5 16 Chapter 5 Operating in SV Compatible Mode Figure 5 8 Format of the fault dependent group block Byte Byte offset offset 120 121 starting group 0 starting group 2 rack 0 12g starting group 4 starting group 6 1s Ten starting group 0 starting group 2 ies rack 1 s starting group 4 starting group 6 vr m starting group 0 starting group 2 189 rack 2 12A starting group 4 starting group 6 12B e e e e e e 13C i 13D starting group 0 starting group 2 13E 13F rack 7 starting group 4 starting group 6 Each block represents 1 byte There is 1 byte for each starting group for each adapter Only those bytes representing starting groups of existing racks should contain the data described in Fig
124. lue none lock gda channel far chan kx csa_data far csaptr int res map channel amp establish pointers map_channel chan csaptr csa_data far chan gt ControlStatusArea attempt to lock the semaphore res sv2 lock unsigned short far amp csaptr semaphore unmap channel amp return unmap channel chan return res UNLOCK GDA unlock a channel s General Data Area kx kx kx k k kx AZ void This function unlocks a channel s general data area semaphore parameters pointer to channel struct return value none unlock_gda channel far chan 8 24 csa_data far csa map channel amp establish pointers map channel chan csa csa data far chan ControlStatusArea clear the semaphore bit csa gt semaphore amp unsigned short SEMAPHORE unmap the channel unmap_channel chan return Chapter 8 Programming the Scanner k k LOCK_CONBT_ENTRY lock the data buffer of a Continuous Block Transfer Table Entry k k KE The function busy waits on the entry s turn amp sv2 flag fields using the standard EE Peterson s Solution method k k ok parameters pointer to the Continuous BT Table entry ok return value always success 0 k k T int lock conbt entry btentry far entry entry vmp flag 1 entry gt turn_flag 1 g while entr
125. manufacture and support a broad range of Allen Bradley control and automation products worldwide They include logic processors power and motion control devices man machine interfaces sensors and a variety of software Rockwell is one of the world s leading technology companies fay CECINA CA Worldwide representation X o0 a NE i Algeria Argentina e Australia e Austria e Bahrain e Belgium e Brazil e Bulgaria e Canada e Chile e China PRC Colombia e Costa Rica e Croatia e Cyprus e Czech Republic Denmark e Ecuador e Egypt e El Salvador e Finland e France e Germany e Greece e Guatemala e Honduras e Hong Kong e Hungary Iceland e India Indonesia e Israel e Italy Jamaica e Japan e Jordan e Korea e Kuwait e Lebanon e Malaysia e Mexico e New Zealand e Norway e Oman e Pakistan e Peru e Philippines e Poland e Portugal e Puerto Rico Qatar e Romania e Russia CIS e Saudi Arabia e Singapore e Slovakia e Slovenia e South Africa Republic e Spain e Switzerland e Taiwan e Thailand e The Netherlands e Turkey United Arab Emirates e United Kingdom e United States e Uruguay e Venezuela e Yugoslavia Allen Bradley Headquarters 1201 South Second Street Milwaukee WI 53204 USA Tel 1 414 382 2000 Fax 1 414 382 4444 Publication 6008 6 5 11 September 1995 Supersedes Publication 6008 6 5 2 August 1990 PN 955119 08 Copyright 1995 Allen Bradley Company Inc
126. n list Byte Byte offset offset 0220 rack 0 starting group 0 0221 0222 rack 0 starting group 2 0223 0224 rack 0 starting group 4 0225 0226 rack 0 starting group 6 0227 channel A adapter status words 0228 rack 1 starting group 0 0229 dnd Each block represents 1 word Only those words representing starting groups of 022A rack 1 starting group 2 022B existing racks should contain the data described in Figure 6 4 029C rack 15 starting group 4 029D 029E rack 15 starting group 6 029F 02A0 rack 0 staring group 2 rack 1 starting group 2 02A1 02A2 rack 2 staring group 2 rack 3 starting group 0 02A3 channel A example scan list 02A4 rack 4 staring group 0 rack 5 starting group 2 02A5 Each block represents 1 byte 02A6 rack 6 staring group 0 rack 7 starting group 4 02A7 See Figure 6 5 e up to as many e e as 32 bytes e 6 12 Figure 6 4 Chapter 6 Operating in SV Superset Mode Format of one entry in the I O adapter status word block 15 14 13 reserved Format item Description Format item Description in scan list Contains one of these values group faulted Contains one of these values bit 12 1 adapter is in the current scan list bity 1 fault exists in the fault dependent group 0 adapter not in current scan list associated with the adapter 0 no fault exists in the fault dependent group associated
127. nbt entry entry 0 could not lock buffer unmap channel chan return 1 copy the data in or out if block cmd CMD CONBTREAD continuous BT read for i 0 i lt block gt datalen i block gt data i entry gt data i else continuous BT write for i 0 i lt block gt datalen i entry data i block data i unlock the table entry buffer unlock conbt entry entry unmap channel chan return 0 8 16 Chapter 8 Programming the Scanner RESET command K RESET soft reset a 6008 SV2 Ed This routine forces a 6008 SV2 into the RESET state ote that this affects BOTH Aw scanner channels Once the 6008 SV2 has been soft RESET each channel must be ER awakened by the wakeup routine and reconfigured K kd parameters pointer to channel structure OK return values none f void reset channel far chan unsigned short far wordptr map channel amp establish pointers map channel chan wordptr unsigned short far chan VmeIdArea write the VME ID AREA of scanner wordptr 0 0x0080 wordptr 1 0xA0A0 unmap the channel unmap channel chan return 8 17 Chapter 8 Programming the Scanner sample code for VMEbus operations kx BUS C Sample Code VME bus operations k k af include 6008sv2 h
128. nd 16 output bits x X X X X Input Image Table Word X V 7 4 16 bits input and 16 bits output x AIHA SLLLLL2 V A X 1 2 slot addressing 1 2 of an I O chassis slot 1 I O group 1 input image word and 1 output image word X 16 input bits and 16 output bits y p d 16 bits input and 16 bits output When you place your I O modules in the I O chassis slots the module s density determines how quickly I O groups form 3 3 Chapter 3 Addressing I O 8 and 16 point examples B A Input Input Lr n Input Terminals Terminals Terminals Q c O 00 00 00 01 01 de 01 02 02 dS HS 02 03 03 JS HS 03 04 04 JS S 04 05 05 JS JS 05 06 i S 06 07 x om 07 RH JEH Group 0 Group 2 Group 3 An 8 point I O module occupies 8 bits in a word See Two 8 point input modules occupy 8 bits of each group See
129. ner is interchangeable with the 6008 SV2R scanner except that the SV1R scanner supports only one channel of remote I O 6008 SV2R 6008 SV2R CO PWR BPLN com O FLT Ow Ox SERIES e Indicators lt power green VMEbus backplane communication green lt fault red Indicators channel status green red Channels lt remote I O channel A communication port factory enabled lt remote I O channel B communication port factory disabled Chapter 1 Scanner Overview Each scanner channel supports as many as 32 physical adapters 16 logical racks Figure 1 2 shows the front panels of the scanners Figure 1 2 Scanner front panel 6008 SV1R 9 6008 SV1R pwr BPLN O com Or Ges Table 1 A Significance of scanner indicators When this is it means indicator PWR illuminated power is applied to the power module green LED BPLN COM illuminated for a VMEbus access is made backplane approximately to the scanner board communication a half second green LED FLT illuminated the scanner board is reset fault performing a self test or a red LED fault has been detected Table 1 B Significance of channel status indicators When the status the scanner indicator is off is off line green is on line in Run mode and
130. nnel output table char far InputTable channel input table char far ControlStatusArea channel CSA char far GeneralDataArea channel general data area char far ConBTWTable continuous BT write table char far ConBTRTable continuous BT read table char far ResetArea reset area char far VmeIdArea VME ID interrupt area unsigned long stash bus manager context channel Control Status Area structure Ef typedef struct unsigned short opstat Operating Status Word unsigned short cnfstat Confirmation Status Word unsigned short cmd Command Word unsigned short addr Block Transfer Address Word unsigned short tag Block Transfer Tag Word unsigned short Lrg Block Transfer Interrupt Word unsigned short iitm IITM Index Word unsigned short res 7 reserved fields unsigned short semaphore Semaphore Word unsigned short datalen Length of Data Word csa data 8 30 Chapter 8 Programming the Scanner Setup Data Structure xf typedef struct unsigned char rio_baudrate RIO link baudrate unsigned char wdt_interval watchdog timer interval unsigned char wdt_enable watchdog timer enable unsigned char cmdcmpl irq level cmd complete IRQ level unsigned char cmdcmpl irq vector cmd complete IRQ vector unsigned char cmdcmpl irq enable cmd complete IRQ enable u
131. nner channel Um 0 adapter m l J motor starter __ _ pushbutton switch L o input output 1771l 0 modules modules remote chassis E i 1 0 link PLC 5 processor in adapter mode L operator interface terminal m Up to 13 more I O adapters 15989 An external device such as the switch shown above causes an input of a discrete input module to turn on This sets a bit to a 1 condition in the I O module The next time the I O adapter scans the module the new information is reported to the adapter When the scanner scans the adapter the corresponding bit in the I O image table is set to a condition that reflects the status of the external device the switch 4 7 Chapter 4 Communicating with Remote I O A VME master processor then reads the input image information from the global RAM via the VMEbus To generate an output a VME master processor sets a specific bit in the I O image table in the scanner s global RAM corresponding to the desired output device for example a control relay The scanner updates the adapter during the next scan cycle The adapter sets the appropriate bit in the output module and the discrete output device energizes the control relay Processing Block Data In addition to discrete data the scanner can also exchange block data with remote I O Block transfers are the communication of data blocks files between the scanner and intelligent I O modules These are any I O
132. nsigned char vsf monitor enable sysfail monitor enable unsigned char iitm irq level IITM IRQ level unsigned char iitm irq vector IITM IRQ vector unsigned char iitm irq enable IITM IRQ enable unsigned char iitm lo boung IITM index low bound unsigned char iitm hi boung IITM index high bound setup data Autoconfigure Link Status Data Structure f maximum size of Scan List define SCANLIST_SIZE 64 maximum size of I O Adapter Status Word Block define IOASWBLK SIZE 64 typedef struct unsigned short scanlist_len Length of Scan List unsigned short ioaswblk IOASWBLK SIZE IO Adapter Status Block unsigned charscanlist SCANLIST SIZE Scan List Block link config Scan List Data Structure X typedef struct unsigned short scanlist_len Length of Scan List unsigned charscanlist SCANLIST SIZE Scan List Block scanlist data Fault Dependent Group Data Structure kf maximum size of fault dependent group block define FDG BLOCK SIZE 64 typedef struct unsigned char fdg block FDG BLOCK SIZE fdg data 8 31 Chapter 8 Programming the Scanner Block Transfer Data Structure AJ maximum block transfer length in words define MAX BT DATALEN 64 typedef struct unsigned short cmd Block Transfer Command Word unsigned short cnfstat
133. of the general memory area and clear the data semaphore so other block transfers can be completed VME master processor 4 11 Chapter 4 Communicating with Remote I O 4 12 Sending Multiple Block Transfers to the Same Adapter The scanner can send as many block transfer requests as it needs to an adapter which corresponds to 1 physical rack but it can only send one block transfer request to a rack per scan To achieve the most efficient block transfers arrange your intelligent I O modules in multiple racks Another method to achieve faster block transfers is to use the SCAN LIST command so that a rack with several intelligent I O modules is scanned more often through multiple listings in the scan list The scanner keeps track of each block transfer request by its unique tag number You assign the tag number when you configure the block transfer command When a block transfer command completes the scanner returns the tag number along with the data so your application can determine which block transfer completed In SV compatible mode Each scanner channel can queue as many as 42 block transfer requests Each request has a block transfer tag number that you assign in your application program When a specific block transfer is complete the scanner sends the block transfer tag number back to the VME master processor along with the data This way your application program will know which block transfer c
134. of these values bit 12 1 adapter is in the current scan list bit 7 1 fault exists in the fault dependent group 0 adapter not in current scan list associated with the adapter 0 no fault exists in the fault dependent group associated with the adapter adapter attached Contains one of these values line status Contains one of these values hex bit 11 1 adapter resides at this address bit 6 4 000 adapter is off line 0 no adapter resides at this address any other adapter is on line value valid configuration Contains one of these values in fault dependent Contains one of these values bit 10 1 adapter type size and address are valid n 1 adapter is in the fault dependent group 0 adapter type size and or address not identified by the fault dependent group valid adapter is improperly configured number bits 2 0 0 adapter is not in a fault dependent group adapter size Contains one of these values hex fault dependent The value 0 7 binary identifies the fault bits 9 8 00 1 4 rack addressing Mi iss dependent group to which this adapter belongs 01 1 2 rack addressing 10 3 4 rack addressing 11 full rack addressing Figure 6 12 Format for one entry in the scan list 3 a Q Format item Description rack number The value 0 15 binary identifies the rack number bits 5 2 starting I O group number One of the following values identifies the starting I O group bits 1 0 00 group 0 01 grou
135. ol Status Area and General Data Area placing the result Fd data in the bt data structure passed by the caller If the completed operation A is a BT read the routine will place the read data in the bt data parameter s data ER buffer field k und parameters pointer to channel structure ud pointer to the bt data structure ok return values 1 General Data Area semaphore not locked or ELSE channel confirmation status word k int oneshot_bt_complete channel far chan bt_data far block csa_data far csa unsigned short far gda unsigned short ae 8 36 Chapter 8 Programming the Scanner map channel amp establish pointers map channel chan csa csa_data far chan ControlStatusArea gda unsigned short far chan GeneralDataArea check for semaphore if csa gt semaphore amp SEMAPHORE 0x0000 no block transfer has completed unmap_channel chan return 1 get block transfer parameters block cnfstat csa cnfstat block cmd csa cmd block addr csa addr block gt tag csa gt tag block datalen csa datalen if read if csa cmd CMD OSBTREAD copy block data for i 0 i lt block datalen i block gt data i gda i release semaphore unlock_gda chan unmap channel chan return block gt cnfstat Continuous Block Transfers Continuous block transfer ope
136. ommand interrupt wait for the result either poll for confirmation status or wait for an interrupt 5 clear the semaphore 2 3 4 5 28 RESET Chapter 5 Operating in SV Compatible Mode description RESET causes the scanner to reset itself The VME master processor can channel A general data issue RESET any time When the scanner stops running due to another VME module asserting SYSFAIL you can use RESET to reset the scanner which causes the scanner to re initialize itself RESET looks for the appropriate values in the last 2 words of the selected channel s general data area If the values are there the scanner resets itself performs its power on self test and enters the SLEEP state The application program has to wake up the scanner and then send a SETUP command to configure the scanner see chapter 8 for an example This applies to either channel During the RESET the scanner stops scanning the remote I O and all three LEDs on the scanner light RESET is different than a power cycle to the scanner in that with RESET the scanner doesn t assert SYSFAIL during the self tests and the scanner doesn t clear the I O image tables The scanner leaves the I O image tables in their last state The scanner then enters the SLEEP state Byte offset Hex Name 120 not used FBB FBC reset code word 0080 hex FBE reset code word AOAO hex FCO scanner interrupt and VME ID area 64 byt
137. ompleted since block transfers do not necessarily get completed in the same order they are requested In SV superset mode The scanner still processes a block transfer request the same way as in SV compatible mode but each scanner channel can queue only 1 block transfer request If you need multiple block transfers to the same adapter use the continuous block transfer operation It achieves the same result as sending several single block transfer requests and it also reduces programming overhead Before initializing a continuous block transfer requeues to an I O modules try a single block transfer to the I O module to verify the block transfer parameters After verifying the single block transfer use those parameters in a continuous block transfer request Chapter 4 Communicating with Remote I O Maintaining Block Integrity To maintain block integrity within the global RAM use bit 7 of the semaphore byte The semaphore byte is in the control status area of global RAM for each channel See chapters 5 6 depending on the operating mode you select for the scanner At power up when the scanner is turned on the semaphore bit is O reset When the scanner completes a block transfer it tests and sets the semaphore If the semaphore was reset the scanner loads status either confirmation or error into the confirmation status word and optionally interrupts the VME master processor to notify it of pending status If the semaphore w
138. on status word csa cmd block gt cmd command word csa gt addr block addr address word csa gt tag block gt tag tag word csa gt datalen block datalen length of data word if a BT write if block gt cmd CMD OSBIWRITE copy the block data for i 0 i lt block gt datalen i gda i block data il 8 13 Chapter 8 Programming the Scanner send the command interrupt assert cmd chan poll for command result if wait for cmdcmpl chan FALS clear the semaphore unlock gda chan unmap channel chan fprintf stdout osbtwrite wait failure lock cleared n return 2 Eu clear the semaphore res csa gt cnfstat unlock_gda chan unmap channel chan return int res 8 14 Chapter 8 Programming the Scanner CONTINUOUS BT WRITE CONTINUOUS BT READ command k k CONTINUOUS BT UPDATE update a continuous block transfer write or read operation xor The bt data parameter passed by the caller allows this routine to identify the A Specific continuous block transfer operation to update The command word field AE identifies the block transfer table and the tag field specifies the tabl ntry k k FA The routine copies the tabl ntry s command word address word tag word transfer ok length word and interrupt word parameters to the bt data parameter k
139. ontrol status channel A general data Byte offset Chapter 6 Operating in SV Superset Mode OOH transfer was successful 2FH block transfer put in queue OK any other value indicates an error 4 06H is both sent and returned address of I O module 4 0 31 index into continuous block transfer read table 00 07 hex interrupt level 00 FF hex interrupt status ID Bit 7 semaphore 0 64 words to read from the 1 0 module one entry in the continuous BT write table Hex Name 0203 0202 not used confirmation 0204 not used 0205 command 0206 not used 077 address 0208 notused BTtag 020A 020B 020A status ID interrupt level D not used 021D 021D 021C not used semaphore o2iF length of 021E not used Tai 0220 not used 0BFF 0C00 continuous BT read table 32 entries 72 words per entry 1FBF Byte offset Hex Name 0C00 notused BT tag READ ONLY 0C02 not used address READ ONLY 0C04 9005 length not used of data 4 READ ONLY 0C06 0C07 0C06 status ID interrupt READ ONLY 0C09 0C08 not used SVx flag 7 0COB used for 0C0A not used VME flag NEN semaphore ococ not used sak turn flag lt OCOE OCOF READ ONLY notused BTstatus 00 no errors XX error code 0C10 BT read data 64 words 0C50 up to as many e as 32 ent
140. ors and controls depend on your application You also need an adapter in the 1771 chassis to allow communication between the scanner and the I O modules You can use any A B adapter module or a PLC 5 processor that operates in adapter mode Preface Terms This table defines common terms This term Refers to the scanner both remote scanners catalog numbers 6008 SV1R and 6008 SV2R VME master processor main CPU of your VME system The VME master processor runs the application program that accesses the scanner A VME system can have more than one VME master processor each assigned different duties and both accessing the same scanner s VME chassis frame that VME cards are mounted in Both the scanner and the VME master processor are mounted in the chassis along with other VME hardware VMEbus circuit board or backplane mounted in the chassis that the scanner the VME master processor and other VME cards plug into I O chassis Allen Bradley 1771 series I O chassis This is the frame that houses the I O modules power supply and adapter or PLC processor input image table area of global memory in the scanner that contains the data from the input terminals of input modules When an input switch is closed its corresponding input bit in the image table is set to 1 output image table area of global memory in the scanner that contains output data for terminals of output modules Wh
141. p 2 10 group4 11 group 6 6 26 Chapter 6 Operating in SV Superset Mode coding sequence The following diagram shows one method for applying the LINK STATUS command 1 2 3 4 vi get the semaphore set up the control status area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt check the result clear the semaphore 6 27 Chapter 6 Operating in SV Superset Mode BT READ command byte 01 description BT READ transfers a block of data from specified I O module into the scanner The scanner queues at most one block transfer request write or read In SV superset mode each scanner channel can queue only one block transfer request If you need to send multiple block transfer requests use the continuous block transfer commands See pages 6 40 and 6 36 Upon issuing a block transfer request the scanner writes Ox2F in the confirmation status byte to indicate that the scanner accepted the request and put it into its queue When the scanner actually completes the block transfer the scanner sets the semaphore and then it updates this data in the following order address block transfer tag length of data confirmation status block transfer read data command complete interrupt if enabled See Se Chapter 6 Operating in SV Superset Mode kie Name us 00H transfer was successful mah
142. parameters that were provided to the command without fully specifying or incorrectly scanner module specifying one or more parameters needed with the command 12 Management command already pending The VME Wait for the scanner to finish the current command master processor issued another command while one is in process 13 Program mode required The VME master processor Place the scanner in the program mode and re issue issued a command that is valid only in the the command program mode Chapter 9 Troubelshooting Code Significance Corrective Action hex 14 Block transfer queue full The VME master processor Wait for one or more of the block transfers already in issued a block transfer command when the scanners the scanner s queue to finish then re issue block transfer queue was full the command 15 Invalid length of data The VME master processor Specify a proper length specified a length that cannot be used for the command issued 16 Illegal configuration The VME master processor 1 Adjust the fault dependent group and then re issue issued a the scan list SCAN LIST command that deletes an adapter listed 9 Adjust the scan list and the re issue the fault in a FAULT DEPENDENT GROUP dependent group command command placing an adapter not in the scan list into a FAULT DEPENDENT GROUP 23 Block transfer timeout A block transfer specified by 1 Make sure a block transfer module is in the the BT tag di
143. processor application in debug mode without incurring timeouts that disrupt the application The default is debug disabled 0223 command Write one of these values hex 0229 inputimage Write one of these values hex complete 01 level1 05 level 5 table 00 input image table monitor enabled Mula 02 level2 06 level 6 ias 01 input image table monitor disabled default Eve 03 level3 07 level7 mene FF nochange 04 level 4 default Values 02 FE are reserved If you write a reserved Values outside the range 01 07 are reserved If value to this field the scanner writes error 11H in you write a reserved value to this field the scanner the confirmation status byte writes error 11H in the confirmation status byte 0224 command The VME master processor writes an 8 bit value 022A inputimage The low bound sets one boundary for a contiguous complete here that the scanner will pass to the VME interrupt table low segment of the input image table that the scanner interrupt handler during the VMEbus interrupt cycle The bound monitors for a change The default low bound is status ID default value is 40H rack 0 group 0 Legal values are 00H to the high bound Values greater than the high bound result in error 11H in the confirmation status byte 0225 command Write one of these values hex 022B inputimage The high bound sets one boundary for a contiguous complete 00 generate VMEbus interrupt table high segment of the input image table that the scanner interrup
144. properly upon seeing this bit set Only the scanner can set this bit The VME master processor must clear it 5 5 Chapter 5 Operating in SV Compatible Mode Command Summary The SV compatible mode of the scanner supports these commands If you want to Use this command With this The scanner must See page command byte be in this hex programming mode set the baud rate watchdog rate VMEbus interrupt level how SETUP 13 program 5 7 the scanner responds to SYSFAIL and whether the scanner issues VMEbus interrupts establish a default scan list and provide status of the I O AUTOCONFIGURE 10 program 5 9 system to the VME master processor establish your own scan list SCAN LIST 11 program 5 13 establish a fault dependent group structure FAULT DEPENDENT GROUP 12 program 5 16 change the operating mode of the scanner SET MODE 20 program 5 19 test run check adapter status and the scan list without affecting LINK STATUS 21 program 5 21 scanner operation test run transfer a block of data from a specified I O module to BT READ 01 program 5 25 the scanner test run transfer a block of data from the scanner to a specified BT WRITE 02 program 5 27 1 0 module test run cause the scanner to reset itself RESET none program 5 29 test run Waking up the scanner When the scanner is first turned on it does a self test and then goes to sleep A VME master processor must wake the scanner up by interrupting it writ
145. r k Aw parameters pointer to channel structure X pointer to fdg data structure KK return values 1 unable to lock general data area semaphore EX 2 did not get cmd complete interrupt Be ELSE channel confirmation status word k int faultgroup channel far chan fdg data far fdgcfg csa_data far kasa unsigned short fdgblk_size unsigned short res map channel amp establish pointers map channel chan csa csa data far chan ControlStatusArea determine size of fault dependent group block fdgblk size unsigned short chan gt ScannerMode MODE COMPATIBLE SVC FAULTGRP SIZE SVS FAULTGRP SIZE get the semaphore if lock gda chan 0 unmap channel chan fprintf stdout fdg lock aquire FAILED n return 1 set up the control status area csa cnfstat 0x000F confirmation status word csa cmd CMD_FDGROUP command word csa datalen fdgblk size length of data word copy the fault dependent group data to the general data area blockcpy chan gt GeneralDataArea fdgcfg size t fdgblk size send the command interrupt assert cmd chan 8 8 Chapter 8 Programming the Scanner poll for command result if wait for cmdcmpl chan FALS clear the semaphore unlock gda chan unmap channel chan fprintf stdout fdg wait failure lock cleared n return 2
146. r chan gt ControlStatusArea wait for SV2 to complete POST while csa gt cnfstat 0x0090 write the VME ID AREA of scanner assert cmd chan unmap the channel unmap channel chan return 7 5 Chapter 7 Starting the Scanner k k MAP CHANNEL map a 6008SV2 channel k k KE This function accepts a channel structure as input and maps the E page VMEbus window ER to the specified channel The function then initializes the channel structure ee pointers to the various objects in the channel window e g discrete I O tables EX control status area and so forth k k xe parameters pointer to channel structure KK return value none x void map channel channel far chan char far base save current bus state EpcSaveState amp chan gt stash get pointer to base of scanner memory if EpcSetAmMap chan AddressMode chan ScannerAddress void far far amp base EPC SUCCESS fprintf stderr cannot map target scanner memoryNn exit 1 establish pointers to scanner objects x if chan gt ScannerMode MODE COMPATIBLE output table at base of global memory chan gt OutputTable amp base SVC OTABLE OFFSET input table at offset 80H chan gt InputTable char far amp base SV
147. r modules 3 6 assigning racks 3 7 I O Addressing Concept Each terminal on an input or output module that can be wired to a field device occupies a bit within the scanner s input image table or output image table T O addressing maps the physical location of an I O module terminal to a bit location in the processor memory I O addressing is just a way to segment memory Classification Term Relation to memory A specific terminal on an I O module terminal or The density of an I O module i e 8 point 16 point 32 point point directly relates to the amount of memory bits the module occupies in memory For example a 16 point input module occupies 16 bits in the input image table I O terminals that when combined occupy 1 word in 1 0 group 16 input bits 1 word in the input image table m input d 16 output bits 1 word in the output image table image table Combinations of bits or I O groups I O rack 128 input bits and 128 output bits or 8 input words and 8 output words or 8 I O groups Figure 3 1 shows the relationship between an I O terminal and its location in scanner memory 3 1 Chapter 3 Addressing I O 3 2 Figure 3 1 1 0 addressing as it relates to an I O terminal rack number 01 rack number 01 address 1 0 group number 0 word 1 0 group number 1 Output Image Table z 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 00 z
148. ransfer request each time you need the data Operating Modes Chapter 1 Scanner Overview Before you begin using the scanner you have several choices to make concerning how the scanner operates You need to specify how the scanner operates in the VME system and how you want to program the scanner Selecting VME Operating Mode The scanner offers two VME operating modes The mode you select determines the command set available to the scanner and the memory structure the scanner uses You set a switch on the scanner to specify the operating mode you want If you want select this VME operating mode the scanner to operate exactly as the 6008 SV scanner SV compatible This mode is compatible with the 6008 SV so you can run previously developed applications with minor modifications Select this mode if you are replacing a 6008 SV with a 6008 SV2R and do not want to modify your application In any application that uses the SCAN LIST command with the 6008 SV scanner you must modify the command to specify the rack size For more information see chapter 5 the scanner to use the new commands and additional memory as SV superset compared to the SV compatible mode This mode provides additional features as compared to the 6008 SV For more information see chapter 6 Important An application developed for one operating mode will not work in another operating mode 1 9 Chapter 1 Scanner Overview Selecting
149. rations are similar to single block transfer operations They send and retrieve data the same way The continuous block transfer offers a way to continuously poll an adapter and reduce programming overhead While running a continuous block transfer the scanner prevents the scanner and a VME processor from simultaneously updating the same block table entry Your application must resolve possible contention among multiple master VME processors simultaneously accessing the same block table entry Important Your application should read block updates as highly critical sections of code The application should have the master processor acquire a lock on the entry copy the read write data and release the lock without pausing sleeping polling or handling interrupts As long as the master processor holds the lock the scanner cannot update the block 8 37 Chapter 8 Programming the Scanner The programming example on page 8 15 shows how to program a continuous block transfer command in the scanner The following example shows how to update the block transfer data Programming Example k k CONFIGURE CONTINUOUS BT configure a continuous block transfer read or write k k EX This function is driven by the data contained in the bt data structured provided by ewe the caller The command word CNBTW CNBTR BT address word tag word interrupt KE word and BT transfer length word are placed in the Control Status Area
150. rd channel far int int unsigned short int queue_oneshot_bt channel far bt_data far int configure_continuous_bt channel far bt_data far int oneshot_bt_complete channel far bt_data far int continuous_bt_update channel far bt_data far bus h k k BUS H prototypes for bus utility functions k k void channel far channel far channel far void init_bus_ops void map_channel void unmap_channel int wait for cmdcmpl utils h k k UTILS H prototypes for utility functions k k channel far channel far channel far channel far btentry far btentry far channel far link config far bt data far void far void far size t unsigned short far void assert cmd void read csa int lock gda void unlock gda int lock conbt entry void unlock conbt entry void print link config void print bt data void blockcpy int sv2 lock csa data far Ly ox F F 0X 0X 8 33 Chapter 8 Programming the Scanner Programming Block Transfers Here is a brief review of the protocol to issue a block transfer command 1 Test and set the scanner s semaphore 2 Place the command code and other required data in the scanner s control status and general data area 3 Interrupt the scanner to let it know it should process your command The scanner puts the block transfer request in its
151. rd identifying an unsolicited block transfer When the scanner is done with the block transfer it tests and sets the semaphore places the necessary data in the general data area places a completion code in the confirmation status byte provides the block transfer tag number and generates a VMEbus interrupt If the scanner sees that the semaphore is already set it holds the block transfer data until the semaphore is reset Your application should copy the block transfer data from the general data area and clear the semaphore Block Transfer Timeout If the block transfer request does not complete within 4 seconds of the VME master processor sending the request to the scanner the scanner tests and sets the semaphore dequeues the failed request places an error code in the confirmation status word copies the correct tag value optionally interrupts the VME master processor to indicate that the block transfer requests timed out ab WN e The VME master processor then retrieves the result code and clears the semaphore The most common failure of a block transfer is a block timeout error code 23 hex in the confirmation status word This error occurs if the block transfer does not complete within 4 seconds of the initial request This 4 second value is not variable Another frequent reason a block transfer times out is because an incorrect intelligent module address is given to the scanner Another common mistake is to put an in
152. re they can run correctly in your application These examples were developed for a Radisys EPC computer they were written in Microsoft C version 7 00 To use these examples on other VME systems search for and replace all EPC calls with the appropriate functions for your system For more details on the structure of the scanner commands see chapter 5 or 6 for SV compatible or SV superset mode respectively Before the VME master processor issues a command request to the scanner use a read modify write cycle to test and set the scanner s semaphore If the semaphore bit is set non zero the VME master processor should not access the control status and general data areas of the scanner except for the operating status word If however the semaphore is clear zero the VME master processor can then access the control status and general data areas and should set the semaphore bit to signify to other master processors that these areas are in use Important When the semaphore is set other VME master processors can still overwrite data in the global RAM with their own data if necessary The semaphore does not physically lock out other VME master processors It is only a flag to warn other VME master processors that another processor is accessing global RAM When the scanner sees the semaphore set it won t write to the global data area The scanner waits until a VME master processor resets the semaphore to zero The scanner can never re
153. ries e 6 37 Chapter 6 Operating in SV Superset Mode 6 38 parameters The VME master processor writes 06 hex to the command byte Then the VME master processor writes these parameters to the control status area of the selected channel Byte Parameter Description offset 0207 continuous block transfer address The module address is the address of the I O module from which to read the block data It contains the rack 0 15 group 0 7 and slot 0 or 1 numbers of the I O module See Figure 6 15 on page 6 39 0209 continuous block transfer tag The VME master processor writes a number 0 31 that is an index into the continuous block transfer read table Only the lower byte is used 020A continuous block transfer Specifies the interrupt status ID used when the block transfer is completed See status ID Figure 6 16 on page 6 39 020B continuous block transfer Specifies the VME interrupt level used when the block transfer is completed See interrupt level Figure 6 16 on page 6 39 021F continuous block transfer The VME master processor writes the number of words of continuous length of data block transfer data 0 64 Use the value 0 to let the I O module determine how many words the scanner can read When the block transfer completes the 0 is replaced by the actual number of words read 0co1 continuous block transfer tag configure this parameter at byte offset 0209 see above READ ONLY 0C03
154. rmation error 16H in the confirmation status byte This tag is returned with the status when the block transfer is complete so the VME master processor can match the block transfer status with the request 021F length of data byte The length of data byte is an 8 bit value that specifies the number of 16 bit words 0 64 decimal to be read from the target 1 0 module Use the value 0 to let the I O module determine how many words the scanner can read When the block transfer completes the 0 is replaced by the actual number of words read Values greater than 64 are reserved If you write a reserved value to this field the scanner writes an illegal confirmation error 16H in the confirmation status byte 0220 BT data The BT data is the set of data words 0 64 read from the target I O module The BT data block ends at offset length of data 1 Figure 6 13 Format for the address byte 0 terminals 00 07 1 terminals 10 17 6 30 Chapter 6 Operating in SV Superset Mode coding sequence Your code for the BT READ command should include these tasks Pe b get the semaphore set up the control status area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt clear the semaphore Chapter 6 Operating in SV Superset Mode BT WRITE command byte 02 description BT WRITE transfers a block of data from the scanner to
155. rocessed The scanner responds to Data Transfer Bus DTB cycles initiated by masters that transfer data 16 bits at a time or 8 bits transferred in an even and odd format D16 DO8EO The scanner works in the 16 bit short addressing mode or the 24 bit standard addressing mode The scanner responds to common VME signals as follows This VME means signal SYSFAIL When the scanner recognizes a SYSFAIL signal it can either ignore the signal or shut itself down depending on how the scanner is configured When the scanner shuts down the I O serviced by the adapter either resets to a default condition or holds all of its current values as determined by switches on the I O chassis backplane When the scanner is faulted or shut down it asserts SYSFAIL on the VMEbus ACFAIL When the scanner recognizes an ACFAIL signal it shuts itself down because this means that power will soon be gone When the scanner shuts down the I O serviced by the adapter either resets to a default condition or holds all of its current values as determined by switches on the I O chassis backplane SYSRESET If SYSRESET is asserted on the VMEbus the scanner resets itself and goes through its initialization tests The scanner does not clear reset to 0 the input and output image tables After a SYSRESET signal you have to wake up the scanner the same as a power up situation 1 5 Chapter 1 Scanner Overview How the Scanner Scans For more
156. roper construction and connection Check power at the I O rack Make sure the watchdog is disabled during testing or is being called frequently enough to guard against timing out Discrete I O updating but block transfers Make sure you are addressing the proper module by using this formula areno Module Address rack x 16 slot Check the application program to make sure that the code for block transfer exactly follows the pseudo code found in the I O Concepts Manual publication 6008 6 5 1 Make sure the block transfer length is specified in the block transfer data packet typically use zero for length Block transfers are working erratically Declare the block transfer data packet as static Use a different data packet for each block transfer 9 4 Appendix Specifications Environmental Characteristic Value Specifications Temperature Operating 0 to 60 C derated 2 C per 1000 ft 300m over 6600 ft 2000m Storage 40 to 85 C Humidity Operating 5 to 95 noncondensing Storage 5 to 95 noncondensing Altitude Operating 0 to 10 000 ft 3000 m Storage 0 to 40 000 ft 12 000 m Vibration Operating 2 5 g peak max Storage 5 0 g peak max acceleration over 5 500 Hzsine wave point to point 1 oct min sine sweep Shock Operating 30 g 11 ms duration 1 2 sine shock pulse Storage 50 g 11 ms duration 1 2 sine shock pulse Power Maxim
157. s a single I O chassis or multiple I O chassis 1 0 rack 0 1 0 rack 1 I O rack 2 01 23 45 67 01 23 45 67 0123 45 67 ES A in One 16 slot chassis two racks One 16 slot chassis one rack 1 0 rack 3 01 2 3 4 5 6 7 T F 3 ie One 4 slot chassis 1 2 rack ie 2 slot chassis 1 4 rack each 16466 Using This Chapter Selecting Devices that You Can Connect Communicating with Remote I O This chapter provides an overview of remote I O communication If you want to read about go to page selecting devices that you can connect 4 1 introduction to remote I O 4 2 designing a remote I O link 4 3 specifying a scan list 4 5 processing discrete data 4 6 processing block data 4 8 These are the devices you can use on a remote I O link with the scanner Category
158. s 1771 AS 1771 ASB series A only 1771 DCM Miscellaneous 1771 AF connects to any device listed below Scanners 1771 SN 1772 SD SD2 1775 SR S4A S4B 6008 SQH1 SQH2 Adapters 1771 AS 1771 ASB series A only 1502 16 16 1771 DCM Miscellaneous 1771 AF operates at 57 6 or 115 2 K bit s and you do not require over 16 physical devices Specifying a Scan List The scan list is a map of the I O devices the scanner channel scans To create the scan list use either of these commands If you want use this command the scanner to poll all available adapter addresses and assemble a AUTOCONFIGURE list with one entry for each adapter in SV compatible mode there will be a maximum of 16 entries in the scan list in SV superset mode there will be a maximum of 32 entries in the scan list to create the scan list manually SCAN LIST add adapters multiple times in the scan list there can be a maximum of 64 entries in the scan list as long as there are only 16 distinct physical adapters 4 5 Chapter 4 Communicating with Remote I O Design Tip Processing Discrete I O 4 6 If you need multiple updates to an I O device during an I O scan enter a logical address in the scan list more than one time Do not assign the same partial or full rack address to more than one channel in scanner mode Each channel must scan unique partial and or full rack addresses The automatic configuration always displays t
159. s Bus ooo ooo uo m gag m J 000 000 amp ooo nau le 6 Lt ge t Grounding the VME Chassis 2 6 o pe other VME module j scanner CPU Allen Bradley makes specific recommendations for properly grounding its racks so that their operation is as safe and error free as possible VME systems on the other hand may have no formal specifications for grounding the VME chassis frame Allen Bradley recommends that you ground the VME chassis frame and that you connect the logic ground common of the VME power supply to the chassis frame s earth ground The specific procedure for grounding a VME chassis varies depending on the style of the chassis Read the Programmable Controller Wiring and Grounding Guidelines publication 1770 4 1 for information on how Allen Bradley racks are grounded and try to ground your VME chassis frame in a similar way Chapter 2 Installing the Scanner Inserting the Scanner Insert the scanner in one slot in a 6U full height VMEbus chassis off The scanner is not designed to be inserted or removed from ATTENTION Make sure that your VME system is powered a live system and connectors You might damage the board or electrostatic ATTENTION Avoid touching the circuit board discharge might damage the board Use the VME chassis card guides to slide the scanner into the chassis Use firm pressure on the top and bottom handles of the scanner to make its P1
160. s are set from left to right For example to set the address space at 562 000 hex in A24 with one channel active set the bits as VME address space of 562 000 hex A24 address mode with 1 channel active Sw2 SW1 Switch A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 0 1 0 1 0 1 1 0 0 0 f 0 Setting on off on of on off off on on on off on 5 6 2 The last three digits in 562 000 hex address are already determined by the scanner so there are no switches to set 2 5 Chapter 2 Installing the Scanner Removing VME The VMEbus has several daisy chained control signals Almost all Backplane Jumpers VMEbus backplanes contain jumpers for these control signals to allow systems to operate with empty slots There are five jumpers per VME slot one for each of the four bus grant arbitration levels and one for the interrupt acknowledge daisy chain Depending on the backplane manufacturer the jumpers can be on the rear pins of the J1 connector or alongside it on the front of the backplane The scanner uses 1 slot of the VME backplane Remove these jumpers from the slot where you plan to insert the scanner remove all the backplane backplane jumpers in the slot where you insert the scanner a a T Gg unu nau om B onu B ooo nau oum B om M one empty slot pnn ace jumpers are installed du
161. scanned bits 5 2 starting I O group number Write one of these values bits 1 0 00 group 0 01 group 2 10 group4 11 group 6 6 16 Chapter 6 Operating in SV Superset Mode coding sequence Your code for the SCAN LIST command should include these tasks tn p get the semaphore set up the control status area copy the scan list to the general data area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt clear the semaphore 6 17 Chapter 6 Operating in SV Superset Mode FAULT DEPENDENT GROUP command byte 12 description FAULT DEPENDENT GROUP associates a set of adapters such that if one adapter in the group faults all the other adapters in the group fault going to their fail safe mode of operation The scanner must be in Program mode to issue this command You can specify as many as 8 fault groups en Name m 00H returned means the command was 0202 not used confirmation successful Any other value indicates an error 0204 not used 03 command 12H is both sent and returned 0206 not used channel A control status 021B 021D 021C not used semaphore 4 Bit 7 semaphore 021E not used 0220 4 1 byte per starting group 4 bytes per adapter fault dependent group blocks see Figure 6 8 and Figure 6 9 channel A 64 bytes general data 025F 0260 not used 029F parameters The VME
162. sed 02FF parameters The VME master processor writes 20 hex to the command byte Then the VME master processor writes this parameter to the selected channel s general data area Byte Parameter Description offset 0220 mode Write one of these values hex 01 Program mode 02 Test mode 04 Run mode Values 00 03 and 05 FF are reserved If you write a reserved value to this field the scanner writes an illegal confirmation error 16H in the confirmation status byte 6 21 Chapter 6 Operating in SV Superset Mode 6 22 coding sequence Your code for the SET MODE command should include these tasks wPwh get the semaphore set up the control status area copy the mode value to the general data area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt clear the semaphore Chapter 6 Operating in SV Superset Mode LINK STATUS command byte 21 description LINK STATUS determines the current status of the adapters on the selected channel s I O link LINK STATUS doesn t affect the scanner The VME master processor can issue LINK STATUS any time Byte offset Hex Name OOH returned means the command was 0202 notused confirmation Successful Any other value indicates an error 0204 not used 0205 command 21H is both sent and returned 0206 not used channel A control status 021B 02
163. see Table of Contents iii Operating in SV Superset Mode 6 1 Using This Chapter 0 ec cece eee ee eee 6 1 Addressing Global RAM llle 6 1 Command Summary 2i suock ke is RR EA EXREEXEGRERREES 6 7 SETUP command byte 18 naana anaana aeann 6 8 noces M RP Prom 6 8 parameters i ucssciue s hand eds Yale ieia aa d RA ee ES 6 8 coding sequence ssssslssssee 6 10 AUTOCONFIGURE command byte 10 2 6 11 description 0 eee tenes 6 11 parameters oaii 2s cuum uu ug xev ee Sed Sees 6 12 coding sequence 3 32 pn e desees ERE REOR Ra e hd e s 6 14 SCAN LIST command byte 11 0 eee eee ee 6 15 GOSCIIPUON cusosisPeberekc deeer IR pP hee oe one EL 6 15 parameters icbesscbigecetuxegeb9ece db ert cae 6 15 coding sequence 1 kee teens 6 17 FAULT DEPENDENT GROUP command byte 12 6 18 nre MP TERT 6 18 parameters ororena lesse ed gedit de eee deed Di ess 6 18 coding sequence lssssessssee tee eens 6 20 SET MODE command byte 20 0 0 c eee ences 6 21 description sarera isere aiae tee eee eens 6 21 parameterS 22 v 08s dus red Sev E alee iad os bowen 6 21 coding sequence s uuo dee Ee ERR dwnndedadse ee PI HERES 6 22 LINK STATUS command byte 21 0c cee eens 6 23 description cs iore eii enetan RII 6 23 parameters ii sees eee ee eges laua ed ed Ra E 6 24 coding sequence 1 eee eens 6 27 BT
164. set the semaphore itself The scanner continues to update the I O image tables and operating status words regardless of the status of the semaphore bit 8 1 Chapter 8 Programming the Scanner Knowing When a Command There are two ways to determine whether a command is complete You Is Complete can poll the confirmation status bye or you can wait for an interrupt If you You should poll for confirmation status clear the confirmation status byte of the command prior to executing the command When the command completes the scanner returns a value to the confirmation status byte The value 00H means the command completed successfully any other value indicates an error wait for an interrupt wait for the interrupt you specified in the command complete interrupt byte of the SETUP command You can specify interrupt values 01 07 Programming Examples of The following code shows examples of programming the scanner Each Scanner Management management commands There is also sample code for various utilities Command and files needed for the scanner management commands as they are shown See the following table for a list of the programming examples If see example code for go to page the scanner management commands cmds c SETUP 8 3 AUTOCONFIGURE 8 5 SCAN LIST 8 7 FAULT DEPENDENT GROUP 8 8 SET MODE 8 10 LINK STATUS 8 11 BT WRITE 8 13 BT READ 8 13 CONTINUOUS BT WRITE 8 15 CONTINUOUS BT READ 8 15 RESET
165. set by the scanner the scanner cannot be shutdown by the internal watchdog ATTENTION Unwanted machine motion can result from disabling the VME master processor watchdog Only use the debug mode when you are debugging the application program for the VME master processor bit 4 The scanner sets bit 4 when it detects an unsolicited block transfer An unsolicited block transfer results if a VME master processor accidentally writes discrete information to an output image table byte that is mapped to an I O slot requiring a block transfer When this bit is set take action to correct this situation because it can seriously degrade scanner response time The scanner can only set this bit the VME master processor must clear it bit 5 If bit 5 is set the scanner has at least one block transfer request in its internal queue When the associated block transfer is completed and the queue is empty the scanner will clear the bit bit 6 If bit 6 is set at least one adapter has faulted lost power or has been dropped from the I O link The VME master processor can issue the LINK STATUS command for fault details When all the adapters in the scan list are cleared of faults or have been brought back on line the scanner will clear this bit bit 7 If bit 7 is set an adapter s operating status has changed The scanner uses this bit to tell VME master processors of a change in status of one of the adapters on the I O link An exampl
166. sfer tag number The block transfer tag number is an 8 bit integer that uniquely identifies each block transfer The scanner writes a value 0 41 to the block transfer request tag number in the control status area Values greater than 41 are reserved If you write a reserved value to this field the scanner writes an illegal confirmation error 16 in the confirmation status byte This tag is returned with the status when the block transfer is complete so the VME master processor can match the block transfer status with the request 11F length of data The length of data byte is an 8 bit value that specifies the number of 16 bit words 0 64 decimal to be written to the target 1 0 module Use the value 0 to let the I O module determine how many words the scanner can write When the block transfer completes the 0 is replaced by the actual number of words written Values greater than 64 are reserved If you write a reserved value to this field the scanner writes an illegal confirmation error 16 in the confirmation status byte 120 BT data The BT data is the set of data words 0 64 sent to the target I O module The BT data block ends at offset length of data 1 Figure 5 14 Structure of the address byte 0 terminals 00 07 1 terminals 10 17 coding sequence Your code for the BT WRITE command should included these tasks 1 getthe semaphore setup the control status area send the c
167. ssful ee e 2FH block transfer put in queue OK 0202 not used confirmation any other value indicates an error 0204 not used 00 command 4 07H is both sent and returned 0206 not used 0207 address address of I O module channel A control status 0209 0208 not used BT tag 0 15 index into continuous block transfer write table 020A 0208 00 07 hex interrupt level 20A status ID level lt 00 FF hex interrupt status ID 020C not used channel A SAN general data 021D 021C not used semaphore Bit 7 semaphore cr length of 4 0 64 words to write to the 021E not used data I O module 0220 not used one entry in the continuous BT write table Byte offset Hex Name QoFF 0300 notused BT tag 4 READ ONLY 0800 m 0302 notused address READ ONLY 16 entries 0305 72 words per entry D 0304 not used sea READ ONLY 0306 0307 0306 status ID interrupt READ ONLY 0309 zo ms OBFF 0308 not used SVx flag 030B used for 030A not used VME flag semaphore 030C not used Pe turn flag 030E 030F READ ONLY notused BTstatus 00 noerrors XX error code 0310 BT write data 64 words 0350 up to as many e as 16 entries e 6 41 Chapter 6 Operating in SV Superset Mode 6 42 parameters The VME master processor writes 07 hex to the command byte Then the VME master processor writes these parameters to the control status area of the selected chann
168. st length is an 8 bit quantity that the scanner writes to the length of data byte in the control status area You can enter a scan list length of 0 0220 scan list This list is a maximum of 64 bytes long 1 byte per entry but it can contain only 32 distinct physical adapter addresses The list contains one byte sized entry for each adapter you want to place in the list An adapter can appear in the list multiple times See Figure 6 6 and Figure 6 7 6 15 Chapter 6 Operating in SV Superset Mode Figure 6 6 Example scan list Byte Byte offset offset 0220 rack 0 staring group 2 rack 1 starting group 2 0221 0222 rack 2 staring group 2 rack 3 starting group 0 0223 0224 rack 4 staring group 0 rack 5 starting group 2 0225 0226 rack 6 staring group 0 rack 7 starting group 4 0227 e e e up to as many as 64 bytes e Figure 6 7 Format for one entry in the scan list gt Format item Description rack size Write one of these values biis 7 6 00 1 4 rack 01 1 2 rack 10 3 4 rack 11 full rack These bits function differently than with the AUTOCONFIGURE command With this command you must specify the rack size you want which could be larger than the actual rack size to allow for future expansion The AUTOCONFIGURE command determines the actual rack size and writes the appropriate value rack number Write the value 0 15 binary of the rack number to be
169. state The scanner then enters the SLEEP state Byte offset Hex Name C00 not used 1FBB 1FBC reset code word 0080 hex 1FBE reset code word A0A0 hex 1FCO scanner interrupt and VME ID area 64 bytes 1FFF 64 bylas Chapter 6 Operating in SV Superset Mode parameters There are no parameters for the RESET command Before the scanner executes the RESET command the VME master processor writes these parameters to the 2 words before the VME ID area Byte Parameter Description offset 1FBC second to last word in the selected Write the value 0080 hex to this word channel s general data area 1FBE last word in the selected channel s Write the value AOAO hex to this word general data area coding sequence Your code for the RESET command needs to write the above words to byte offsets IFBC and 1FBE 6 45 Using This Chapter Understanding the Scanner States Starting the Scanner This chapter provides programming examples that illustrate the scanner management commands If you want to read about go to page scanner states 7 1 powering up the scanner 7 4 after waking up the scanner 7 8 Important The programming examples in this publication are examples only They will need modification before they can run correctly in your application These examples were developed for a Radisys EPC computer they were written in Microsoft C version 7 00 To
170. t The SCAN LIST command uses two bits to identify rack size These bits were not required for the 6008 SV If you are migrating your application from a 6008 SV to a 6008 SV1R or 6008 SV2R make sure to set these additional bits See page 5 13 This chapter describes the SV compatible mode If you want to read about Go to page addressing global RAM 5 1 command summary 5 6 Both the VME master processor and the scanner can read and write to the scanner s VME global RAM The global RAM structure depends on the VME operating mode of the scanner Figure 5 1 shows the general structure for the SV compatible operating mode Page 5 3 shows the specifics of the structure for channel A 5 1 Chapter 5 Operating in SV Compatible Mode Figure 5 1 General structure of global RAM for SV compatible mode Channel A Channel B 6008 SV2R scanner only byte offset byte offset hex hex 000 output image table 1000 output image table 64 words 64 words 080 input image table 1080 input image table 64 words 64 words 100 control status area 1100 control status area 16 words 16 words 120 general data area 1120 general data area 1872 words 1872 words FCO interrupt VME ID area 1FCO interrupt VME ID area 32 words 32 words The physical address is the base address plus the byte offset Important Add 1000 hex to channel A addresses to get the corresponding addresses for channel B 5
171. t The maximum cable length for remote I O depends on the transmission rate Configure all devices on a remote I O link to communicate at the same transmission rate For trunk line drop line configurations use the 1770 SC station connectors and follow these guidelines the length of the trunk line cable depends on the communication rate the length of the drop cable is 30 4 m 100 cable ft For more information about designing trunk line drop line configurations see the Data Highway Data Highway Plus Data Highway II Data Highway 485 Cable Installation Manual publication 1770 6 2 2 For daisy chain configurations determine the total cable length you need A remote I O link using this cannot exceed this communication rate cable length 57 6 kbps 3 048 m 10 000 ft 115 2 kbps 1 524 m 5 000 ft 230 4 kbps 762 m 2 500 ft Chapter 4 Communicating with Remote I O For proper operation terminate both ends of a remote I O link by using external resistors Use either a 150 or 82Q terminator Table 4 A Selecting the external resistor the maximum number of physical devices that racks that you can use this resistor you can connecton scan on the link is If your remote I O link rating the link is operates at 230 4 K bit s operates at 57 6 or 115 2 K bit s and no devices listed below are linked Scanners 1771 SN 1772 SD SD2 1775 SR S4A S4B 6008 SQH1 SQH2 820 i 16 Adapter
172. t upon command completion default bound monitors for a change The default high bound is enable rack 15 group 7 Legal values are from the low 01 donot generate VMEbus interrupt upon command completion FF no change Values 02 FE are reserved If you write a reserved value to this field the scanner writes error 11H in the confirmation status byte bound to 7EH Values between 80 FF hex and values less than the low bound result in error 11H in the confirmation status byte 6 9 Chapter 6 Operating in SV Superset Mode coding sequence Your code for the SETUP command should include these tasks Pe hb get the semaphore set up the general data area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt clear the semaphore Chapter 6 Operating in SV Superset Mode AUTOCONFIGURE command byte 10 description AUTOCONFIGURE builds the scan list by polling every possible adapter address Every adapter on the link that responds is placed once in the scan list The scanner must be in Program mode to issue this command Byte offset Hex Name m 00H returned means the command was 0202 not used confirmation successful Any other value indicates an error 0204 not used 03 command 10H is both sent and returned 0206 not used channel A control status 021B 021D 021C not used semaphore Bit 7
173. ta use the SETUP command to select a communication rate of 57 6 115 2 or 230 4 kbps This chapter describes the SV superset mode If you want to read about go to page addressing global RAM 6 1 command summary 6 7 Both the VME master processor and the scanner can read and write to the scanner s VME global RAM The global RAM structure depends on the VME operating mode of the scanner Figure 6 1 shows the general structure for the SV superset operating mode Page 6 3 shows the specifics of the structure for channel A Important The scanner must be configured for A24 address space if you use the SV superset mode For more information about configuring address space see chapter 2 6 1 Chapter 6 Operating in SV Superset Mode Figure 6 1 General structure of global RAM for SV superset mode Channel A byte offset hex 00 output image table 128 words 9109 input image table 128 words 0200 control status area 16 words 0220 general data area 112 words 0300 continuous BT write 16 entries 72 words each 0C00 continuous BT read 32 entries 72 words each 1FC0 interrupt VME ID area 32 words Channel B 6008 SV2R scanner only byte offset hex 2000 output image table 128 words 2100 input image table 128 words 2200 control status area 16 words 2220 general data area 112 words 2300 continuous BT write 16 entries 72 words each 2C00
174. te offset 020A see above status ID READ ONLY 0307 continuous block transfer configure this parameter at byte offset 020B see above interrupt level READ ONLY 0309 continuous block transfer Used for Peterson semaphore See sample code in chapter 8 scanner flag 030B continuous block transfer Used for Peterson semaphore See sample code in chapter 8 VME flag 030D continuous block transfer Used for Peterson semaphore See sample code in chapter 8 turn flag 030F continuous block transfer Indicates the status of the continuous block transfer status 0100 block transfer disabled READ ONLY 0200 block transfer pending 0400 block transfer sent 0800 block transfer received 0310 0350 continuous block transfer Contains as many as 64 words of write or read data write read data 64 words Chapter 6 Operating in SV Superset Mode Use the SV2 flag VME flag and turn flag to determine who has access to the continuous block transfer write table If the scanner has the lock so that it can update the block data the scanner copies 64 words at 6 4 msecs before releasing the lock The VME master processor would at most busy wait 7 msecs before it could acquire the lock Figure 6 17 Format for the continuous block transfer address byte 0 terminals 00 07 1 terminals 10 17 Figure 6 18 Format for the continuous block transfer interrupt level and status ID 15 14 13
175. ter READ ONLY The list contains one byte sized entry for each adapter found on the I O link See Figure 5 5 on page 5 12 Figure 5 3 Format of the I O adapter status word block and scan list Byte Byte offset offset 120 rack 0 starting group 0 121 122 rack 0 starting group 2 123 124 rack 0 starting group 4 125 126 rack 0 starting group 6 127 channel A adapter status words 128 rack 1 starting group 0 129 dis Each block represents 1 word Only those words representing starting groups of 12A rack 1 starting group 2 12B existing racks should contain the data described in Figure 5 4 15C rack 7 starting group 4 15D 15E rack 7 starting group 6 15F 160 rack 0 starting group 2 rack 1 starting group 2 161 162 rack2 starting group 2 rack 3 starting group 0 163 channel A example scan list 164 rack 4 starting group 0 rack 5 starting group 2 165 Each block represents 1 byte 166 rack 6 starting group 0 rack 7 starting group 4 167 See Figure 5 5 e up to as many e e as 16 bytes e 5 10 Chapter 5 Operating in SV Compatible Mode Figure 5 4 Format of one entry in the I O adapter status word block as shown in Figure 5 3 15 14 13 reserved Format item Description Format item Description in scan list Contains one of these values group faulted Contains one of these values bit
176. test The scanner ignores all commands or interrupts from VME processors and ignores all packets from the I O link If the self test completes successfully the scanner initializes global memory and sends status to the operating status word In SV compatible and SV superset modes the scanner enters the SLEEP state If the scanner enters POST state from a VME SYSRESET or a RESET command the self test preserves the contents of the I O image tables DEAD when the self test detects irrecoverable hardware faults The scanner asserts VME SYSFAIL enters an infinite loop and ignores all commands or interrupts from VME processors and ignores all packets from the I O link Cycle power to leave the DEAD state SLEEP when the self test completes successfully and the scanner is in SV compatible or SV superset mode In the SLEEP state the scanner ignores all packets from the I O links The scanner doesn t leave this state until the VME master processor writes any value to the scanner interrupt VME ID area Then the scanner enters the PROGRAM state PROGRAM when the scanner leaves the SLEEP state or when the scanner in TEST or RUN state receives a SET MODE command In the PROGRAM state e the scanner doesn t send output information to the adapters all module outputs are held reset off discrete input information is updated the scanner doesn t send block transfer requests to the adapters but the scanner will queu
177. tput table at base of global memory chan gt OutputTable amp base SVC OTABLE OFFSET input table at offset 80H han gt InputTable char far amp base SVC ITABLE OFFSET Q control status area at offset 100H han ControlStatusArea char far amp base SVC CSA OFFSET Q general data area at offset 120H han GeneralDataArea char far amp base SVC GDA OFFSET Q mS continuous block transfer write table han ConBTWTable char far NULL Q continuous block transfer read table han gt ConBTRTable char far NULL Q reset area at offset FBCH chan gt ResetArea char far amp base SVC RESET OFFSET vme ID area at offset FCOH chan VmeIdArea char far amp base SVC VIA OFFSET Ebus window ture tables 8 19 Chapter 8 Programming the Scanner else if chan gt ScannerMode MODE SUPERSET output table at base of global memory chan gt OutputTable amp base SVS OTABLE OFFSET input table at offset 100H chan gt InputTable char far amp base SVS ITABLE OFFSET control status area at offset 200H chan gt ControlStatusArea char far amp base SVS CSA OFFSET
178. um 5V dc at 2 5A Typical 5V dc at 2 3A Performance Specifications Scan time per logical rack Scanner ms SViR 230 4 kbps 3 and SVOR 115 2 kbps 6 57 6 kbps 12 A 1 Appendix A Specifications Command Execution time ms SETUP 5 AUTOCONFIGURE unbounded SCAN LIST 5 FAULT DEPENDENT GROUP 5 SET MODE 5 LINK STATUS 1 BT WRITE 2 BT READ 2 CONTINUOUS BT WRITE 2 CONTINUOUS BT READ 2 RESET unbounded The AUTOCONFIGURE and RESET commands have unbounded execution times because the scanner must poll each legal address on the I O link for each channel incurring a timeout for each unoccupied address VMEbus Specifications Characteristic Value revision C 1 Slave address A16 A24 Slave transfer D08 EO D16 Interrupter I 1 7 D08 O A 2 chap 4 Communicating with Remote I O chap 1 chap 2 chap 3 Scanner Overview Installing the Scanner Addressing I O CL VMEbus relationship Set the switches L Choose the addressing mode Select remote I O devices L1 How the scanner scans Ground the chassis L1 Address block transfer modules Design the remote I O link L1 Operating modes L Insert the scanner L Assign racks LI Specify the scan list Determine the power requirements L Connect to remote I O chap 5 Operating in SV Compatible Mode 1 Address global RAM LJ Command summary chap 6 Operating in SV Superset Mode L Address
179. unction executes a AUTOCONFIGURE command The results of the autoconfigure are Ak placed in the link config structure provided by the caller k k uid parameters pointer to channel structure KK pointer to link_config structure ok return values 1 unable to lock general data area semaphore EK 2 did not get cmd complete interrupt ae ELSE channel confirmation status word k k A Note that if the confirmation status word is not 0000H the contents of the KE link_config structure passed by the caller are NOT defined k k int autocfg channel far chan link_config far linkcfg csa_data far csa unsigned short far gda unsigned char far scanlist unsigned short ioaswblk size unsigned short res unsigned short 3 map channel amp establish pointers map channel chan csa csa data far chan ControlStatusArea gda unsigned short far chan GeneralDataArea determine I O Adapter Status Word block size ioaswblk size unsigned short chan gt ScannerMode MODE COMPATIBLE SVC IOASWBLK SIZ SVS IOASWBLK SIZE 14 get the semaphore if lock gda chan 0 unmap channel chan fprintf stdout autocfg lock aquire FAILED n return 1 set up the control status area csa cnfstat 0x000F csa cmd CMD AUTOCFG csa datalen 0 send the command interrupt assert cmd chan 8 5 Chapter 8 Programming the Sc
180. up down JL a Important These pins are for manufacturing use only do not jumper these pins 2 3 Chapter 2 Installing the Scanner Table 2 A Switch settings for SW3 This switch configures with these options switch 1 2 3 not used set to off switch 4 5 VME operating mode switch 4 switch 5 on on SV compatible on off SV superset off off reserved off on reserved switch 6 VME address space on A16 off A24 Select A24 if you select SV superset as the VME operating mode switch 7 how the scanner responds to on responds to non privileged and supervisory VME accesses VME accesses 2D 3D 29 and 39 address modifiers off responds to supervisory VME accesses 29 and 39 address modifiers switch 8 which channels are active on only channel A is active off both channel A and B are active this switch is ignored if you are configuring the 6008 SV1R 2 4 Chapter 2 Installing the Scanner For example 9 These switch settings specify n ii i m SW3 e SV compatible mode e A24 address space 123 4 5 6 7 8 e response to both non privileged and supervisory access e only channel A is active PRPRPAR These switch settings specify VME address 562 000 TER RR 7 Specifying VME addresses You specify the first digit for A16 or first 3 digits for A24 of the address space the remaining digits are always 0 The switche
181. ure 5 9 Zero all entries for which adapters do not exist 5 17 Chapter 5 Operating in SV Compatible Mode Format item Figure 5 9 Format for one entry in the fault dependent group block reserved Description in fault dependent group bit 3 Write one of these values 1 adapter is in the fault dependent group identified by the fault dependent group number bits 2 0 0 adapter is not in a fault dependent group fault dependent group number Write a value 0 7 binary to identify the fault dependent group bits 2 0 to which this adapter belongs coding sequence Your code for the FAULT DEPENDENT GROUP command should include these tasks get the semaphore set up the control status area copy the fault dependent group data to the general data area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt 6 clear the semaphore Ue eS SET MODE command byte 20 channel A general data Chapter 5 Operating in SV Compatible Mode description SET MODE changes the operating mode of the scanner channel A control status Mode 01 Program 02 Test 04 Run Byte offset Hex Name is OOH returned means the command was 102 not used confirmation Successful Any other value indicates an error 105 104 not used command 20H is both sent
182. ve the data and reset the semaphore If the semaphore bit is clear the general data area is available for access by any VME master processor Important A VME master processor doesn t use the semaphore when it accesses the I O image table The VME master processor can access the I O image table anytime For command requests the scanner returns status either confirmation or error when the command is complete When the VME master processor receives the confirmation status it must retrieve the data from the general data area and clear the semaphore Important Only 1 command can be issued at a time A status confirmation or error must be received before a new command is issued length of data byte specifies the amount of data associated with a command or response Only the lower byte is used Interpret the length of data based on the context of the requested command or received confirmation i e number of words for block transfers and bytes for scanner management requests general data area contains input parameters and result data for scanner commands scanner interrupt and VME ID interrupt from the VME master processor to the scanner The scanner interrupt area and VME ID area can be read anytime without causing an interrupt to the scanner It contains 32 words in which the odd lower byte only is used the information is an ASCII character string V M E I D A B 6 0 0 8 S V 2 R x y or V M E I D A B 6 0 0
183. watchdog timer de 00 SYSFAIL monitor enabled default Med 09 00 enable watchdog timer default enapie 01 SYSFAIL monitor disabled Pane 02 FF FF nochange Disable the watchdog timer when you want to run a Values 02 FE are reserved If you write a reserved master processor application in debug mode without value to this field the scanner writes error 11H in incurring timeouts that disrupt the application The the confirmation status byte default is debug disabled 123 command Write one of these values hex complete oi level 1 05 level 5 VMEbus 02 Ievel 2 06 level 6 interrupt Q3 evel 3 07 level7 level 04 level 4 default Values outside the range 01 07 are reserved If you write a reserved value to this field the scanner writes error 11H in the confirmation status byte 5 8 coding sequence 1 get the semaphore 2 set up the general data area 3 send the command interrupt 4 wait for the result Your code for a SETUP command should include these tasks either poll for confirmation status or wait for an interrupt 5 clear the semaphore Chapter 5 Operating in SV Compatible Mode AUTOCONFIGURE command byte 10 description AUTOCONFIGURE builds the scan list by polling every possible adapter address Every adapter on the link that responds is placed once in the scan list The scanner must be in Program mode to issue this command iene Name m 00H returned means the command was
184. wing values identifies the starting I O group 00 group 0 01 group 2 10 group 4 11 group 6 coding sequence Your code for the AUTOCONFIGURE command should include these tasks 1 2 3 4 p get the semaphore set up the control status area send the command interrupt wait for the result either poll for confirmation status or wait for an interrupt check the result clear the semaphore Chapter 5 Operating in SV Compatible Mode SCAN LIST command byte 11 description SCAN LIST replaces the current scan list The scanner must be in Program mode You can issue a SCAN LIST command without first issuing an AUTOCONFIGURE command Byte offset Hex Name ie OOH returned means the command was 102 not used confirmation Successful Any other value indicates an error 105 104 not used command 11H is both sent and returned 106 not used channel A control status 11B 11D 11C not used semaphore 4 Bit 7 semaphore IF scan list number of entries 0 64 ME not used length in the scan list 120 4 1 byte per adapter you can enter the same adapter scan list multiple times channel A as many as 64 bytes see Figure 6 5 general data 15F 160 not used FBF parameters The VME master processor writes 11 hex to the command byte Then the VME master processor writes these parameters to the selected channel s general data area Byte
185. with the adapter adapter attached Contains one of these values line status Contains one of these values hex bit 11 1 adapter resides at this address bit 6 4 000 adapter is off line 0 no adapter resides at this address any other adapter is on line value valid configuration bit 10 Contains one of these values 1 adapter type size and address are valid 0 adapter type size and or address not valid adapter is improperly configured in fault dependent group bit 3 Contains one of these values 1 adapter is in the fault dependent group identified by the fault dependent group number bits 2 0 0 adapter is not in a fault dependent group adapter size bits 9 8 Contains one of these values hex 00 1 4 rack addressing 01 1 2 rack addressing 10 3 4 rack addressing 11 full rack addressing fault dependent group number bits 2 0 The value 0 7 binary identifies the fault dependent group to which this adapter belongs 6 13 Chapter 6 Operating in SV Superset Mode 6 14 Format item Figure 6 5 Format for one entry in the scan list 7 6 5 4 3 2 1 0 Description rack number bits 5 2 The value 0 15 binary identifies the rack number starting I O group number bits 1 0 One of the following values identifies the starting I O group 00 groupO 01 group 2 10 group4 11 group 6 coding sequence Your code for the AUTOCONFIGURE
186. y gt sv2_flag amp amp entry gt turn_flag 1 return 0 UNLOCK CONBT ENTRY unlock the data buffer of a Continuous Block Transfer Table Entry k k KE parameters pointer to the Continuous BT Table entry EE return value none Ef void unlock_conbt_entry btentry far entry entry gt vmp_flag 0 return 8 25 Chapter 8 Programming the Scanner k k PRINT_LINK_CONFIG print contents of link_config data structure te te XE This routine prints the contents of a link_config structure which is used by the dk autocfg and linkstatus routines K AR parameters pointer to link_config structure Ak return value none k k 0 void print link config channel far chan link config far ptr unsigned short ioaswblk size unsigned short qus determine I O adapter status word block size ioaswblk size unsigned short chan gt ScannerMode MODE COMPATIBLE SVC IOASWBLK SIZ SVS IOASWBLK SIZE B printf n track tGRPO tGRP1 tGRP2 tGRP3 n for i 0 i lt ioaswblk size i 4 printf tSd tSXH tSXH tSXH tSXH n 1 4 ptr ioaswblk i 0 ptr gt ioaswblk itl ptr gt ioaswblk it2 ptr ioaswblk i 3 printf n tscanlist length dWMn ptr scanlist len for i 0 i lt ptr scanlist len i printf tentry Sd XH n i ptr gt scanlist i return 8 26 kx kx k
Download Pdf Manuals
Related Search
Related Contents
FactoryLink ECS Core Tasks Configuration Guide ダウンロード - Learningsite21 barniz acrílico antimoho Manual de Usuario CAS Usuario ESCUELA BILAN ECONOMIQUE 1er semestre 2012 Xerox® WorkCentre® 5845/5855/5865/5875/5890 Guida introduttiva altamente Copyright © All rights reserved.
Failed to retrieve file