You are on page 1of 9

' ' ' ' ' ' ' ' ' ' ' ' ' ' '

'

-----------------------------------------------------------------------INGEAR API VB6.TXT -- INGEAR for Allen-Bradley Declarations and Constants for Visual Basic 6.0 API Text Viewer Copyright (C) 1994-99 CimQuest PDI This file contains only the Const, Type, and Declare statements for Allen-Bradley PLC's. You have a royalty-free right to use, modify, reproduce and distribute this file (and/or any modified version) in any way you find useful, provided that you agree that CimQuest has no warranty, obligation or liability for its contents. ------------------------------------------------------------------------

' * ' * INGEAR AB Function Codes ' * Const FNC_PLC_READ = 0 Const FNC_PLC_WRITE = 1 Const FNC_ADAPTER_STATS = 2 Const FNC_GLOBAL_DATA_READ = 3 Const FNC_GLOBAL_DATA_WRITE = 4 ' * ' * INGEAR Error Codes ' * Const ERR_INVALID_ADAPTER = -1 Const ERR_COMM_TIMEOUT = -3 Const ERR_NETWORK_TIMEOUT = -4 Const ERR_DRIVER_ERROR = -5 Const ERR_INVALID_COMMAND = -6 Const ERR_TCPIP_CONNECT_FAIL = -7 Const ERR_TCPIP_CONNECT_LOST = -8 ' * ' * WatchPoint Event Flags ' * Const EV_ON_ANALOG_LOW =1 Const EV_ON_ANALOG_HIGH = 2 Const EV_ON_ANALOG_NORMAL = 4 Const EV_ON_ANALOG_ANY = 8 ' * ' * AB Error Codes ' * ' *** LOCAL STS ERRORS *** Const ERR_STS_ETX_200 = &H200 Const ERR_STS_ETX_300 = &H300 Const ERR_STS_ETX_400 = &H400 Const ERR_STS_ETX_500 = &H500 r response Const ERR_STS_ETX_600 = &H600 Const ERR_STS_ETX_700 = &H700 Const ERR_STS_ETX_800 = &H800 ' *** REMOTE STS ERRORS ***

' ' ' ' '

* * * * *

Function Function Function Function Function

0 1 2 3 4

Read PLC Write PLC Adapter Stats Global Data Read Global Data Write

' ' ' '

* * * *

WatchPoint WatchPoint WatchPoint Watchpoint

On On On On

Analog Analog Analog Analog

Low Flag High Flag Normal Flag Any Flag

' ' ' '

cannot guarantee delivery:link layer duplicate token holder detected local port is disconnected application layer timed-out waiting fo

' duplicate node detected ' station is off-line ' hardware fault.

Const ERR_STS_ETX_1000 Const ERR_STS_ETX_2000 ate Const ERR_STS_ETX_3000 cted, or shutdown Const ERR_STS_ETX_4000 ardware fault Const ERR_STS_ETX_5000 Const ERR_STS_ETX_6000 Const ERR_STS_ETX_7000 Const ERR_STS_ETX_8000 Const ERR_STS_ETX_9000 Const ERR_STS_ETX_B000 Const ERR_STS_ETX_C000

= &H1000 = &H2000 = &H3000 = &H4000 = = = = = = = &H5000 &H6000 &H7000 &H8000 &H9000 &HB000 &HC000

'Illegal command or format 'Host has problem or will not communic 'Remote node host is missing, disconne 'Host could not complete function to h 'Addressing problem 'Function disallowed 'Processor in program mode 'Compatiblity mode file missing 'Remote node cannot buffer command 'Remote node problem due to download 'Cannot execute due to active IPBS 'A field has an illegal value 'Less levels specifiec in address than mi 'More level specified than system support 'Symbol not found 'Symbol is of improper format 'Address doesn't point to something usefu 'File is wrong size 'Cannot complete request, situation has c 'Data or file is too large 'Transaction plus word size is too large 'Access denied, imporper privilege 'Condition cannot be generated 'Condition already exists 'Command cannont be executed 'Histogram overflow 'No Access 'Illegal data type 'Invalid parameter or invalid data. 'Address refence exists to deleted area 'Command execution failure for unknown re 'Data conversion error 'Scanner not able to communicate to 1771 'Adapter cannot communicate with module '1771 module response was not valid 'Duplicated label 'File is open; another node owns it 'Another node is program owner

' *** EXT STS ERRORS *** Const ERR_STS_ETX_F001 = &HF001 Const ERR_STS_ETX_F002 = &HF002 numum for any address Const ERR_STS_ETX_F003 = &HF003 s Const ERR_STS_ETX_F004 = &HF004 Const ERR_STS_ETX_F005 = &HF005 Const ERR_STS_ETX_F006 = &HF006 l Const ERR_STS_ETX_F007 = &HF007 Const ERR_STS_ETX_F008 = &HF008 hanged since the start of the command Const ERR_STS_ETX_F009 = &HF009 Const ERR_STS_ETX_F00A = &HF00A Const ERR_STS_ETX_F00B = &HF00B Const ERR_STS_ETX_F00C = &HF00C Const ERR_STS_ETX_F00D = &HF00D Const ERR_STS_ETX_F00E = &HF00E Const ERR_STS_ETX_F00F = &HF00F Const ERR_STS_ETX_F010 = &HF010 Const ERR_STS_ETX_F011 = &HF011 Const ERR_STS_ETX_F012 = &HF012 Const ERR_STS_ETX_F013 = &HF013 Const ERR_STS_ETX_F014 = &HF014 asons Const ERR_STS_ETX_F015 = &HF015 Const ERR_STS_ETX_F016 = &HF016 rack adapter Const ERR_STS_ETX_F017 = &HF017 Const ERR_STS_ETX_F018 = &HF018 Const ERR_STS_ETX_F019 = &HF019 Const ERR_STS_ETX_F01A = &HF01A Const ERR_STS_ETX_F01B = &HF01B

' ************************************************************ ' * PLC Data Types ' *********************************************************** ' * ' * PLC-5 Timer Structure ' * Type PLC5_TMR ControlWord As Integer

' * control word

PRE As Long ACC As Long End Type ' * ' * SLC Timer Structure ' * Type SLC_TMR ControlWord As Integer PRE As Integer ACC As Integer End Type ' * ' * LOGIX 5550 Timer Structure ' * Type LOGIX5550_TMR Reserved as Long ControlWord as Integer PRE as Long ACC As Long End Type ' * ' * Timer Bit Constants ' * Const TMR_EN = 15 Const TMR_TT = 14 Const TMR_DN = 13 Const TMR_FS = 12 Const TMR_LS = 11 Const TMR_OV = 10 Const TMR_ER = 9 ' * ' * Counter Structure ' * Type CTR ControlWord As Integer PRE As Integer ACC As Integer End Type ' * ' * Counter Bit Constants ' * Const CTR_CU = 15 Const CTR_CD = 14 Const CTR_DN = 13 Const CTR_OV = 12 Const CTR_UN = 11 ' * ' * Control File Structure ' * Type CONTROLFILE ControlWord As Integer Length As Integer Position As Integer

' * preset ' * accum

' * control word ' * preset ' * accum

' * timer enabled bit ' * timer timing bit ' * timer done bit

End Type ' * ' * Control File Bit Constants ' * Const R_EN = 15 Const R_EU = 14 Const R_DN = 13 Const R_EM = 12 Const R_ER = 11 Const R_UL = 10 Const R_IN = 9 Const R_FD = 8 ' * ' * SCF Status Structure ' * Type SFCSTATUS ControlWord As Integer PRE As Integer TIM As Integer End Type ' * ' * SFC Bit ' * Const SC_SA Const SC_FS Const SC_LS Const SC_OV Const SC_ER Const SC_DN Constants = = = = = = 15 14 13 12 11 10

' * ' * Block Transfer Structure ' * Type BTFILE ControlWord As Integer RLEN As Integer DLEN As Integer FILE As Integer ELEM As Integer RGS As Integer End Type ' * ' * Block Transfer Bit Constants ' * Const BT_EN = 15 Const BT_ST = 14 Const BT_DN = 13 Const BT_ER = 12 Const BT_CO = 11 Const BT_EW = 10 Const BT_NR = 9 Const BT_TO = 8 Const BT_RW = 7 ' *

' * PD Block ' * Type PDBLOCK ControlWord As Integer StatusWord As Integer SP As Single Kp As Single Ki As Single Kd As Single BIAS As Single MAXS As Single MINS As Single DB As Single SO As Single MAXO As Single MINO As Single UPD As Single PV As Single ER As Single OUT As Single PVH As Single PVL As Single ERH As Single ERL As Single PVDB As Single ERDB As Single MAXI As Single MINI As Single TIE As Single ADDR(0 To 3) As Integer DATA(0 To 13) As Single End Type ' * ' * PD Block Bit Constants ' * Const PD_EN = 15 Const PD_CT = 9 Const PD_CL = 8 Const PD_PVT = 7 Const PD_DO = 6 Const PD_SWM = 4 Const PD_CA = 2 Const PD_MO = 1 Const PD_PE = 0 Const PD_INI = 12 Const PD_SPOR = 11 Const PD_OLL = 10 Const PD_OLH = 9 Const PD_EWD = 8 Const PD_DVNA = 3 Const PD_DVPA = 2 Const PD_PVLA = 1 Const PD_PVHA = 0 ' * ' * Message File Structure ' * Type MGFILE

'Control Word 'Status Word 'Setpoint Value 'Proportional Gain 'Integral Gain 'Derivative Time (secs) 'Forward Bias 'Engineering Unit Max 'Engineering Unit Min 'Deadband 'Set Output (0-100%) 'Maximum Output Limit (% of Output) 'Minimum Output Limit (% of Output) 'Loop Update Time 'Process Variable 'Error 'Output Value (0-100%) 'PV Alarm High 'PV Alarm Low 'Error Alarm High 'Error Alarm Low 'PV Alarm Deadband 'Error Alarm Deadband 'Maximun Input 'Minimum Input 'Tieback 'Addr[0]-[3] 'Data[0]-[13]

ControlWord As Integer ERR As Integer RLEN As Integer DLEN As Integer DATA(0 To 51) As Integer End Type ' * ' * Message ' * Const MG_NR Const MG_TO Const MG_EN Const MG_ST Const MG_DN Const MG_ER Const MG_CO Const MG_ER Block Bit Constants = = = = = = = = 9 8 7 6 5 4 3 2

' * ' * Status Files ' * Const STATUS = "S:1" ' * ' * PLC-5 Status Table ' * Type PLC5_STATUS ProcessorStatus As Integer SwitchSetting As Integer ActiveNode(0 To 3) As Integer GSB_Rack_0 As Integer LastPrgScan As Integer MaxPrgScan As Integer MinorFaultW1 As Integer MajorFault As Integer FaultCode As Integer ProgamFault As Integer RungFault As Integer VMEStatus As Integer IOStatus As Integer MinorFaultW2 As Integer PLC_Year As Integer PLC_Month As Integer PLC_Day As Integer PLC_Hour As Integer PLC_Minute As Integer PLC_Second As Integer IndexAddrOffset As Integer UserControlBits As Integer RCB_Rack_0 As Integer PrgWatchDogSetPoint As Integer FaultRoutineFile As Integer STISetpoint As Integer STIFileNum As Integer GSB_Rack_10 As Integer RCB_Rack_10 As Integer GSB_Rack_20 As Integer ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * S:1 processor status and flags S:2 Switch Setting information S:3-6 Active Node Table S:7 Global Status Bits Racks 0-7 S:8 Last Program Scan (in ms.) S:9 Maximum Program Scan (in ms) S:10 Minor Fault (Word 1) S:11 Major Fault S:12 Fault Codes S:13 Program File where fault occured S:14 Rung Number where fault occured S:15 VME Status File S:16 I/O Status File S:17 Minor Fault (Word 2) S:18 Processor Clock Year S:19 Processor Clock Month S:20 Processor Clock Day S:21 Processor Clock Hour S:22 Processor Clock Minute S:24 Processor Clock Second S:25 Indexed Addressing Offset S:26 User Control Bits S:27 Rack Control Bits (Racks 0-7) S:28 Progam Watchdog Setpoing S:29 Fault Routine File S:30 STI Setpoint S:31 STI File number S:32 Global Status Bits (Racks 10-17) S:33 Rack Control Bits (Racks 10-17) S:34 Global Status Bits (Racks 20-27)

RCB_Rack_30 As Integer StatusWord36 As Integer StatusWord37 As Integer StatusWord38 As Integer StatusWord39 As Integer StatusWord40 As Integer StatusWord41 As Integer StatusWord42 As Integer StatusWord43 As Integer StatusWord44 As Integer StatusWord45 As Integer PllProgram As Integer PllModuleGrp As Integer PllBitMask As Integer PllCompare As Integer PllDownCnt As Integer PllChangedBit As Integer PllEvents As Integer STIScanTime As Integer STIScanTimeMax As Integer PllScanTimeLast As Integer PllScanTimeMax As Integer UserPrgChecksum As Integer StatusWord58 As Integer ELCIODTScanTime As Integer Transfer Scan Time (in ms) ELCIODScanTimeMax As Integer Maximum Scan Time (in ms) StatusWord61 As Integer EIOCBTScanTimeMax As Integer Scan Time (in ms) ProtectedDataTable As Integer ection File Number StatusWord64 As Integer StatusWord65 As Integer StatusWord66 As Integer StatusWord67 As Integer StatusWord68 As Integer StatusWord69 As Integer StatusWord70 As Integer StatusWord71 As Integer StatusWord72 As Integer StatusWord73 As Integer StatusWord74 As Integer StatusWord75 As Integer StatusWord76 As Integer CommTimeSlice As Integer eeping function (in ms) MCPIODisable As Integer MCPIOInhibit As Integer MCP(80 To 127) As Integer End Type ' * ' * SLC Status File ' * Type SLC_STATUS ArithScanStat As Integer CPUMode As Integer CPUAlternateMode As Integer

' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

* * * * * * * * * * * * * * * * * * * * * * * * *

S:35 S:36 S:37 S:38 S:39 S:40 S:41 S:42 S:43 S:44 S:46 S:46 S:47 S:48 S:49 S:50 S:51 S:52 S:53 S:54 S:55 S:56 S:57 S:58 S:59

Rack Control Bits (Rack 20-27) Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Pll program file number Pll Module Broup Pll Bit Mask Pll Compare Value Pll down count Pll changed bit events since last interrupt STI Scan Time (in ms) STI Maximum Scan Time (in ms) Pll Last Scan Time (in ms) Pll Maximum Scan Time (in ms) User Program Check Sum Reserved Extended Local I/O Channel Discrete

' * S:60 Extended Local I/O Channel Discrete ' * S:61 Reserved ' * S:62 Extended I/O Channel Block Transfer ' * S:63 Protected Processor Data Table Prot ' ' ' ' ' ' ' ' ' ' ' ' ' ' * * * * * * * * * * * * * * S:64 S:65 S:66 S:67 S:68 S:69 S:70 S:71 S:72 S:73 S:74 S:75 S:76 S:77 Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Communication time slice for housek

' * S:78 MCP I/O Update Disable Bit ' * S:79 MCP I/O Inhibit Bits ' * S:80-S:172

' * S:0 Arithmetic and Scan Stat Flags ' * S:1 processor mode and Status Control ' * S:2 process altnernate mode and scan fla

gs WatchDogScanTimer As Integer TimeBase As Integer MinorError As Integer MajorError As Integer SuspendCode As Integer SuspendFile As Integer ActiveNode(0 To 1) As Integer IOSlotFlags(0 To 1) As Integer MathRegister(0 To 1) As Integer NodeAddress As Integer TSSStartRung As Integer mber TSSStartFile As Integer mber TSSStopRung As Integer Number TSSStopFile As Integer Number TestReportRung As Integer Number TestReportFile As Integer Number MaxScanTime As Integer AvgScanTime As Integer IndexRegister As Integer IOIntPending(0 To 1) As Integer IOIntEnabled(0 To 1) As Integer UserFaultFile As Integer STITimeInterval As Integer STIFileNumber As Integer ber IOIntExecuting As Integer ExtendedCPUMode As Integer control StatusWord34 As Integer CurrentScanTime As Integer ExtendedMinorError As Integer CPU_Year As Integer CPU_Month As Integer CPU_Day As Integer CPU_Hour As Integer CPU_Minutes As Integer CPU_Seconds As Integer StatusWord43 As Integer StatusWord44 As Integer StatusWord45 As Integer DllFileNumber As Integer DllInputSlot As Integer DllMask As Integer DllCompare As Integer DllDownCount As Integer DllReturnMask As Integer DllAccumulator As Integer StatusWord53 As Integer StatusWord54 As Integer LastDllISRScanTime As Integer MaxDllISRScanTime As Integer ProcessorOSCat As Integer Number ' * S:18 Test Single Step - Stop Before Rung ' * S:19 Test Single Step - Stop Before File ' * S:20 Test Report - Fault/Powerdown Rung ' * S:21 Test Report - Fault/Powerdown File ' ' ' ' ' ' ' ' * * * * * * * * S:22 Max Observed Scan Time S:23 Average Scan Time S:24 Index Register S:25-26 I/O interrupt Pending S:27-28 I/O Interrupt Enabled S:29 User fault routine file number S:30 Selectable Timed Interrupt Interval S:31 Selectable Timed Interrupt File Num ' * S:17 Test Single Step - Start at file nu ' ' ' ' ' ' ' ' ' ' ' * * * * * * * * * * * S:3 Current and Watchdof Scan Timers S:4 Timebase S:5 Minor Error Bits S:6 Major Error Bits S:7 Suspend Code S:8 Suspend File S:9-10 Active Node Table S:11-12 I/O slot enable/disable flags S:13-14 Math Register S:15 Node Address S:16 Test Single Step - Start at rung nu

' * S:32 I/O Interrupt Executing ' * S;33 Extended Processor mode, Status and ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' * * * * * * * * * * * * * * * * * * * * * * * * S:34 S:35 S:36 S:37 S:38 S:39 S:40 S:41 S:42 S:43 S:44 S:45 S:46 S:47 S:48 S:49 S:50 S:51 S:52 S:53 S:54 S:55 S:56 S:57 Reserved Current Scan Time (in ms) Extended Minor Error Bits Calendar Year Calendar month Calendar Day Time of Day Hours Time of Day minutes Time of Day Seconds Reserved Reserved Reserved Dll File Number Dll Input Slot Dll Mask Dll Compare Value Dll Down Count Return Mask Dll Accumulator Reserved Reserved Last Dll ISR Scan Time Maximum Dll ISR Scan Time Processor Operating System Catalong

ProcessorOSSeries As Integer ' eries ProcessorOSRelease As Integer ' Number HardwareCat As Integer ' HardwareSeries As Integer ' HardwareRevision As Integer ' UserPrgType As Integer ' UserPrgFunctionIndex As Integer ' UserRAMSize As Integer ' FlashEEPROMSize As Integer ' CH0_NodeTable(0 To 15) As Integer End Type

* S:58 Processor Operating System System S * S:59 Processor Operating System Release * * * * * * * ' S:60 Hardware Catalog Number S:61 Hardware Series S:62 Hardware Revision S:63 User Program Type S:64 User Program Functional Index S:65 User RAM Size S:66 Flash EEPROM Size * S:67-82 Channel 0 Active Node Table

You might also like