Home
SIMATIC TIWAY Host Software for PC User Manual
Contents
1. V V V CNFGNM a nnnnn Figure 9 6 ALCNMB and CNFGNM Record Formats 9 6 Network Autoconfiguration File TIWAY Host Software for PC User Manual Comments Record Editing END Record TheEND record Figure 9 7 completes the definition for a particular UHA Figure 9 7 END Record Format EOF Record TheEOF record Figure 9 8 marks the end of the Network Autoconfiguration File Figure 9 8 EOF Record Format You can add comments to the Network Autoconfiguration File This is achieved by placing a in column 1 of the record As with the template records these records are treated as non data records by the network auto configuration process and ignored Any VMS Editor may be used to edit the Network Autoconfiguration File Data records must have the identifier field in columns 1 6 Data field entries must be confined to the columns delineated by the template and must be within the specified range Be careful not to disturb the template records These records must contain a in column 1 If comment records are added a must be placed in column 1 Any deviation from the above rules results in abnormal termination of the network auto configurati on process Error messages are displayed to aid in identifying the error condition s TIWAY Host Software for PC User Manual Network Autoconfiguration File 9 7 9 3 Network Autoconfiguration Process Once edited the Network Autoco
2. RS 0001 RS Oxxx 000x eeee ssss ssss rrrr rrrr AA 0001 cccc nnnn nnnn nnnn nnnn pvad pvad spad spad vfad vfad rate rate cflg cflg pvlo pvlo pvhi sphi sphi splo splo hial hial loal hhal hhal llal llal ydal ydal odal rate rate aldb aldb pvhi loal oda l Figure 6 9 560 565 Extended Upload File Format TIWAY Host Software for PC User Manual File Transfer Subroutines 621 Transfer File Descriptions continued repeat for each SF program repeat for each SF subroutine T O Configuration cccc nnnn nnnn nnnn 00ee 00ss aaaa aaaa dddd dddd dddd dddd PPPP 0000 dddd dddd dddd dd ccecce nnnn nnnn nnnn 00ee 00ss aaaa aaaa dddd dddd dddd dddd dddd dddd dddd dd channel base slot OE OE jj ii pp ii pp where jj 0j dddd 0j where nnnn tttt tttt dddd dddd dddd dddd nnnn ELLE tttt dddd dddd dddd dddd ii pp pp pp more to follow finished start address returned address dddd returned address status value address 1 1024 address 1025 8192 word force status value aaaa Figure 6 9 560 565 Extended Upload File Format continued 6 22 File Transfer Subroutines TIWAY Host Software for PC User Manual TAG NAME HWY STA 07 22 TIME 22 JUL 1995 10 54 53 07 MODEL 65 CONFIG 00004800 00001400 00002000 00000800 00000106 00001000 L 00000001 8206 048C 8206 L 00000009 0064 0064 00C8 L 00000011
3. TheFortran dedarations are determined according to Figure 3 1 MS FORTRAN does not support type byte All arguments declared as type byte above should be declared as integer for MS FORTRAN 3 ThePascal dedarations are determined according to Figure 3 2 3 6 TIWAY Subroutine Calling Arguments TIWAY Host Software for PC User Manual Table 3 2 Argument Reference List for Fortran and Pascal continued Declaration Declaration argament petnitions etant ramas access fmt from nnnn number of data elements integer 2 integer read write pattern pattern to fill memory with byte array integer read write SS CIM function option code integer 2 array integer read only str128 error message byte array string128 read only taglst array of addresses integer 2 tag array read only tibuf conversion buffer byte array S bary275 read write 500 505 format Diagnostics nblks maximum number of data integer 2 integer read write acquisition blocks allowed Network Access 1 TheFortran dedarations are determined according to Figure 3 1 MS FORTRAN does not support type byte All arguments declared as type byte above should be declared as integer for MS FORTRAN 3 ThePascal dedarations are determined according to Figure 3 2 TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 7 Reference List of Arguments continued Table 3 2 Argument Reference List for Fortran and Pascal continued TT Declaration
4. NOTE ThelBM program includes two files BASIC COM and BASICA COM One of these files must be renamed to BASI C EXE Procedure Thefollowing gives the procedure for starting up BASIC 1 Put the disk containing your licensed copy of MS BASIC intothe floppy disk drive which should be drive A and close the drive latch Make certain you are in the TI WAY directory If you are not type the following commands E gt CD get into the root directory E gt CD TIWAY get into the TIWAY directory Copy MS BASIC tothe TI WAY directory as follows E gt COPY A BASIC EXE E You should get a response from the computer telling you how many files were copied Execute the TIBASIC EXE program to start BASIC and load the subroutines E gt TIBASIC If all goes well the BASIC interpreter should respond with an editor screen and prompt OK Start building your program using the following commands to access the TIWAY subroutine library Two methods are shown below Method 1 10 DEF INT Define variable as integer 20 DEF SEG amp HO Set segment pointer to point 30 REM to memory address 0 0 40 PEEK amp H3E1 2564PEEK amp H3E0 Get high and low byte of 50 REM starting address 60 DEF SEGA set segment pointer to TI WAY 70 REM starting address M ethod 2 10 CHAIN MERGE DEF BAS 20 ALL DEF BAS define 20 GOSUB 65000 TIWAY entry points starts at 65000 TIWAY Host Software for PC User Manual Installation 1 2
5. Table 4 3 CIM Functional Command Code Subroutines Subroutine CIM Functional Command hex Description CCUSTS Do 8 Reads the attached PM550 status CIMDNL 65 Downloads instructions or data into a PM 550 Reads consecutive memory locations or V C 62 image register e Y CIMRD 60 V C A memory ar a locations from the specified CIM based CIMPUL Uploads instructions or data to the host computer from a PM550 CIMWR 63 image register Writes to consecutive memory locations for V C 61 V C A memory A memory locations in the specified attached device RDLOOP PA Reads loop parameters from a PM550 RNDRD1 Defines a data acquisition block in a PM550 RNDRD2 subcommand 00 RNDRD2 6D gathers a block or group of blocks previously subcommand 01 defined using RNDRD1 or RNDRD3 Gathers data from a block of data acquisition blocks RNDRD3 specified by a mask and defines new data acquisi e ae 02 tion Blocks Writes to a set of sequential memory locations and RNDRD4 subcommand a A C A memory gathers data from one or more data acquisition subcommand 04 image registers blocks specified by a mask 4 16 TIWAY Interface Subroutines Topical TIWAY Host Software for PC User Manual CIM Functional Command Subroutines continued CCUSTS CIMDNL CIMRD CIMUPL CIMWR RDLOOP RNDRD1 The CCUSTS subroutine reads the attached PM550 Command Control Unit s CCU status CCUSTS is the implementation of CI
6. amp istat amp xtn tiway tixtnw amp istat amp xtn tixtn amp istat amp xtn tixtnw amp istat amp xtn Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xin Supply the transaction number returned from the first half TIWAY Host Software for PC User Manual Subroutine Library 10 53 10 42 UPLOAD TheUPLOAD subroutine uploads the contents of a Secondary to a text file on the host system This procedure is intended as a backup function for Secondary programs Call Format BASIC and CALL TIWAY UPLOAD istat tag ftype flen fnam pnlen pname FORTRAN CALL UPLOAD istat tag ftype flen fnam pnlen pname Pascal TIWAY UPLOAD istat tag ftype flen fnam pnlen pname UPLOAD istat tag ftype flen fnam pnlen pname C tiway upload amp istat amp tag amp ftype amp flen amp fnam amp pnlen amp pname upload amp istat amp tag amp ftype amp flen amp fnam amp pnlen amp pname NOTE For BASIC programmers Because BASIC implements dynamic strings force an extra character preferably a blank at the end of the string variable containing the tag Example TAG six blanks Input TAG or TAG 0102 This step is required because the TI WAY library tests the sixth character in a tag to determine le
7. nnnn The nnnn argument defines the number of data element locations to write wi135 The write buffer contains the data to be written in the host data format The buffer either should be allocated in the same variable type as the converted data or be made equivalent to data of that type This allows easy manipulation of the data stat The Secondary status argument contains the code for the current state of a specific NI M based attached device Current state means the state the device is in when the response to the subroutine call is returned Current state is returned for all attached devices except Series 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the state that is returned is the state that existed before the subroutine call was issued Table 3 7 shows the seven possible values Related Calls If data conversion is not required the TI WRIT subroutine can be used 10 50 Subroutine Library TIWAY Host Software for PC User Manual 10 39 TIREAD Call Format Notes on Call Format Related Calls TheTIREAD subroutine reads consecutive memory locations from a specified NIM based attached device Data are returned in the 500 505 format as an array of bytes TIREAD is an implementation of Primitive 20 BASIC and CALL TIWAY TIREAD gt istat xtn tag nnnn rsplen rsp275 sstat FORTRAN CALL TIREAD istat xtn tag nnnn rsplen rsp275 sstat Pascal TIWAY TIREAD istat xtn tag nnnn rsplen rsp2
8. Pascal TIWAY DNLOAD gt istat tag ftype flen fnam DNLOAD istat tag ftype flen fnam C tiway dnload amp istat amp tag amp ftype amp flen amp fnam dnload amp istat amp tag amp ftype amp flen amp fnam NOTE For BASIC programmers Because BASIC implements dynamic strings force an extra character preferably a blank at the end of the string variable containing the tag Example TAG six blanks Input TAG or TAG 0102 This step is required because the TI WAY library tests the sixth character in a tag to determine length Explanations of the terms used in the call format follow istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination tag Theshort form of the tag highway and address can be used Since DNLOAD is written in FORTRAN thetag argument must be passed by descriptor See the programming manual for thelanguage you are using for information on passing arguments by descriptor TIWAY Host Software for PC User Manual ftype 20 21 22 90 91 92 93 94 95 96 97 98 99 24000 Specifies what type of download is requested according to its value Declaration integer generic download of all memory generic download of program memory generic download of data memory download all memory except WXY IR WF partial download L memory partial download V memory p
9. 2 2 Chapter 2 Overview TIVAY System Characterislics ccoocccccccccnr eee nn 2 2 Host Software Functions essem nuh rara raura rar raa 2 3 Levels of Communication Lo aana a eee ee ee e 2 3 Languages Supported oc che iia pee e RR HERR Ua ale ADR E 2 5 Data Format Gonverson 15 erae acci cic a c a CR dcn 2 5 TIWAY Host Software for PC User Manual Overview 2 1 2 1 2 2 TIWAY System Characteristics Overview TIWAY is aLocal Area Network LAN that is designed for industrial environments The TI WAY network connects a series of 500 505 Secondaries with a host computer Secondaries include such devices as programmable logic controllers Unilink Secondary Adapters and I T Micro Remote Control Units With the network you can obtain modify or replace data stored in any of the following Secondaries e SIMATIC 500 controllers e SIMATIC 505 controllers e Non Siemens equipment through a Unilink Secondary Adapter e T 160Micro Remote Control Unit TIWAY is a multiple hosted network meaning that several host computers can direct and collect information from Secondary devices With appropriate host software a TI WAY operator can program monitor and control any Secondary on the network from a single location NOTE In this document the term Secondary is used to refer to both the attached device and the interface module TIWAY Host Software for PC User Manual 2 2 Host Software Functions The TIW
10. 21LDDDDDDDD 21DDDDDDDD or 21F LDDDDDDDD PM550 CCU Task Codes D 5 Table D 1 CCU Task Codes for PM550 continued Meaning Task Code Read User Memory V C or A 22AAAAN 22DDDD AAAA E000 E7FF V E800 EFFF C 1K F000 F7FF C 2K F800 FBFF A Optional number of contiguous words to be read 1 F Value at one address Read Random Memory 23AAAAAAAA 23DDDDDDDD V C or A Rev 8 0 only E000 E7FFF V E800 EFFF C 1K E800 F7FF C 2K Data read Write User Memory V C or A 24AAAADDDD 24DDDD AAAA E000 E7FF V E800 EFFF C 1K E800 F7FF C 2K F800 FBFF A Data to be written Fill User Memory with Ones 26AAAANNNNFFFF 6AAAANNNNFFFF AAAA E000 E7FF E800 EFFF E800 F7FF F800 FBFF Number of contiguous locations to fill 1111111111111111 Read Status of Timer NN 27PPPPCCCCF Number of counter 1 F 1K 2K V C C A Preset value Current value Not protected and CCU is executing ladder logic Protected and CCU is executing ladder logic Not protected and CCU is not executing ladder logic Protected and CCU is not executing ladder logic D 6 PM550 CCU Task Codes TIWAY Host Software for PC User Manual Table D 1 CCU Task Codes for PM550 continued TE Write Timer Preset Value 28NNPPPP 28PPPPF Number of timer 1 F Preset value Not protected and CCU is executing ladder logic Protected and CCU is executing ladder logic Not protected an
11. Base HIU AC Command The activate command is used to connect a Secondary or Commands Secondaries to the specified highway allowing communication between the host computer and the Secondary Prompt TIPROG gt AC List of Secondaries free format hex LIST 2 Response List of connected Secondaries 1 Secondaries connected 02 TIPROG gt or Prompt TIPROG gt AC List of Secondaries free format hex LIST 01020304 Response List of connected Secondaries 4 Secondaries connected 01 02 03 04 TIPROG gt TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 21 TIPROG Utility continued AD Command The adapter diagnostics command the equivalent of the ADIAG subroutine requests a Host Adapter diagnostics list The statistics that are returned have been collected by the Host Adapter about its network usage The AD command is the implementati on of command code 08 Prompt TIPROG gt AD Response Host Adapter diagnostics decimal Invalid host commands 0 Send information commands 531 Broadcasts Poll Secondaries Connects Disconnects Read Secondary logs Read Secondary diagnostics Read adapter diagnostics Reset adapters oO O re Ne HUuUOZO Total poll cycles Total frames transmitted 531 Timeouts o frames received 531 Retransmissions Receiver errors Transmit errors Secondary initializations oO uoo o Current clock high low TIPROG gt 7 22 Interactive Operator Utilities TIWAY Host
12. Boolean Discrete output Y memory Boolean Discrete control register CR memory L 3 sese eie vie L y L9 sem REE oc Boolean CR forced 3b me WaSucb OE integer Timer counter preset 10 1 Drum step preset 11 1 Drum step current 12 1 Drum count preset 13 integer Timer preset 14 integer Timer current 15 integer Counter preset 17 long integer Secondary system status 1 See the individual NIM user manuals for the subset of data element types supported in each Secondary and format description 2 This data element type is available in CI M based attached devices 3 These are used in attached devices controllers that do not have mutually exclusive numbered timers and counters 3 14 TIWAY Subroutine Calling Arguments TIWAY Host Software for PC User Manual Table 3 4 Data Element Types continued Data Element Type in hex o Format Data Element Description 2E2 long_integer Loop C flags status 30 real Loop error 32 real Loop High High Alarm Limit 33 real Loop Low Low Alarm Limit 34 real Rate of Change Alarm Limit 35 word_integer Loop Mode 36 1 Ramp Soak step Ramp Destination Setpoint 3 res ECT 3x 7m AAHshMemUmt 1 See the individual NIM user manuals for the subset of data element types supported in each Secondary and format description 2 The Series 500 loop C flags are most directly related to but not compatible with the primitive data element
13. EILESIATUS C Oria tid 4s e ei cio eS Sv ance det E Orc d Cea ecc die Cg USTEOMMANDO ER T RETE diia ed eiii STATISTICS Co UPLOAD Command ceo ce ace ce cro EY a se a E c ced VERIFY Command 2 ice ce Sp iie CES Ic EE dece AA e eG RE Meta ORG PR QUIT Comma TIPROG Utility Session Control Commands sssee a eren Host AdapterCommands urs esii pisii iiini ea e iia A ii aN Base HIU Commands cur e ara a E bae E ioco Dora Re ra cea acc ad TIWAY Primitiv CIM Function Support C omrmniatids co Roca See ences e eh e E e t d dade oed va Chapter 7 Interactive Operator Utilities GreTnaInsizinio MOT TIM AIA 225 cm ie cic t e EU cce eic ER t a c I cc e Cice n A NE NN SCOMMAN S s med eet cc A d ca et ce C al Comimalids 25er tici mo VIRI ome den e rr E t ide TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 1 7 1 Using TIUSER and TIPROG Two Interactive Operator Utilities TIUSER and TIPROG are generic to the TIWAY Host software package These utilities allow a standard interface to common network functions and require no applications programming TIUSER and TIPROG commands are presented in alphabetical order Examples of user responses to utility prompts are also included Table 7 1 provides basic information on using the two utilities Table 7 1 Using TIUSER and TIPROG The utility prompt is TIUSER gt TIPROG gt To exit utility issue QUIT TRL TAL e TIUSER Section 7 2 provides ne
14. SECLOG istat xtn hwy rilen ri254 SECLOG istat xtn hwy rilen ri254 C tiway seclog amp istat amp xtn amp hwy amp rilen ri254 seclog amp istat amp xtn amp hwy amp rilen ri254 Explanations of the terms used in the call format follow istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion hwy Specifies the logical highway number which is used to communicate to the device setup for communications For the PC version of the TIWAY package hwy is always set to 1 ilen The rlen argument identifies the number of Secondaries currently connected to the highway If none are connected rilen 1 because ri254 1 0 11254 The addresses of the Secondaries currently connected to the highway are contained in this buffer 1254 is an array of integers Each element in the array up to the number specified in rilen contains the number of a connected Secondary in integer format The ACTVAT and DEACT subroutines can be used to connect or disconnect Secondaries from the highway TIWAY Host Software for PC User Manual 10 36 TI2HST Call Format Notes on Call Format Related Calls The TI2HST subroutine converts a list of data of a single type from 500 505 format to host format The only subroutine that converts a list of retu
15. TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 25 TIPROG Utility continued TIVAY Primitive Commands Prompt TIPROG gt XP Command buffer free format hex CMD FF Error checking types 0 No checking 1 Check for Host Adapter Command Code errors 2 Check for NIM Primitive H ost Adapter errors 4 Check for CIM Functional Command H ost Adapter errors Error checking type 0 1 2 4 1 Response Response buffer 1 bytes received FF TIPROG gt The TIWAY Primitive commands determine and assess the performance of NIM based attached devices on a network You should refer to the associated user manuals for the attached devices for further information on the Primitive commands supported by the devices CH Command The change state command is used to change the operational state of a specified Secondary The Secondary must be in a spedific state before it is able to perform certain functions The CH command shows you a list of Secondary states and a list of operational states Fill in the code for the Secondary state you wish to change to selecting from the codes in the Secondary state list You are also shown a code for previous operational status this code is taken from the operational status list The CH command is the implementation of Primitive 10 TIPROG gt CH Tag specifier 0102 Secondary state DD Operational status HH 00 Execute logic and loops 00 Executing logic and loops 01 Execute loops o
16. TIWAY Subroutine Calling Arguments The calling arguments used in the TIWAY Interface Subroutines are described in this chapter The argument descriptions are grouped by function for instance all buffer arguments are described in the section entitled Buffer Specification A thorough understanding of the functions of the arguments is essential for effective use of the TI WAY Interface Subroutines In addition to the descriptions three reference tables are provided Table 3 1 lists each subroutine and the arguments it uses and Table 3 2 and Table 3 3 list each argument and its description declaration Fortran Pascal BASIC and C and access Refer to the appropriate Secondary manual and tothe SIMATIC Unilink Host Adapter User Manual for more assistance in using these tables NOTE Chapter 3 describes all calling arguments used in the TI WAY Interface Subroutines the subroutines contained in Chapter 4 However the TI WAY Support Routines described in Chapter 5 use arguments that do not occur in the Interface Subroutines Therefore the arguments used in the Support Subroutines are defined in the Notes on Call Format section of each Support Subroutine see Chapter 10 TIWAY Host Software for PC User Manual 3 2 Reference List of Subroutines and Arguments Reference List Table 3 1 Subroutines and Arguments Reference List Subroutines Name Description TIPROG Session Control INIT IN istat xtn portstr Initializes subrout
17. lsssssssssss nn 5 3 Partial Memory TransferCodes ti ccc eese 6 2 Memory Selectable forUpload sssssssseeeeeeee m m 6 3 Memory Selectable for Download sssseeseeeeeeeen e 6 3 Allowable Cross Device Memory Transfers 0 0 0c ccc c cece cece e ence ee 6 4 Memory Selectable forGeneric Upload Download sssaaa 6 5 Using TIUSER and TIPROG ssssssseee he 7 2 Alphabetized List of USER Commands sssssssssee n 7 3 Alphabetized List of IPROG Commands with Subroutines and Primitives 7 17 Host Adapter Command Code S ccc cece cece rr A 1 TIWAY Primitives Universal Command Language ssissssss ee CIM Functional Command Codes cece ccc cece ete nn C 1 CCU Task CodesforPM550 siii a a ech d ke D 1 Facility 1 TWAY Internal to TIWAY Subroutine Library Emors 0 E 2 Facility 2 NETEXC EPT Host Adapter Network Exception Errors o o o E 5 Facility 3 INTERNEXCP Host Adapter Adapter Internal Exception Emors E 6 Facility 4 HOSTEXC EPT Host Adapter Host Exception Errors 0 0000 ceca E 8 Facility 5 PRIM MVE TIWAY Primitive Emors 0 cece eee eee nnee E 9 Facility 7 l O Status Emorlistings sssssssseeee eee n E 12 Facility 8 CIM EXCEPT CIM Functional Command Emors 0 0 cece eee E 13 Contents Preface The SIMATIC TIWAY Host Software Package for personal computers PCs presents a unifie
18. rsp275 The rsp275 argument contains the gathered data in 500 505 format The CI MWR subroutine can be used to write the same set of locations TheRNDRDx series of subroutines can be used to gather multiple consecutive sets of the same data accessible through CIMRD TIWAY Host Software for PC User Manual 10 9 CIMUPL Call Format Notes on Call Format Related Calls The CIMUPL subroutine uploads one or more memory areas from a PM 550 Refer tothe CIM User Manual for more information on the procedures BASIC and CALL TIWAY CIMUPL istat xtn tag ss rsplen rsp275 cstat mm FORTRAN CALL CIMUPL istat xtn tag ss rsplen rsp275 cstat mm Pascal TIWAY CIMUPL istat xtn tag ss rsplen rsp275 cstat mm CIMUPL istat xtn tag ss rsplen rsp275 cstat mm C tiway cimupl amp istat amp xtn amp tag amp ss amp rsplen amp rsp275 amp cstat amp mm cimupl amp istat amp xtn amp tag amp ss amp rsplen amp rsp275 amp cstat amp mm Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used ss The ss argument is a code used to describe the operation Valid values in hex are ss function 00 initial
19. 00 FF 00 FF 001F 5449 4D20 4455 4E 001F 001F 00 F 00 F 0001 24 0001 24 F 5449 4D20 4455 4E4E 0001 24 F 01 07 00 FF F 00 FF 24 24 700A 1F00 0B14 1312 1124 24 00 FF L 00 00 L 00 00 00 Figure 6 8 565 Non extended Upload File Example continued File Transfer Subroutines TIWAY Host Software for PC User Manual TAG NAME HWY STA TIME MODEL CONFIG hhaa hh aa 60 65 where ECCE drmm sreg tmov ones dd mmm yyyy hh mm ss ss 11111111 vvvvvvvv cccccccc tctr drmm sreg tmov ones ssssssss tttttttt number of number of number of number of number of ba Dap ea op Ls Up Lp timer counters drum edrums shift registers table moves one shot instructions SSSS size of S memo ry tttt size of total memory MEMORY Configuration 0000001 mmmm mrmm 11111111 00000001 VVVVVVVV nnnn 00000001 kkkk nnnn kkkk nnnn nnnn kkkk kkkk nnnn nnnn kkkk kkkk nnnn kkkk nnnn kkkk kkk kk nnnn nnnn n Kkkk kkkk kkkk kkkk nnnn nnnn nnnn nnnn ecccccce kkkk kkkk 0001 nnnn nnnn CCCC 133 LP 0001 nn nnnn nnnn nnnn nnnn nnnn nnnn nn nnnn nnnn nnnn d spad vfad vfad otad srsr srsr cf sphi sphi spl hhal hhal 1j rocl rocl al rset rset rat 000x eeee ssss SSSS rrrr rrrr pvlo hial ydal gain
20. 3 retries and a timeout of 10 hex A seconds per try The maximum timeout period is 15 seconds The port set up string must be fully specified in order for the TIWAY host package to communicate with the network Related Calls TheINIT subroutine must have already been called to use all other subroutines in the TI WAY Host Software Package Before the portstr parameter can be changed the FIN subroutine must be called 10 30 Subroutine Library TIWAY Host Software for PC User Manual 10 22 LKUFMT Call Format Notes on Call Format TheLKUFMT subroutine returns information on data element format BASIC and CALL TIWAY LKUFMT istat xtn tt fmt tilen hostlen cimtyp FORTRAN CALL LKUFMT istat xtn tt fmt tilen hostlen cimtyp Pascal C TIWAY LKUFMT istat xtn tt fmt tilen hostlen cimtyp LKUFMT istat xtn tt fmt tilen hostlen cimtyp tiway Ikufmt amp istat amp xtn amp tt amp fmt amp tilen amp hostlen amp cimtyp Ikufmt amp istat amp xtn amp tt amp fmt amp tilen amp hostlen amp cimtyp Explanations of the terms used in the call format follow istat xtn tt fmt tilen Error codes are returned in the status field Declaration integer The transaction number must be zero Declaration integer The tt argument supplied by the caller is the data element type specified in NIM format All other arguments contain data corresponding to this data
21. Calling Arguments TIWAY Host Software for PC User Manual Table 3 1 Subroutines and Arguments Reference List continued Subroutines Name Arguments Description TIPROG Status and Support Routines continued TIXTN istat xtn Performs I O with return before completion TIXTNW istat xt Performs I O and waits for completion TI2HST istat xtn tt nnnn tibuf hstbuf Converts data from 500 505 format to host format File Transfer DNLOAD istat tag ftype flen fnam Downloads file to a Secondary UPLOAD istat tag ftype flen fnam pnlen pname U ploads file from a Secondary TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 5 3 3 Reference List of Arguments Table 3 2 contains the Argument Reference List for Fortran and Pascal Table 3 2 Argument Reference List for Fortran and Pascal Declaration Declaration Argiment gt etinion etam jen access Addressing tag address specification Buffer Specifications Command Buffers ZE Read Buffers ri4 response buffer integer 2 array ri32 response buffer integer 2 array iary32 read write ri254 response buffer integer 2 array iary254 read write rilen response buffer length integer 2 integer read write Response Buffers rsp275 response buffer byte array bary275 read write rsplen response buffer length integer integer read write o WiBdfas wb275 write buffer byte array S bary275 read ie rebate memanmy ey ped 1
22. HIU A async S sync F full duplex H half duplex 0 NRZ RTS CTS After CTS NRZI Delay Delay A S F H 0 1000 0 1000 MEE V V V V V CFGHIU a nnnnnn HIU Configuration HIU bandwidth max i outstandingoutstanding repetitiverequests per macros secondary 0 254 0 254 V V V ALCHBW nnn Figure 9 5 CFGHIU and ALC HBW Record Formats TIWAY Host Software for PC User Manual Network Autoconfiguration File 9 5 Network Autoconfigure File continued ALCNMB and CNFGNM Records The ALCNMB and CNFGNM records are used to configure either a NM or a MHIU Figure 9 6 shows examples Unilink Host Adapter kckck ck NM CONFIGURATION Configuration HIU buffer allocation and channel selection NOTE repeated for each HIU on network U Issue Preferred Address BuffersDisconnect Channel 0 254 1 254 Y N A B VV VV V V a ALCNMB nnn nnn a NM Configuration channels A async S Sync F full duplex H half duplex O NRZ RTS CTSAfter CTS around 1 NRZI Baud Delay Delay A S F H0 1 Rate 0 1000 0 1000 1 5000 V V V V V V V V V V V a a n nnnnnn nnnn NM Configuration channels Autoredundant Enable Poll Poll Maximum Must Option DISC BufsDelay Period Poll TimeBe N Retries Y N Y N 1 254 0 5000 0 500 0 40000 Y N 0 16
23. Interpretive e BASIC for IBM PC XT Interpretive e Compiled BASIC e MS FORTRAN e MS Pascal e LatticeC e Microsoft C With the exception of Interpretive MS BASIC programs in all of the languages listed above must be compiled and linked with one of the supported compilers BASIC programs may be executed in either interpretive or compiled versions For additional information regarding language support refer to the readme file NOTE The software listed above may be purchased from your local computer dealer Support for QUICK BASIC and Turbo Pascal is provided using a limited subset of this package which includes only the functions INIT XPAR and FIN 1 12 Insta lla tion TIWAY Host Software for PC User Manual 1 5 Using a Compiled Language There are four steps to creating a compiled program These are l Writing 2 Compiling 3 Linking 4 Running You should refer to your appropriate language manual for writing and compiling The purpose of this chapter is to provide the link order for your TIWAY Host Software program concentrating on exceptions to standard procedures for writing compiling linking and running the TI WAY Host Software If you have questions after reading the remainder of this chapter call the number listed under Customer Support in Section 1 1 TIWAY Host Software for PC User Manual Installation 1 13 1 6 Program Linking Object Code Files Linking on the PC 1 14 Ins
24. Read status RDSTS 4 13 7 29 10 2 ens atus RDSTS 4 13 7 29 meron Requirements INIT hardware 1 2 LKUFMTI103I software 1 3 LKUTGL 10 32 EEE dr im RNDRD2 POLL 4 9 10 35 RNDRD3 4 15 4 17 10 42 10 43 PUTMSG RNDRDA Z IS 417 10 44 10 45 Or Run mode See CHNGST RNDRD1 4 15 4 16 10 40 RNDRD3 S RNDRD4 4 17 10 44 SDIAG 4 9 10 45 SDIAG 10 45 SECLOG 10 46 SECLOG 10 46 Tice 10 47 Secondary TI PUT data format 2 5 TIREAD 4 14 10 51 dido TIWRIT 2 14 10 52 Secondary diagnostics SDIAG 4 9 7 24 10 45 TIXTN 10 53H Secondary log SECLOG 4 10 7 25 10 46 Meu EE iE Software requirements 1 3 WRBUF 4 14 10 56 10 57 TO sstat 3 30 WRTGAT 4 14 10 58 110 59 4 10 10 60 10 61 Statistics host adapter network activity 10 5 f nes and arguments reference list Status determi nation 3 28 Subroutine n m ACTVAT I 8 10 4 Switches Unilink dipswitches H 1 ADIAG 4 8 10 5410 6 Synchronous 3 27 Index 3 T Tag names defining 8 2 Tag table accessing 1 26 building 8 3 creating Technical support 1 3 TI to host TI 2HST 7 39 10 47 TI2HST 10 47 TIGET 4 13 7 30 10 48 TIPROG 7 39 TIPROG Commands CIM Commands TIPUT 4 13 7 30 10 50 Index 4 TIREAD 4 14 7 30 10 51 TIUSER 7 15 TIUSER Commands TIWAY primitives B 1 B 3 TIWRIT 4 14 7 31 TIXTN TIXTNW 10 53 U Unilink adapter
25. TAG NAME aaaa HWY STA nn nn TIME dd mmm yyyy hh mm ss ss MODEL 100 CONFIG 1111 vvvv 0000 0000 0000 tttttttt where tttttttt size of total memory dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd xample above depicts the binary format Logro VYYY WW aaaaa aaaaa YYYY WW yyyy WW D yyyy ww zz aaaaa aaaaa Th xample above depicts the ASCII format Figure 6 15 Unilink Generic Upload File Format 6 30 File Transfer Subroutines TIWAY Host Software for PC User Manual 0201 02 01 22 SEP 1995 12 44 28 49 100 04E0 03AB 0000 0000 0000 00001000 0000 00 00 00 04 00 00 00 01 04 0 06 04 06 00 60 07 00 00 04 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 04 00 04 00 00 00 04 00 00 00 04 00 04 00 00 00 00 00 04 00 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 04 00 00 04 00 00 00 00 ol o a O A 0001 00 00 D qO 10 1070 G O OGO G CO G iO OO 49 OO O O OC 0 O bO OGOGO M ooo OO 00 00 00 OC C C 410 0 0 0 0 0 0 0 0 0 0 0 0 0 0 CO m C O Co XC O Gob O OO C Co Q O0 OO OO Oc OC OH O OQ O OQ Oo OC oc OOo CO OOO Oo 0009 00 00 000A 00 01 CX Gy oO OI C OI C2 P 0011 00 01 Figure 6 16 Unilink Gene
26. The mask contains the bit mask taken from the list argument Declaration integer 4 FORTRAN packed array 1 32 of Boolean Pascal it The list argument is a 32 word integer array Each element of the array contains either a valid block number in the range of 1 to 32 or a zero For each valid block number the corresponding bit in the mask argument is set Dedaration integer FORTRAN array 1 32 of integer Pascal initialize LIST to O LIST 1 3 LIST 2 5 LIST 3 11 CALL BLDMSK MASK LIST include block 3 include block 5 include block 11 build mask CALL GATHER ISTAT 0 TAG MASK RSPLEN RSP275 TIWAY Host Software for PC User Manual Useit Subroutine Library 10 7 10 4 BRDCST Call Format 10 8 Subroutine Library The BRDCST subroutine broadcasts the user specified command buffer to all Secondaries on the specified highway The command buffer must be one that all the Secondaries can interpret Using BRDCST lowers the overhead associated with long command buffers that are issued to several Secondaries BRDCST is the implementation of command code 02 NOTE The Secondaries do not immediately respond to the broadcast the individual responses must be solicited using POLL PM550 CI Ms PPX PM 550 502 and PPX PM 550 503 do not support the BRDCST subroutine and ignore all broadcast messages PM550 NIMs PPX PM 550 5038 PPX PM 550 5039 and PPX PM550 5040 support BRDCST The BRDCST ro
27. Thetagls argument is an array of addresses of the tags that identify the data element type and starting data element location for each of the blocks defined The array contains an address for each of the blocks defined nblk elements Each array element must contain a full long tag specification nnnnlst The nnnnist argument is a list of bytes Each array element specifies the number of data elements to be included in a particular block The array is nblk elements long 10 20 Subroutine Library TIWAY Host Software for PC User Manual stat The Secondary status argument contains the code for the current state of a specific NI M based attached device Current state means the state the device is in when the response to the subroutine call is returned Current state is returned for all attached devices except Series 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the statethat is returned is the state that existed before the subroutine call was issued Table 3 7 shows the seven possible values Related Calls The GATHER subroutine can be used to read the data defined by DEFBLK TIWAY Host Software for PC User Manual Subroutine Library 10 21 10 14 DNLOAD Call Format Notes on Call Format 10 22 Subroutine Library The DNLOAD subroutine is used to download a previously uploaded fileto a Secondary BASIC and CALL TIWAY DNLOAD istat tag ftype flen fnam FORTRAN CALL DNLOAD istat tag ftype flen fnam
28. Upload all memory 2 Upload Program M emory only 3 Upload Data Memory only Enter selection 1 3 1 Response Begin Generic Upload Uploading Program Memory Uploading Data Memory Generic Upload completed TIUSER gt continued on next page TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 13 TIUSER Utlity continued gt gt gt lf answer to generic upload request no Prompt Select transfer code 60 upload all memory 64 upload S memory loop tables 61 upload L memory 65 upload S memory analog alarms 62 upload V memory 66 upload S memory SF programs 63 upload constant memory 67 upload S memory SF subroutines Enter transfer code 60 Response Uploading program Uploading memory type Upload completed TIUSER gt 7 14 Interactive Operator Utilities TIWAY Host Software for PC User Manual VERIFY Command The VERIFY command explains how to verify that the contents of two previously uploaded files are the same When you request VERIFY at the TIUSER prompt a screen explaining the command appears VERIFY is used to verify that a download of the same file was correct before starting the Secondary or to ensure that the correct program revision is currently running on a machine The screen is similar to the one shown below Prompt TIUSER gt VERI Response To verify the contents of a file with controller memory upload controller memory using the TIWAY
29. e Inthe second format all the required link information is entered on the command line separated with commas e Inthe third format place all of the link information in a file then run Link and enter the name of the file Examples of the use of these three formats are given in the following paragraphs TIWAY Host Software for PC User Manual Program Linking continued Using the Link Command For the following discussion you should assume that the program has been compiled using the M S Pascal compiler Sample Link program C gt LINK return Object modules OBJ A ALIGN MSG TIMSGPF YOURPROG TIWAYPF return Run file CL EXE YOURPROG return List file NUL MAP YOURPROG return Libraries LIB Pascal lt return gt NOTE In thefirst line of the above program Link is your response In all second third fourth and fifth lines all data after the is your response with the exception of the lt return gt s Y OURPROG signifies your own program object file The response A ALIGN tells the link program that the ALIGN OBJ fileis on disk drive A The character tells the link program that another file is being added to the object file list Up to eight object files can be linked in this way The same character is also used to access up to eight LIBRARY LIB files in the library list although for this example just one library was used Theinformation contained inside the brackets is the default value
30. loops are being calculated a loop is critical Il NQouanwnro x 0 U D X xxx B X is not E a S D 10 PM550CCU Task Codes TIWAY Host Software for PC User Manual Table D 1 CCU Task Codes for PM550 continued Meaning Task Code Write a Loop 2F LMDDDDDDDD 2F DDDDDDDD or or To eee ne ee 2F FLMDDDDDDDD 2FFDDDDDDDD Indicates presence of 16 loop Loop number 1 16 for 16 loop software Lower display mode Blank do not use Setpoint SP Deviation Output Bias Gain Rate Reset Manual Mode Request Auto Mode Request Cascade Mode Request Closed Cascade M ode 0 1 2 3 4 5 6 7 8 9 A TIWAY Host Software for PC User Manual PM550CCUTaskCodes D 11 Table D 1 CCU Task Codes for PM550 continued Meaning Task Code Read CCU Status Rev 8 0 and later 30 six status words status word 1 000 M ll AAABCDEFGHIJKLMN Idle start Start state Hold state Wait state Run state Remote state Program Mode status Notin Program n Program Switch 1 set for COMM 1dumb COMM 1smart Switch 2 set for COMM 1 300 bps COMM 1 1200 bps Switch 3 set for COMM 2 dumb COMM 2 smart Switch 4 set for COMM 2 300 bps COMM 2 1200 bps Switch 5 set for 2K L memory 4K L memory Switch 6 set for 1K C memory 2K C memory Not defined Switch 8 set for CIM not installed CIM installed Not defined Switch 10 set for DTE DCE C memory in ROM RAM memory
31. upload a memory type that is not configured in the Secondary does not halt the operation which continues to the next memory type However UPLOAD displays a warning message that the memory type was not found Prompt TIUSER gt UPLO Tag specifier 0102 File specification CA TIWY69111 MYFILE EXT Response WARNING UNKNOWN DEVICE TYPE xxx This response appears if the device type is not recognized by the package It is added for support of future products In this case the package attempts a generic upload You can select the Generic U pload configuration 7 12 Interactive Operator Utilities TIWAY Host Software for PC User Manual Prompt Select specific segment upload y n is displayed only for Unilink gt gt gt lf answer yes Prompt Enter program name blanks if not supported Program name AAA AAA Enter segment mask hex HHHH Response Begin specific segment upload Uploading segment 1 mask value HHHH U ploading segment n mask value HHHH Spedific segment upload completed TIUSER gt Response Nosegments specified for specific transfer no bits set in mask TIUSER gt Response WARNING Not all specific segments transferred error in uploading requested segment TIUSER gt gt gt gt lf answer to specific segment upload request no Prompt Select Generic Upload y n gt gt gt lf answer yes Prompt Select Generic U pload configuration 1
32. 0001 0801 4D41 5448 2020 2020 0000 0002 8063 3F00 0000 IN 0000 0021 4C20 5448 4953 2049 5320 IN 5448 4520 4953 4348 4941 1425 1 00 001F 0001 1F00 0318 1C19 1F80 0520 0002 1423 1E00 011F 8002 011F 2C05 1C1F 80DE 081C 1E00 021F 8025 OEIF D90D 191F 6012 0619 1 453B E000 0419 24 1E01 C91F 7FEE 0080 1 801A 1F7F E300 801A 1 801A 1F7F E5 801A 1 1E01 511F 0080 1 01B 1F7F 801B E01 651F 1 0450 lF7F 1C 1 DEOO lF7F 1C 1 D800 631F 1 C300 IETF 18 1 CA00 lF7F 1C 1 C900 ElF 1 1F41 D300 801 D200 401 C800 401 0011 19 Figure 6 10 565 Extended Upload File Example continued TIWAY Host Software for PC User Manual File Transfer Subroutines 6 25 Transfer File Descriptions continued 6 26 zZ z UHUHU UHHHHH 7 iat 24 180D 180D 1816 180D 0806 0406 0C01 5449 4D20 4455 4E E00 001F 0001 24 2 5449 4D20 4455 4E E00 001F 0001 24 3 5449 4D20 4455 4E 1809 oco 1809 oco 1809 OFF7 5449 4D20 4455 4E E00 001F 0001 24 E 5449 4D20 4455 4E E00 001F 0001 24 1809 OFF 1809 il 1 1 E00 E00 E00 1 E00 600C 0 1 1 90D 1 1 1 IOC IOC IOC IOC IOC IOC 85 85 85 85 85FF EF 85F0 ST 0000 DO DF EO OFFE 1809 01 64 091F 091F 091F
33. 009A 7001 0109 565 000003E8 00000800 00001000 0000C800 00040000 64AA 8205 64A0 B101 0001 014D 01BC 7001 002B 7001 7001 0178 7001 O1E7 7002 8000 8000 8000 0000 0506 0003 000047E9 000047F1 000047F9 00000001 00000009 00000011 0004 0004 0017 0159 0285 11AE 000013E9 000013F1 000013F9 00000001 00000009 00000011 D70A CF65 E007 0000 0000 4001 3135 2052 2D53 0000 C 00001FE9 C 00001FF1 C 00001FF9 LP 0001 0004 0000 3C23 D70A 3C23 D70A 3 23 378B 378B E006 6064 7000 0064 7064 0065 4000 000 4049 OFF 4049 OFF 3F80 000 452B CE 0000 00 0000 00 0000 00 0000 00 0000 00 0001 60 0001 60 0 8 3 0 3 3 E23 000 F80 F80 3C23 3F80 3F80 3F80 F80 F80 F80 F80 6064 0000 0000 4049 0057 4049 0057 2141 D70A 0000 0000 0000 0000 0000 0000 0000 3F8 3F8 3F8 3F8 3F8 3F8 3F8 0 0 0 0 0 0 0 4049 OFF8 4000 0057 4049 OFF8 3F80 0000 Figure 6 10 565 Extended Upload File Example TIWAY Host Software for PC User Manual File Transfer Subroutines 6 23 Transfer File Descriptions continued O O Oo C O O e 0 0 0 0 0 0 0 0 0 0 0 0 0 o Iz O O OGG OO SO 2 So O O OO Figure 6 10 565 Extended Upload File Example continued 6 24 File Transfer Subroutines TIWAY Host Software for PC User Manual SFP
34. 03 00 04 00 05 00 00 00 00 00 00 00 00 00 00 00 EO C8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 Interactive Operator Utilities TIWAY Host Software for PC User Manual Support Commands The support commands are general purpose commands that are useful in performing other commands HT Command The host to TI command the complement of the TI to host command converts data from the host format to the 500 505 format The 500 505 format data are required to construct buffers for XP NA BR GA and WG TIPROG HT TT data element type hex 20 Number of data elements deci mal 3 Next real data element 0 0 Next real data element 99 999 Next real data element 1 0 Response buffer hex 00 00 00 00 42 63 FF BE C1 10 00 00 LF Command The look up format command returns information on format returning all elements as integers The format can be decoded using the following list A 01 01 null null bytes no conversion B 02 02 null null words no conversion C 02 02 swap swap integer swap bytes D 04 04 vtff vtff real 4 TI to host format E 203 03 null null triplets no conversion F 01 01 rev8 rev8 bytes bits reversed in field G 04 04 vtff vtff real TI to host format H 04 04 null null bytes no conversion 13 13 vtff vtff real TI to host format TIPROG gt LF TT data element type hex 20 Format D 500 505 length 4 Host length 4 Equiva
35. 3 Download Data Memory only Enter selection 1 3 3 Response Begin Generic Download Downloading Program Memory Downloading Data Memory Generic Download completed TIUSER gt Interactive Operator Utilities TIWAY Host Software for PC User Manual ALESTATUS The FILESTATUS command is used to list the parameters of a previously Command uploaded file These include the date and time of upload the highway and Secondary address and the attached device model This command allows you to check which file is being downloaded to an attached device You are prompted for the file specification filename Prompt TIUSER gt FILE File specification CA TIWY69111 MYFILE EXT File created on 20 DEC 95 10 26 11 Uploaded from highway 1 station 2 model 530 Response TIUSER gt LISTCommand The LIST command is used to list all of the Secondaries connected to a highway Prompt TIUSER gt LIST Response Highway 1 has 1 Secondaries 0 TIUSER gt The number of Secondaries and a list of Secondaries connected to the highway are displayed STATISTICS The STATISTICS command is used to list the attached device diagnostics Command statistics that report the TI WAY network usage reported as an unformatted hex list Prompt TIUSER gt STAT Tag specifier 0102 Response Secondary statistics for tag Number of times polled Number of frames transmitted Number of timeouts Number of frames received Number of frames re transmitted
36. 5 2 Desc riptions of Support Subroutines BLDMSK Subroutine GETMSG Subroutine HST2TI Subroutine LKUFMT Subroutine LKUTG L Subroutine LKUTG S Subroutine PUTMSG Subroutine T12HST Subroutine The BLDMSK subroutine builds a mask from a list of block numbers The GETMSG subroutine returns an error message to the caller in an 128 character string GETMSG is called with the composite status returned in the istat field obtained from a previous call to a TIWAY Subroutine The HST2TI subroutine converts data from host format to 500 505 format The subroutine can convert from one buffer into another or the same buffer can be specified for both source and destination The HST2TI subroutine is the complement of the TI 2HST subroutine TheLKUFMT subroutine returns information on data element format TheLKUTGL subroutine returns address information that describes the address specification passed to it The address specification can be any of the available types tag name ASCII or binary LKUTGL looks up a tag name and determines the address information from the address specifier Long format TheLKUTGS subroutine returns address information that describes the address specification passed to it The address specification can be any of the available types tag name ASCII or binary LKUTGS looks up a tag name or derives the address information from the address specifier Short format The PUTMSG subroutine takes one argumen
37. BLDMSK Subroutine GETMSG Subroutine HST2TI Sub routine LKUFMT Subroutine LKUTG L SUDIOUENE itinerantes LKUTGS SUDTOUUNE a iia ahi pa URS PUTMSG Subroutine TLZHST SUD TOULING a uen ip Ee ETE accen e coa Ea eC P RC a Xon ec Roca Pa cades TIXTN and TIXINW Subroutines TIWAY Host Software for PC User Manual TIWAY Support Routines 5 1 5 1 5 2 Overview The TIWAY Support Subroutines do not correspond directly to any single TIWAY network operation nstead these are general purpose support subroutines These subroutines do not require communication with the Host Adapter The support subroutines indude e A tag conversion subroutine for returning a list of address parameters for a tag specification LKUTGL LKUTGS LKUFMT e Subroutines for converting formats TI2HST HST2TI e A subroutine for building a mask BLDMSK e Subroutines for interpreting error messages GETMSG PUTMSG e Subroutines for calling the second half of a subroutine when using asynchronous completion TIXTN TIXTNW Although the TIWAY Support Subroutines use many of the same arguments that are used in the TIWAY Subroutines arguments unique to the support subroutines also occur Therefore the arguments used by each subroutine are defined with that subroutine and the declaration is included in full detail in the Reference Section Chapter 10 Table 5 1 shows the support subroutines NOTE You must call the INIT subroutine before any of these su
38. Call Explanations of the terms used in the call format follow Format istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used nnnn The nnnn argument specifies the number of data element locations to be filled Each data element is two bytes long wb275 The write buffer contains the data to be written The data should be in the 500 505 format Related Calls The CIMRD subroutine can be used to read from the same set of locations The RNDRD4 subroutine can be used to write the same data simultaneously with the gathering of a data acquisition block 10 16 Subroutine Library TIWAY Host Software for PC User Manual 10 11 CONRG Call Format Notes on Call Format The CONFIG subroutine returns the configuration memory sizes of the specified NIM based attached device CONFIG is the implementation of Primitive 03 BASIC and CALL TIWAY CONFIG istat xtn tag rilen ri32 sstat FORTRAN CALL CONFIG istat xtn tag rilen ri32 sstat Pascal C TIWAY CONFIG istat xtn tag rilen ri32 sstat CONFIG istat xtn tag rilen ri32 sstat tiway config amp istat amp xtn amp tag amp rilen ri32 amp sstat config amp istat amp xtn amp tag amp rilen
39. D 1 Appendix E Enor Listings E1 Facility 1 TIWAY Subroutine Library Exceptions cceeeee eee eee eee E 2 E2 Facility 2 Network Exceptions 00ccccoccocc nmm E 5 E3 Facility 3 Host Adapter Intemal Exceptions ccccccoccccccccc n n n n n n n n n n nn EA Facility 4 Host Adapter Exceptions sssseeeee nnn nennen nnn nnn E5 Facility 5 TIWAY Primitive Exceptions eee nnnm E6 Facility 6 Operating System Status Exceptions 0ccoocccoco nnn nnn nnn nn 6 11 E7 Facility 7 I O Status Exceptions o ccccccccccc nnne E 12 ES Facility 8 CIM Exceptions oocccoccccccccc nnn 6 13 E9 Facility 9 Native Task Codes sseeeeeeennn nnne Appendix F Programmer s Notes for PC F1 General Information ccoccccnnr nhan aai a n ann F 2 Pascal iia le do x ez c d kE P ag aed CX a Cd a C d rade teas eae SA Nene EENE ENER o o A ES Toi cn F6 Linking Programs with the TWAY Subroutine Library eee nnn nn nnn nn F7 Using Upload and Download from an Applications Program ssssssssssssssss Contents ix Appendix G 500 505 and Host Computer Data AppendixH Unilink Dipswitch Reference Card x Contents List of Figures 2 1 3 1 3 2 3 3 6 1 6 2 6 3 6 4 6 5 6 6 6 7 6 8 6 9 6 10 6 11 6 12 6 13 6 14 6 15 6 16 6 17 6 18 7 1 7 2 8 1 9 1 9 2 9 3 9 4 9 5 9 6 9 7 Network Communication Levels 0 ccc RH nn Fortran DE CIA TATIONS 222r pears dotted
40. DEACT 4 9 7 7 7 23 10 18 HST2TI 7 37 10 29 Declarations C DEFBLK l Define block DEF BLK 4 12 7 271 10 20 10 21 4 12 7 27 10 20 10 21 iN rr ES E E DNLOAD 10 22 10 23 Initialization subroutine INIT 4 5 10 30 aj 10 225 10 2 Download DNLOAD 7 4 10 22 Installing TI WAY package 1 8 istat 3 28 Error messages E 2 E 16 L Exception messages E 2 E 16 Languages supported 2 5 Linking 1 13 F LKUFMT 10 31 LKUTGL Facility codes E 2 E 16 LKUTGS 10 33 Files description 1 4 Local area network 2 2 FILL 4 12 7 28 10 24 Eon ua FIN 4 5 7 20 1025 Look up format LK UF MT 7 37 10 31 10 32 Look up tag LKUTGL LKUTGL Tong format 7 38 G LKUTGS LKUTGS short format 7 38 GATHER 4 12 7 28 10 267 10 27 Gather N blocks using mask 10 26 10 27 blocks with mask 10 58 10 59 NATIVE 4 13 10 35 Get length GETLEN 4 13 7 28 10 27 NETAUTOC DAT 9 2 Network GETLEN 4 13 10 27 characteristics 2 2 GETMSG 10 28 communication levels 2 3 Index 2 P arguments BLDMSK PM550 CCU Task Codes D 1 D 17 BRDCST CCUSTS POLL 4 9 7 24 10 35 CHNGST 4 12 Primitives TI WAY B 1 CIMDNL 4 1544 16 10 12 CIMRD 4 15 Program mode Seg CHNGST CIMUPL 4 15444 16 10 15 10 16 PUTMSG 10 36 CIMWR 4 15 CONFIG 4 12 DEACT 4 9 10 18 R DEFBLK DNLOAD 10 22 RDLOOP 4 15 4 16 10 37 FILL 4 12 10 24 RDST5 103911039 AMERO Read loop RDLOOP 4 15 10 37 GETLEN GETMSG 10 28
41. ER Partial Partial Partial Partial Partial Partial Partial V Full Full Full Full Full Full Full Partial Partial Partial Partial Partial Partial Partial Full Full Full WA sr Fat N A RDA Partial Partial Partial Partial N A N A wr Fara Para WA WA NA TIWAY Host Software for PC User Manual File Transfer Subroutines 6 3 Overview continued Transfers Between Memory configurations of certain devices within the Series 500 505 Different Types of controllers can fit into other devices within the same series This occurs Devices when the memory configuration to be transferred is of the same size or smaller than the memory configuration of the target device When a request is made to transfer between unlike device types the file transfer logic performs a check to determine e If both devices are within the Series 500 505 e And if so if transfers between the devices are permitted Table 6 4 summarizes allowable transfers Table 6 4 Allowable Cross Device Memory Transfers Sms Lom ose sec E sss Target Permitted if memory sizes allow transfer Generic A special feature of the 560 and 565 sequencers and the Unilink Secondary Upload Download adapter is generic upload download which is supported by the TI WAY Host Software Package M emory types are grouped together by class and may be transferred totally or partially by class The following table lists memory types which are supported by generic upload dow
42. LSB specifies bit 1 For example cmask 810A hex 1000000100000101 binary would select blocks 1 3 9 and 16 rsplen The response buffer length argument defines the maximum length of the response buffer when it is returned it contains the actual length in bytes of the response See discussion of this argument for TI GET for an explanation on how it is computed rsp275 The rsp275 argument contains the returned data in the 500 505 format The blocks gathered with the RNDRD2 subroutine can be defined using the RNDRD1 or RNDRD3 subroutine TIWAY Host Software for PC User Manual 10 34 SDIAG Call Format Notes on Call Format The SDIAG subroutine returns a list of statistics diagnostics collected by the Host Adapter about a specified Secondary The statistics contain data about that Secondary s network usage and errors SDIAG is the implementation of command code 07 BASIC and CALL TIWAY SDIAG istat xtn tag rilen ri32 FORTRAN CALL SDIAG istat xtn tag rilen ri32 Pascal TIWAY SDIAG istat xtn tag rilen ri32 SDIAG istat xtn tag rilen ri32 C tiway sdiag amp istat amp xtn amp tag amp rilen ri32 sdiag amp istat amp xtn amp tag amp rilen ri32 Explanations of the terms used in the call format follow istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Spec
43. M functional command 69 The CIMDNL subroutine downloads instructions or data into a PM550 Refer tothe CIM User Manual for more information on the procedures necessary to do this CIMDNL is the implementation of CIM functional command 65 NOTE The PM550 must bein startup or remote mode in order for the download operation to be enabled If the PM550 is in any other mode a facility 8 message 67 hex Invalid Download Sequence error is returned The CIMRD subroutine reads consecutive memory locations from the specified CIM based attached device CIMRD is the implementation of CIM functional commands 60 and 62 The CIMUPL subroutine uploads one or more memory areas from a PM550 You should refer tothe CIM User Manual for more information on the procedures necessary to do this CI MUPL is the implementation of CI M functional command 66 The CIMWR subroutine writes to consecutive memory locations in the specified CI M based attached device CI MWR is the implementation of CIM funcional commands 61 and 63 The RDLOOP subroutine reads loop parameters from a PM 550 RDLOOP is the implementation of CIM functional command 6A The RNDRDI1 subroutine defines a data acquisition block in a PM550 The data acquisition block can then be activated to gather the specified data using an RNDRD2 RNDRD3 or RNDRD4 subroutine RNDRDI is the implementation of CIM functional command 6D00 NOTE Unlikethe NIM DEFBLK subroutine any new definition starts
44. Number of received errors from Secondary Number of transmitted errors to Secondary j Q OOO O O Number of times Secondary initialized TIUSER gt TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 11 TIUSER Utlity continued UPLOAD Command The UPLOAD command is used to upload the contents of a Secondary to a file on the host system This command is intended as a backup for Secondary programs and supports these functions e Full memory upload e Partial memory upload e Generic memory upload e Specific segment upload Unilink You are prompted for a Secondary address and a file specification filename Any further address specification is ignored The filename should take the form of any valid operating system filename specification The file is created with parameters of the Secondary and the upload session and the memory dump from the Secondary Edited shortened examples of files uploaded from the Secondaries supported by this package are shown in Chapter 6 To display a file exit the utility and use the operating system s TYPE command or display utility Chapter 6 contains more information on transferring files However unlike the UPLOAD procedure the UPLOAD command treats one occurrence differently If a TIWAY error occurs the error message is displayed the message upload continued appears and an attempt is made to upload the next memory type As with the UPLOAD procedure an attempt to
45. PV low value in excess 64 floating point notation Read Process Variable PV high value Loop number 1 8 F Presence of 16 loop software LL Loop number 1 16 for 16 loop software DDDDDDDD PYV high value in excess 64 floating point notation Write Process Variable PV high value L Loop number 1 8 F Presence of 16 loop software LL Loop number 1 16 for 16 loop software DDDDDDDD PV high value in excess 64 floating point notation Read Orange Deviation Value L Loop number 1 8 F Presence of 16 loop software LL Loop number 1 16 for 16 loop software DDDDDDDD Orange deviation in excess 64 floating point notation Write Sample Rate L Loop number 1 8 F Presence of 16 loop software LL Loopnumber 1 16 for 16 loop software DDDD Sample rate Write Orange Deviation Value L Loop number 1 8 F Presence of 16 loop software LL Loop number 1 16 for 16 loop software DDDDDDDD Orange deviation in excess 64 floating point notation D 14 PM550CCU Task Codes 31LDDDDDDDD 31DDDDDDDD or 31F LLDDDDDDDD 32L 32DDDDDDDD or 32FLL 33LDDDDDDDD 3DDDDDDDD or 33FLLDDDDDDDD 34L 34DDDDDDDD or 34FLL 35LDDDD 35DDDD or 35FLLDDDD 36L DDDDDDDD 36DDDDDDDD or 36FLLDDDDDDDD TIWAY Host Software for PC User Manual Table D 1 CCU Task Codes for PM550 continued Write Loop Gain 37LDDDDDDDD 37DDDDDDDD or I ros 37FLLDDDDDDDD F Presence of 16 loop software LL Loop number 1 16 f
46. Wilen specifies in integer format the number of integers to be contained in wi4 or wi135 Wblen specifies in byte format the number of bytes to be contained in wb275 wi4 and wi135 contain in an array of integers the data being sent to the network Wb275 contains the data being sent to the network in an array of bytes 3 22 TWAY Subroutine Calling Arguments TIWAY Host Software for PC User Manual 3 7 Data Block Manipulation Many of the subroutines in the TIWAY Subroutine Library allow you to perform I O operations to obtain modify or replace data The subroutines also allow you to manipulate data or blocks of data The following arguments are used to manipulate blocks of data UC L Instruction The code cc argument defines which of four memory storage actions Code cc should take place in a NIM based attached device during a write buffer Argument operation the WRBUF subroutine Consult the description of WRBUF for a description of these actions Block List cclst The block list cclst argument is an array in which each array element Argument contains a block number Example If you want to define the following two data acquisition blocks in PM550 number 5 on highway number 1 block 1 8 words starting at C74 block 4 20timer presets starting with timer 2 You initialize the DEFBLK argument as shown below cclst taglst nnnnist 1 address of tag 8 nblk 2 4 addre
47. adapter problem y 03 E No media card installed on host port System queue management error o x a o E y E c io 0 o i E 14 HIU not configured i 18 Mixed media definition for channel Device addressed is not a HIU 1A Not enough memory for specified macros TIWAY Host Software for PC User Manual Table E 3 Facility 3 INTERNEXCP Host Adapter Adapter Intemal Exception Enors continued Description Macrois already enabled Macrolink already exists 2E 7 E aa Po a Trigger macro not disabled Trigger macro primitive error 32 NM buffer definition not allowed 33 NM buffers have already been allocated 34 M acro command buffer has not been defined TIWAY Host Software for PC User Manual Eror Listings E 7 EA Facility 4 Host Adapter Exceptions These errors detected by the Host Adapter pertain to host communications errors or are detected while a Host Adapter Command Code is being processed See Table E 4 Table E 4 Facility 4 HOSTEXCEPT Host Adapter Host Exception Enors Message Number Description Hex 00 Problem undefined on host Problem undefined om host 01 Lost DCD on host port transaction 02 Lost CTS on host port transaction 03 Timedoutwaitingon host transaction x 05 Invalid field received with command code Missed end of message delimiter Message length count error Message checksum bad Invalid hexASCII charact
48. and application programs running on a PC In general the package also does the following e Enables you to process Host Adapter command codes TI WAY primitives and CIM functional commands e Provides limited support for CCU task codes e Performs status checks e Supports programs written in the computer languages listed in Section 1 1 e Provides an interactive operator interface to network facilities e Enables direct data format conversion embedded in selected routines e Enables logical to physical address conversion using site specific tag table e Provides error detection and message generation for the following dasses of errors e Host Adapter errors e TIWAY Primitive errors e CIM functional command errors e Directive status errors e O status errors 1 6 Insta lla tion TIWAY Host Software for PC User Manual e Supports asynchronous I O completion for a subset of the routines TIWAY Host Software for PC User Manual Installation 1 7 1 3 Software Installation and Operation This section explains how to do the following tasks e Back up the software provided in your TI WAY Host Software Package e Install your TIWAY Host Software e Configure your system to use the TI WAY Host Software Package Backing Up Your In order to avoid system down time due to loss or damage to the software Software diskette provided in the TI WAY Host Software Package one back up copy should be used as your working copy In orde
49. are Fortran Pascal BASIC compiled C and assembly language In the 500 505 Secondaries data are represented in 500 505 format the format in which numbers are stored in 500 505 Secondaries Specific conventions follow e Packed discrete data e Unpacked discrete data e nteger data e Instructions e Floating point data The TIWAY Host Software Package allows access to data in 500 505 format and allows you to access data in host 500 505 format the data format representations supported in the host computer You should refer to the SIMATIC TIWAY I Systems Manual PPX TI WAY 8101 x for a complete description of 500 505 format TIWAY Host Software for PC User Manual Overview 2 5 Chapter 3 TIWAY Subroutine Calling Arguments 3 1 e UlIMHM 32 Reference List of Subroutines and Arguments Reference list sees 3 3 Reference listof Arguments sisse nnn 3 4 List of Data Elements Types cccccee cece cece nnne 3 5 Addressing iuexkxuskkanoksusEiasE nexa wean went snieane cents ERU UE NEA ERR CE RN RA RA 3 6 Buffer Spacificati n REN 3 7 Data Block Manipulation varia 3 8 Diagnostics ococcccccccn ness ara aia a ra ra aar rn 39 MaJs ares 3 10 Network ACCES siii RA EE E RERO RR ROCA ER ROC E EROR RE RR SORORE eens 3 11 Status Detemination ii AS TIWAY Host Software for PC User Manual TWAY Subroutine Calling Arguments 3 1 3 1 3 2 Overview
50. argument is also used in RDRAND and WRRAND to specify the number of data groups to be transferred taglst Thetagls argument is an array of addresses of the tags that identify the data element type and starting data element location for each of the blocks defined The array contains an address for each of the blocks defined nblk elements Each array element must contain a full long tag specification nnlt Thennlst argument is an array of bytes Each array element specifies the number of data elements to be included in a particular block The array is nblk elements long Related Calls A call toRNDRD2 following RNDRD1 gathers the blocks of data that were set up in the RNDRD1 subroutine A call to RNDRD3 following RNDRD1 gathers the blocks of data and can be used to define new blocks A call toRNDRDA following RNDRD1 gathers the blocks of data and can be used to write to a set of sequential memory locations 10 40 Subroutine Library TIWAY Host Software for PC User Manual 10 31 RNDRD2 Call Format Notes on Call Format Related Calls The RNDRD2 subroutine gathers a block or group of blocks previously defined using either a RNDRD1 or RNDRD3 subroutine The buffer returned contains only the data specified by the blocks and those data are in the 500 505 format NOTE Unlikethe NIM DEFBLK subroutine any new definition starts with the first block and all blocks defined after the first are numbered sequentially from that numb
51. attached devices except Series 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the state that is returned is the state that existed before the subroutine call was issued Table 3 7 shows the seven possible values Related Calls If data conversion is required the TIPUT subroutine can be used The TIWRIT subroutine is the complement of the TIREAD subroutine The WRTGAT subroutine combines TIWRIT and GATHER into a single call 10 52 Subroutine Library TIWAY Host Software for PC User Manual 10 41 TIXIN and TIXTNW Call Format Notes on Call Format Each subroutine that does I O is divided into two parts the first half which uses the argument list to build the command buffer and issuethel O request and the second half which takes the results of the I O i e the response buffer and returns pertinent parts of it to the application using the argument list The TIXTN and TIXTNW subroutines are used to call the second half of a subroutine that does I O and are not valid for any others If a subroutine is called with a transaction number of O it is synchronous that is after the first half the routine waits until the I O is complete and then executes the second half In this case the fully synchronous case all processing is performed with a single call either tothe TI WAY entry point or tothe individual subroutine This is the normal case and is supported in all operating systems Thetransaction number is a read only
52. dddd dddd dddd dddd repeat for each SF program IN Oxxx dddd dddd dddd dd SFS pppp cccc nnnn nnnn nnnn nnnn 00ee 00ss aaaa aaaa tttt tttt IN 0000 dddd dddd dddd dddd dddd dddd dddd dddd repeat for each SF subroutine IN Oxxx dddd dddd dddd dd channel 0 7 base 0 F I slot 0 F IOC Ocbs jj ii pp ii pp T O Configuration where jj 1 more to follow 0 finished nnnn nn aaaa dddd 0j aaaa dddd dddd 0j where aaaa start address dddd returned address dddd dddd returned address 0j status value aaaa rrrr aaaa aaaa where address 1 1024 aaaa address 1025 8192 word force status value Figure 6 7 560 565 Non extended Upload File Format continued 6 16 File Transfer Subroutines TIWAY Host Software for PC User Manual 0722 07 22 22 JUL 1995 10 65 3000 0400 8206 0064 009A C 03E9 0004 C 3E 3623 C 03F9 3C23 D70A LP 0001 4001 6064 4000 4049 4049 452B 0000 0000 0000 0000 0000 0001 0001 1800 0083 048C 0064 7001 0000 D70A 3135 7000 0000 OFF8 OFF8 CEFF 0001 0002 0003 0004 0005 6006 6007 0400 0800 8206 00C8 0109 3C23 378B 2052 0064 3E23 0000 3F80 3C23 3F80 3F80 3F80 3F80 3F80 3F80 3F80 54 53 02C8 0400 64AA 014D 7001 8000 8000 8000 0000 0506 0003 0004 0004 0017 0159 0285 11AE D70A CF65 E007 0000 0000 0258 2D53 7064 60
53. different group of Task Codes The next level of communication is that between the NIM and the host adapter At this level primitives or the Universal Command Language nstructions are used The Universal Command Language UCL is a unified language recognized by all NIMs The third level of communication is between the host adapter and the host computer Communication at this level is accomplished through the use of Host Adapter Command Codes Finally at the highest level there is the communication between an operator and the host computer This level involves the host software that is used to generate the command codes It is at this level that you interface to the TI WAY Host Software Package The following is an example of the series of events that occur when a specific instruction is sent to a controller At the highest level e You run a program written to do a specific job The program asks for the required data e g which controller to talk to e Your program calls a TIWAY Subroutine to generate the network instruction For example CALL TIWAY TIGET istat xtn e The subroutine generates the instruction from the data that you supplied to it and formats the instruction into a TIWAY Primitive embedded in a Host Adapter Command Code The subroutine then sends the instruction to the Host Adapter Device Driver e Thedevice driver embeds the instruction within either a Non I ntelligent Terminal Protocol NITP frame or a B
54. does not require representation All primitive commands are embedded within a command code 01 and again representation is not required 01 access can be achieved through use of the XPAR routine Command codes FC FD FE and FF reset host adapter are not represented but can also be accessed through the XPAR routine Table 4 1 shows the Host Adapter Command Code subroutines NOTE You must call the INIT subroutine before any other subroutine can be executed Table 4 1 HostAdapter Command Code Subroutines Command er A A 00 Returned with error responses with error Returned with error responses E EM by the NIM and CIM subroutines to send network data Broadcasts a user specified command buffer on the ERDSST specified highway POLL Polls a specified Secondary for its response to most recently issued broadcast command ACTVAT Logically connects activates a Secondary or list of Secondaries to the specified highway DEACT Logically disconnects deactivates a Secondary or list of Secondaries from the specified highway SECLOG Returns a list log of Secondaries currently connected to the specified highway SDIAG Returns a list of statistics diagnostics collected by the Host Adapter about a specific Secondary Returns a list of statistics diagnostics collected by ADIAG the Host Adapter about the Host Adapter s network usage XPAR Provides high level direct access to the Host Adapter command response buffers 4 8 TI
55. element type Declaration integer The format argument is a code used to indicate the format the data are represented in and therefore the type of conversion required to convert data from the 500 505 format to the host format and vice versa Declaration character Formats follow bytes no conversion 16 bit words no conversion 16 bit words converted to least significant bit first floating point conversion triplets 24 bit data no conversion bytes converted to least significant bit first floating point 32 bit data conversion 32 bit data no conversion floating point 52 bit data conversion byte converted to 32 bit integer rommogoor Declaration character The 500 505 length argument specifies the length of the data element type in the 500 505 format in bytes Declaration integer hostlen The host length argument specifies the length of the data element cimtyp type in the host format in bytes Declaration integer The CIM type argument is an integer representing the corresponding CIM data specifier A cimtyp of zero indicates there is no corresponding CIM data type If the cimtyp is positive it specifies the bit representing one of the CIM memory types If negative it is the two s complement negative of the bit representing one of the CIM image registers X Y CR Declaration integer TIWAY Host Software for PC User Manual Subroutine Library 10 31 10 23 LKUTGL TheLKUTGL subroutine
56. forward and variable declarations and the type definitions required to call all subroutines in the TI WAY Subroutine Library You can include these files in your programs to automatically make the necessary declarations for any TIWAY subroutine calls You may find it more expedient however to make these declarations yourself if you wish to use only a few of the routines in the TI WAY Subroutine Library Pascal s most outstanding features are that it is a strongly typed language and is extremely sensitive to any mode conflicts For example something of type 5 BARY 275 cannot be passed to a Pascal procedure that expects something of type BARY 275 although the two types have the same memory allocation Pascal requires external routine dedarations and the types assigned in those declarations are the only types that can be used in the procedure call Pascal records with the case option should be declared as volatile and have no case qualifier The case qualifier requires some memory allocation in the starting address of any variable declared of this type The TI WAY Subroutine Library is not expecting this and results from such a call are either wrong or may cause an error to be generated Programmer s Notes for PC FS F3 F 6 BASIC The SAMPLE BAS file and the DEF BAS file contain both the forward and variable declarations and the type definitions required to call all subroutines in the TI WAY Subroutine Library These files can be includ
57. host format TIPUT TIWAY Primitive 30 TR Read data 500 505 format TIREAD TIWAY Primitive 20 TW Write data 500 505 format TIWRIT TIWAY Primitive 30 WB Buffered write WRBUF TIWAY Primitive 33 WG Write and gather block WRTGAT TIWAY Primitive 52 Host Adapter Command Code Subroutines Activate Secondary ACTVAT Host adapter command code 04 AD Get adapter diagnostics RADIAG Host adapter command code 08 Broadcast message BRDCST Host adapter command code 02 Deactivate Secondary DEACT Host adapter command code 05 Poll response POLL Host adapter command code 03 SD Secondary diagnostics RSDIAG Host adapter command code 07 SL Secondary log SECLOG Host adapter command code 06 General purpose transparency command XPAR User formatted I O TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 17 TIPROG Utility continued Table 7 3 Alphabetized List of IPROG Commands with Subroutines and Primitives continued TIPROG Equivalent Subroutine Command CIM Functional Command Subroutines Status and Support Subroutines Build block masks BLDMSK Build mask for GATHER GE Return error message GETMSG Return error message string T Look up format LKUFMT Look up format n Look up tag short format LKUTGS Look up tag short format ppm Display error message PUTMSG Error message display TH Convert 500 505 to host format TI2HST Data format conversion Miscellaneous Masi HE Hep Menu listing all co
58. in ROM RAM D 12 PM550CCU Task Codes TIWAY Host Software for PC User Manual Table D 1 CCU Task Codes for PM550 continued ETT Read CCU Status Rev 8 0 and later status word 2 continued from previous page ABCDEFGHIJ KLMNOP User requested CCU diagnostic failed Operating system ROM error Operating system RAM error User memory L V or C parity error Run time edit error P C will not stop Batteries low Power fail recovery error RRRR PPP PB Operating system memory allocation error Operating system de allocation error Invalid call to floating point package Attempt to execute illegal special function Invalid ladder instruction L memory checksum error Invalid IR address in loop tables Invalid loop table address PC type 1111 PM550 undefined status word 3 Non ASCII data AAAABCDEFGHIJ KLM L memory editing error Port O timeout Port 1 timeout Port 2 timeout Operating system software error undefined Loops are over running Loop math error AAAAAAAA PC subtype 00000000 standard PM550 B I undefined status word 4 AAAAAAAA Software release AAAAAAAABCDEF GHI status word 5 BBBBBBBB Version AAAAAAAABBBBBBBB TIWAY Host Software for PC User Manual PM550CCUTaskCodes D 13 Table D 1 CCU Task Codes for PM550 continued Meaning Write Process Variable PV low value L Loop number 1 8 F Presence of 16 loop software LL Loop number 1 16 for 16 loop software DDDDDDDD
59. memory locations in an attached Teer qu device 500 505 format WRBUF 33 Writes consecutive memory locations into an attached device that is equipped with an L memory buffer WRTGAT Combines the functions of TIWRIT and GATHER NOTE All NIM primitive subroutines use the host adapter command code 01 Before attempting to use these subroutines you should be familiar with the primitives you intend to use Refer to the NIM user manuals for more information You must successfully execute the INIT subroutine before any other subroutine can be executed 4 12 TWAY Interface Subroutines Topical TIWAY Host Software for PC User Manual TIWAY Primitive Subroutines continued CHNGST CONAG ALL GATHER NOTE There area few differences between how data is stored within a Secondary and how data is stored within the personal computer Read Appendix G to understand this difference and how it is treated by TI WAY subroutines The CHNGST subroutine is used to change the operational state of a specified NIM based attached device CHNGST is the implementation of Primitive 10 This changes the operational state of a controller either from STOP to RUN or vice versa and must be selected carefully See Warning below a WARNNG o O Remote state changes can be dangerous in some installations Remote state changes could cause unpredictable controller behavior that could result in death and or serious injury or damage to equipment Do not
60. message text PUTMSG outputs TI WAY error message to default output device BLDMSK builds data acquisition block mask This file contains a programming utility which can be used to manipulate the TIWAY Host Software subroutines Fundamentally its purpose is to enable you TIPROG EXE to get to know how the subroutines work and what kind of information they need for proper operation TIPROG EXE is executed to run the TI PROG interactive operator utility EXE This file contains a network management utility program which is used to TIUSER determine the status of network Secondaries TIUSER EXE is executed to run the TIUSER interactive operator utility TIWAY Host Software for PC User Manual Installation 1 5 PC Software Package Files continued Table 1 1 PC Software Package Files continued i File TIWAY BCM This file contains the subroutine library for Compiled BASIC TIWAYC This file contains the subroutine library for Lattice C This file contains the subroutine library for FORTRAN Pascal Microsoft C and Operation This software support package provides two related but distinct interfaces e A subroutine library for application programs e Utilities for network management and network access The overall package when implemented will enable your host application program to communicate with devices attached to the TI WAY network It also provides a high level interface between a TI WAY network with a host adapter
61. request 01 continue 02 terminate On return ss contains the code describing the operation that was performed It contains an 02 if the operation was automatically terminated rsplen The response buffer length argument specifies a maximum length for the data to be returned and the actual returned length in bytes rsp275 The rsp275 argument contains the gathered data in 500 505 format cstat Contains the CCU status code on return Possible values in hex cstat status 01 CCU not in start up 02 C and L memory in ROM 04 extended C memory present 08 extended L memory present mm The data element type argument defines the type of PM 550 memory mm memory type 01 L memory 02 V memory 04 C memory Note that mm is cumulative i e mm 3 defines L and V memory mm 7 defines L V and C memory TheTIUSER UPLOAD function can be used instead of writing programs to upload Secondaries TIWAY Host Software for PC User Manual Subroutine Library 10 15 10 10 CIMWR The CIMWR subroutine writes to consecutive memory locations in the specified CI M based attached device Call Format BASIC and CALL TIWAY CIMWR istat xtn tag nnnn wb275 FORTRAN CALL CIMWR istat xtn tag nnnn wb275 Pascal TIWAY CIMWR istat xtn tag nnnn wb275 CIMWR istat xtn tag nnnn wb275 C tiway cimwr amp istat amp xtn amp tag amp nnnn amp wb275 cimwr amp istat amp xtn amp tag amp nnnn amp wb275 Notes on
62. returns address information that describes the address specification passed to it The address specification can be any of the available types tag name ASCII or binary LKUTGL looks up a tag name or derives the address information from the address specifier LKUTGS and LKUTGL are identical in function they differ in providing different granularity of address information and are distinguished by the number of arguments passed to them Call Format BASIC and CALL TIWAY LKUTGL istat xtn tag hwy secadd tt aaaa FORTRAN CALL LKUTGL istat xtn tag addlst Pascal TIWAY LKUTGL istat xtn tag addlst LKUTGL istat xtn tag addlst C tiway Ikutgl amp istat amp xtn amp tag addlst Ikutgl amp istat amp xtn amp tag addlst Notes on Call Explanations of the terms used in the call format follow For Dedaration Format Types see Table 3 2 and Table 3 3 istat Error codes arereturned in the status field xn Thetransaction number must be zero tag Thetag argument specifies the address list that is to be returned to the caller This argument may take any of the available forms The tag is converted to an address list either by searching the tag table by converting the specification directly or by a combination of the two See Declaration for tag typein Figure 3 1 hwy Thehwy argument contains a highway number which is an index into a list of consecutively numbered logical units that are mapped by thet
63. ri32 amp sstat Explanations of the terms used in the call format follow istat xtn tag rilen ri32 Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Specifies synchronous xtn 0 or asynchronous xtn 1 completion The short form of the address highway and Secondary can be used The number of values returned in ri32 ri32 contains the attached device configuration data and is an integer array of words returned in host format Values are listed below 1i32 x value device type 1 0000 5TI 0020 520 002C 520C 525 0030 530 003C 530C 525 Series 500 0060 560 Family 0065 565 007E Unilink Host Adapter 0080 PM550 0100 Unilink Secondary Adapter 0200 IT 111 T 121 Tank Transmitters 0204 IT 150 Hydrostatic Tank Transmitter 0208 IT 160 Micro Remote Control Unit 2 integer instruction data type memory size 3 integer variable data type memory size 4 integer constant data type memory size 6 integer global input output memory size 7 8 sstat integer total user memory high order J integer total user memory low order Series 500 505 NIM Rel 2 0 and later and Unilink only The Secondary status argument contains the code for the current state of a specific NI M based attached device Current state means the state the device is in when the response to the subroutine call is returned Current state is returned for all att
64. that language This file contains a sample Pascal program to be used as an example when SAMPLE programming in that language SAMPLE2 Another sample C program This file contains instructions for compiling and linking a C program with the SAMPLEG TIWAY library This file contains a program which loads a logical tag table for the ASCII Tag names TAG TBL This file contains the table with the named Tag specifications and the corresponding routing information It is an ASCII file which can be edited with any ASCII text editor SAMP TAG TAG SAMP TAG TAG is an example of a TAG TBL file TIBASIC EXE This file contains a program which loads the subroutines to be used under Interpreted BASIC and chains tothe file BASIC EXE This fileis used by the TIUSER utility It contains permission information with switches which can be set to allow or disallow downloads to programmable controllers The switches can also be set to control state changes in TICONFIG DAN programmable controllers The switches can also be set to control state changes in programmable controllers TICONFIG DAT should be located in the same directory as the TIUSER subroutine TIMSGBCM OBJ This is a message handling file for Compiled BASIC subroutines TIMSGC OBJ This is a message handling file for Lattice C subroutines This file contains the TI WAY Host Software message handling subroutines as well as utility subroutines such as TIMSGPF OBJ GETM SG looks up TIWAY error
65. the following fields Primitive length Primitive code and Primitive data if applicable The command is formatted for the Host Adapter to read For more information refer tothe SIMATIC Unilink Host Adapter User Manual PPX TIWAY 8121 x Related Calls The POLL subroutine must be used to obtain responses to BRDCST TIWAY Host Software for PC User Manual Subroutine Library 10 9 10 5 CCUSTIS Call Format Notes on Call Format 10 10 Subroutine Library The CCUSTS subroutine reads the attached PM 550 s Command Control Unit s CCU status CCUSTS is the implementation of CI M functional command 69 BASIC and CALL TIWAY CCUSTS istat xtn tag retsts FORTRAN CALL CCUSTS istat xtn tag retsts Pascal TIWAY CCUSTS istat xtn tag retsts CCUSTS istat xtn tag retsts C tiway ccusts amp istat amp xtn amp tag amp retsts ccusts amp istat amp xtn amp tag amp retsts Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xtn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag The short form of the address highway and Secondary can be used retsts The CCU status is returned in this argument in the form OOXY where X is the state of the CCU 2 start up 3 hold 5 run 6 remote and Y is the curren
66. the TI WAY floppy disk back up copy to the working directory Configuring Your System After software has been moved to the appropriate directory add the contents of the CONFIG SYS filein the working directory the CONFIG SYS file from your software package to the CONFIG SYS filein the root directory as appropriate If a CONFIG SYS file does not exist in the root directory copy the CONFIG SYS filein the working directory into the root directory TIWAY Host Software for PC User Manual Installation 1 9 Contents of the CONFIG SYS file The CONFIG SYS file must contain a statement specifying the appropriate driver for your PC You must use only one of the following e ForaTIPC the following statement is required assuming you are using a hard disk as recommended DEVICE e TIWAY HADRVTI DEV e For aPC XT or compatible the following statement is required again assuming you are using a hard disk DEVICE CA TIWAY HADRVIBM DEV e ForanIBM AT or compatible the following statement is required again assuming you are using a hard disk DEVICE CA TIWAY HADRVAT DEV NOTE TIPCs use E for the hard disk other IBM compatible personal computers use C An example of a subdirectory specification would be DEVICE cA TIWAY HADRVAT DEV where TIWAY is the subdirectory name 1 10 Insta lla tion TIWAY Host Software for PC User Manual Software Installation and Operation continued Using BASIC with TI and IBM PCs In the case of t
67. tiway actvat amp istat amp xtn amp hwy amp wilen wi4 amp rilen ri4 actvat amp istat amp xtn amp hwy amp wilen wi4 amp rilen ri4 Explanations of the terms used in the call format follow istat hwy wilen wi4 rilen rid The status is zero Success even if none of the Secondaries is connected To verify that Secondaries were connected the application program should be designed to inspect rilen Specifies synchronous xtn 0 or asynchronous xtn 1 completion Specifies the logical highway number which is used to communicate to the device setup for communications F or the PC version of the TIWAY package hwy is always set to 1 The wilen argument specifies the number of Secondary s to be connected to the highway The wi4 argument specifies the list of Secondary s to be connected to the highway The rilen argument is returned to the application program to indicate the number of entries in ri4 the number of Secondaries upon which a connection was performed The ri4 argument is returned to the application program containing the list of Secondaries upon which a connection was attempted A valid Secondary address indicates a successful connection A value of zero indicates that the Secondary was not connected The DEACT subroutine is used to disconnect Secondaries from the network TIWAY Host Software for PC User Manual 10 2 ADIAG The ADIAG subroutine returns a list of
68. tt ADDR integer containing the low order word 16 bits of the data element location aaaa ADDR integer containing the high order word 16 bits of the data element location aaaa For example the following Fortran program segment creates a binary specification which references highway 2 Secondary 5 and location V 100 on a 530 TAG 1 20 TAG 2 22 TAG 3 5 TAG 4 1 1 TAG 5 00 3 20 TIWAY Subroutine Calling Arguments TIWAY Host Software for PC User Manual 3 6 Buffer Specification Command Buffers Response Buffers The names of buffer arguments used by the TIWAY subroutines are designed to make the buffer s function as easy to recognize as possible The following conventions apply e Thefirst unit in each buffer name indicates the buffer s function with respec to the network cmd indicates a command buffer rsp indicates a response buffer r indicates a read buffer and w indicates a write buffer e Thesecond letter in read and write buffers indicates the format of the data contained in the buffer with i standing for integer and b standing for byte e fthelastthree letters in the buffer name are len that buffer specifies the buffer length e Digits when given indicate the optimum length for the buffer Buffers used by the TI WAY subroutines to return data to the application program use both a standard length and buffer format and the buffer arguments usually occur in pairs for instanc
69. type 2D loop status word_integer two bytes long_integer four bytes TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 15 List of Data Elements Types continued Table 3 4 Data Element Types continued Data Element a Type in hex Format Data Element Description 49 A PmemsvaselonUmt ow rem As 46 long integer A A C Flags 48 real A A High High Alarm Limit 4 re AkloowWamUmt 4A real A A Rate of Change Alarm Limit 6X real IEEE Floating Pt corresponds to 2X 7X real IEEE Floating Pt corresponds to 3X 8X IEEE Floating Pt corresponds to 4X 3 16 TIWAY Subroutine Calling Arguments TIWAY Host Software for PC User Manual 3 5 Addressing Address Elements Highway Selection Secondary Selection Data Element Type Selection Addressing in a TIWAY network has four elements e ahighway or network e aSecondary within the highway e adata element type identifying the area of the Secondary memory e adata element location identifying the starting address within the data element type The communications link between a host computer and a TIWAY network can be configured e As point to point communications the computer communicates through a single communications port to a single Unilink Host Adapter UHA controlling a single network e As several UHAs each controlling a network that are physically linked to the host computer through a single communic
70. utility TIUSER UPLOAD command into a second file The contents of these files can be compared using a file comparison utility The syntax of the MS DOS command and the format of the list of differences is explained in the MS DOS documentation The command syntax is comp filel spc file2 spc QUITCommand The QUIT command stops running the TIUSER program TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 15 7 3 TPROG Utility The TIPROG utility provides an interactive programmer interface to all of the subroutines in the TIWAY Subroutine Library It provides more functions than are available through the TIUSER utility but at a lower level TIPROG provides a convenient tool for learning the facilities available in the TIWAY Host Software Package It is also valuable for manually prototyping application programs or for simulating application programs for diagnostic pur poses The TIPROG commands are interactive and self descriptive and a HELP command HE lists the individual commands available Each command is presented in the following pages with a brief description and an example In general each command prompts for the necessary information carries out the command and displays the results and status The commands available are shown in Table 7 3 and Figure 7 2 Table 7 3 lists the commands in alphabetical order divided into subroutine types Figure 7 2 shows the Help Menu Screen given when you access TIPROG
71. with the first block and all blocks defined after the first are numbered sequentially from that number TIWAY Host Software for PC User Manual TIWAY Interface Subroutines Topical 4 17 RNDRD2 RNDRD4 The RNDRD2 subroutine gathers a block or group of blocks previously defined using either an RNDRD1 or an RNDRD3 subroutine The buffer returned contains only the data specified by the blocks and those data are in 500 505 format RNDRD2 is the implementation of CIM functional command 6D01 The RNDRD3 subroutine gathers data from assigned data acquisition blocks specified by a mask and defines new data acquisition blocks RNDRD3 is the implementation of CIM functional command 6D02 NOTE Unlikethe NIM DEFBLK subroutine any new definition starts with the first block and all blocks defined after the first are numbered sequentially from that number The RNDRD4 subroutine performs two functions in the same call and same Host Adapter transaction It writes to a set of sequential memory locations see the CIMWR subroutine for more detail and also gathers data from one or more data acquisition blocks specified by a mask RNDRD4 is the implementation of CIM functional commands 6D03 and 6D04 4 18 TIWAY Interface Subroutines Topical TIWAY Host Software for PC User Manual 5 1 52 Chapter 5 TIWAY Support Routines e I LALERETIIITEO TRE a dr ies bhGee beets sche ee cia ats Descriptions of Support Subroutines eee eee
72. with the maximum primitive length in primlen and the maximum number of data acquisition blocks available in nblks TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 25 3 26 Masks TIWAY Subroutine Calling Arguments Five of the subroutines in the TIWAY Subroutine Library GATHER WRTGAT RNDRD2 RNDRD3 and RNDRD4A allow you to read information using a mask A mask selects which data acquisition blocks are to be read In languages other than Pascal the mask can be built using the BLDMSK subroutine shown in Chapter 5 When using Pascal the mask must be constructed within the application s code If you need to construct a mask the mask is defined if BLDMSK is not used in host format with the least significant bit representing block 1 and the most significant bit representing block 32 The software reverses this order before using the mask in the command buffer This order is opposite to that used on the network but it is donethis way to facilitate the Pascal programmer using a packed array of Boolean and to be more convenient for the programmer using INTEGER 4 mask representation The mask argument for NIM based attached devices is a 32 bit mask The cmask argument for CI M based attached devices is a 16 bit mask each bit corresponding to a block number that data areto be gathered from The mask returned by BLDMSK is a 32 bit mask To isolate the 16 bit CIM mask from the 32 bit mask use only the lowe
73. 0 42 63 FF BE C1 10 00 00 Data element 1 real 0 0000 0000000E 00 Data element 2 real 99 9990 9999899E 02 Data element 3 real 1 0000 1000000E 01 TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 39 Chapter 8 Tag Table 8 1 Defining Tag Names 8 2 Building the Tag Table TIWAY Host Software for PC User Manual Tag Table 8 1 8 1 Defining Tag Names As discussed in Section 3 5 Secondaries are addressed through an argument mechanism known as a tag which can be spedified either as a string for instance HMhssttaaaa or hhssttaaaaaaaa or as an array of integers Either method can become cumbersome with repetitive use Therefore a means of referencing the same information symbolically is provided This is called the tag name As an example consider the following TIPROG prompt TIPROG gt TG Tag specifier 40101010001F F FF Continually entering this long tag when executing several successive commands could become tedious H owever using symbolic representation of this tag simplifies the operation An example follows TIPROG gt TG Tag specifier 565V The operation is simplified There are no limitations on the number of tag names that can be defined The collection of all tag name definitions is contained within a file called the tag table The tag table filename is TAG TBL Each entry within the tag table is a unique tag name definition which takes the form nnnnnnnnnnnnnnnn hh ss
74. 00 00 00 00 00 00 00 00 00 00 00 00 00 GL Command The get length command obtains and displays the maximum Primitive length and number of data acquisition blocks supported by the specified Secondary The GL command is the implementation of Primitive 04 Rel 1 x TIPROG gt GL Tag specifier 0102 Primitive format configuration decimal Maximum Primitive length 270 Number of data acquisition blocks 32 7 28 Interactive Operator Utilities TIWAY Host Software for PC User Manual NA Command TheNATIVE command allows you to bypass the normal Primitive processing and execute a native Task Code directly Each machine has a machine specific command set including specific functions that are not mapped into the Primitives and the NATIVE command gives you direct access to this command set NOTE No morethan 128 characters may be entered for a single command buffer The NA command is the implementation of Primitive 01 TIPROG NA Tag specifier 40102010002 Task Code command buffer free format hex CMD 38 Response buffer 2 bytes received 38 00 RS Command The read status command simply returns the status of the specified Secondary The RS command is the implementation of Primitive 02 TIPROG gt RS Tag specifier 0102 Secondary status hex Operational status 00 Auxiliary power status 80 NIM status 00 TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 29 TIPROG Utility continued TG Command TheT
75. 1 Table D 1 CCU Task Codes for PM550 continued Meaning Response 05 System Configuration 05DDDDD ls e Function C in ROM C in RAM L in ROM L in RAM Port 1 1200 bps Port 1 300 bps Port 1 smart Port 1 dumb Port 2 1200 bps Port 2 300 bps Port 2 smart Port 2 dumb L 4K C 2K CIM NIM 0 DCE 1 DTE Clear Error NN 06 Error number from Read Error NN FF clear error table UB Ac MD Number of occurrences from Read Error NN Program L C Memory 07M 07NXAAAA 12 L memory 2 C memory 1 2 Programming complete 2 Programming incomplete l TMS2516 EPROM 2 TMS2532 EPROM AAAA Address of invalid verify Enter Program Mode J Execute Single Memory Scan OA C Leave Program Mode Perform CCU Self Diagnostics 0D12134 D 2 PM550 CCU Task Codes TIWAY Host Software for PC User Manual Table D 1 CCU Task Codes for PM550 continued Meaning Task Code Verify Memory Contents OEMAAAA NXAAAADDDDRRRRPP Verify L or error code Verify C Address to be verified Verify complete Verify parity message TMS2516 EPROM TMS2532 EPROM RAM data ROM data Parity Read Power Flow 10AAAA Address C000 CFFF for 2K C000 DFFF for AK State of power flow 0 or 1 at AAAA Enter Remote State Rev 8 0 only Read Ladder L Memory 12AAAAN 12DDDD AAAA Starting address C000 CFFF for 2K C000 DFFF for 4K N Number of addresses to read 1 6 DDDD Memory data Le
76. 1 TIWAY Intemal to TIWAY Subroutine Library Errors Message Number Description Hex 00 Unableto map tag table 01 No such function bad dispatch argument 02 Not enough arguments for specified function 03 Too many arguments for specified function oF Wrong nied state for species funci n 05 Wrong length response for query Highway number out of range Bad ASCII tag specification Tag not found User supplied buffer too small for requested function Unexpected response length from NIM Invalid CIM memory or image register data type Illegal number of blocks defined Illegal data type TT MM or CC Illegal transaction number for 1st 2nd half call Illegal state for transaction number in 1st 2nd half call First half not finished yet Illegal floating point number host format Illegal floating point number 500 505 controller format Invalid number of Secondaries P Too much data specified for operation Ui Errtype parameter out of range Oo Secondary address out of range Address out of range for non extended addressing 18 CIM address out of range Wblen does not match the length derived from TT and NNNN fields TIWAY Host Software for PC User Manual Table E 1 Facility 1 TIWAY Intemal to TIWAY Subroutine Library Errors continued Description i 27 i i i 1 1 ICA ECC 3 Error in downloading memory configuration table 2 NIM CIM Secondary mismatch 34 Secondary model mismatch 35 No suppor
77. 1 FF 00 10 00 04 00 04 00 05 00 06 00 C2 03 07 00 FF 04 07 02 39 00 05 57 40 01 FO O1 1B 84 0C 8C OE 8A OA 8A OB 1B 1E 00 OC 98 OE 84 OB 12 1B 1E 00 18 8C 08 8A 10 8A 11 98 08 84 11 8C 95 1F 98 21 84 01 D6 01 01 BE O1 B7 00 20 00 20 0001 00 00 1B 1E 00 30 AO 25 00 3C 98 22 84 22 F5 01 01 B7 20 98 1F 84 03 D6 0201 BF 01 B8 00 20 00 20 98 01 B8 01 BF 00 00 98 14 84 01 DO O1 01 BE 1B 1E 25 E4 A8 84 31 E8 A9 1B 1E 00 60 94 00 E4 A9 84 1B 1E 00 6C E4 A3 E8 AF 94 00 90 00 EO A3 82 02 65 86 66 A0 1E 00 05 98 66 84 66 88 6A 84 66 8A 98 6B 98 1E 84 67 84 6A 8A 68 94 00 98 6A 0006 00 00 0007 00 01 0020 00 01 Figure 6 12 560 565 Generic Upload File Example 6 28 File Transfer Subroutines TIWAY Host Software for PC User Manual HWY STA IME MODEL CONFIG 0001 0009 LLLI 0001 0009 Figure 6 13 PM550 and IT 160 MRCU Upload File Format HWY STA TIME MODEL CONFIG L 0001 L 0009 Figure 6 14 PM550 Upload File Example TIWAY Host Software for PC User Manual TAG NAME TAG NAME hhaa hh aa dd mmm yyyy hh mm ss ss 80 208 1111 vvvv cccc 0000 mmmm mrmmrm mmmm mmmnmn 0B56 OB 56 19 JUN 1995 14 47 23 47 80 1000 0400 0800 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 00 0000 0000 File Transfer Subroutines 6 29 Transfer File Descriptions continued
78. 2 Too many macro buffers requested 63 Invalid xtn received 64 No macro buffers available 5 66 Highway port number not defined 70 Valid response return transaction continuing 71 Unable to enable frozen macro E 4 Eror Listings TIWAY Host Software for PC User Manual E 2 Facility 2 Network Exceptions These errors detected by the Host Adapter pertain to the TI WAY communications See Table E 2 Table E 2 Facility 2 NETEXCEPT Host Adapter Network Exc eption Enors Message Number Description Hex a Miscellaneous Secondary protocol errors m Secondary frame too short 05 Secondary frame too long 06 Bad null address o7 o E or E c io x i u 12 Received an invalid frame 13 Illegal communications interrupt 14 Timed out waiting on DCD half duplex RS 232 Timed out waiting on CTS RS 232 5 A HIU to NM message command was out of range 7 A HIU to NM message field was out of range 43 A broadcast mode error occurred in a HIU to NM message 44 Incorrect HDLC field in Secondary response TIWAY Host Software for PC User Manual Eror Listings E 5 E3 E 6 Facility 3 Host Adapter Intemal Exceptions These errors detected by the Host Adapter pertain to inconsistencies or other internal errors See Table E 3 Table E 3 Facility 3 INTERNEXCP Host Adapter Adapter Intemal Exc eption Errors Message Number Description Hex 00 Undefined
79. 3 Calling Subroutines BASIC uses a spedial procedure to branch to subroutines not contained in BASIC within the BASIC program being executed In order to call an external subroutine a variable with the subroutine name must be created and initialized to the proper value for linking to the subroutine This value when combined with the value loaded by the DEF SEG command is used to establish the address to branch to in the PC s memory Two calling methods are used to link a BASIC program to the TI WAY support package as follows Method 1 Usethe entry point offset of 0 While not necessary it is suggested that a variable name of TI WAY be created and initialized to the value of 0 The appropriate subroutine is selected by making the first calling parameter an ASCII string containing the name of the subroutine to be executed In BASIC this is accomplished by creating a string variable containing the name of the desired subroutine Method 2 Create a variable initialized to the proper offset value for the required subroutine With this method the subroutine is called directly rather than by going through one subroutine to get to another This method is slightly faster and when using the subroutine names as the calling variable names allows for a more easily read program Both of these methods can be freely mixed in the same program Thefollowing example illustrates the use of both methods calling subroutines Example of Subroutine Calls i
80. 4 C tiway deact amp istat amp xtn amp hwy amp wilen wi4 amp rilen ri4 deact amp istat amp xtn amp hwy amp wilen wi4 amp rilen ri4 Notes on Call Explanations of the terms used in the call format follow Format itat The status from DEACT is zero success even if none of the Secondaries is disconnected To verify that Secondaries were disconnected the application program should be designed to inspect rilen xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion hwy Specifies the logical highway number which is used to communicate to the device setup for communications For the PC version of the TIWAY package hwy is always set to 1 wilen The wilen argument specifies the number of Secondary s to be disconnected from the highway wi4 Thewi4 argument specifies the list of Secondary s to be disconnected from the highway 10 18 Subroutine Library TIWAY Host Software for PC User Manual rilen The rien argument is returned to the application program to indicate the number of entries in ri4 the number of Secondaries upon which a disconnect was performed i4 The r4 argument is returned to the application program to indicate the list of Secondaries upon which a disconnect has been performed A valid Secondary address indicates that the di sconnect was successful A zero value indicates that it was not Related Calls The ACTVAT subroutine is used to connect Secondaries to the netw
81. 4 Subroutine Library TIWAY Host Software for PC User Manual 10 16 HN TheFIN subroutine is the complement of the INIT subroutine It releases system resources reserved during the INIT call After FIN has been called none of the other subroutines can be called until an INIT is called Call Format BASIC and CALL TIWAY FIN istat xtn FORTRAN CALL FIN istat xtn Pascal TIWAY FIN istat xtn FIN istat xtn G tiway fin 8 istat amp xtn fin amp istat amp xtn Notes on Call Explanations of some of the terms used in the call format follow Format itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Thetransaction number must be zero There is no valid second half entry point for any subroutine that does not actually do 1 O to the Host Adapter TIWAY Host Software for PC User Manual Subroutine Library 10 25 10 17 GATHER The GATHER subroutine is used to gather data from previously defined data acquisition blocks see the DEFBLK subroutine Chapter 4 The GATHER subroutine returns the data in the 500 505 data format Notice that data from multiple blocks can be returned in the same call so multiple data formats may be returned in the same buffer GATHER is the implementation of Primitive 51 Call Format BASIC and CALL TIWAY GATHER istat xtn tag mask rsplen rsp275 sstat FORTRAN CALL GA
82. 5 The rsp275 argument contains the response from the Secondary The contents of this response depends on the command sent by BRDCST TI2HST may be useful in converting response buffers into real variables in the host format TIWAY Host Software for PC User Manual Subroutine Library 10 37 10 29 RDSIS Call Format Notes on Call Format Related Calls 10 38 Subroutine Library TheRDSTS subroutine reads the status of the specified Secondary and attached device RDSTS is the implementation of Primitive 02 BASIC and CALL TIWAY RDSTS istat xtn tag rilen ri32 sstat FORTRAN CALL RDSTS istat xtn tag rilen ri32 sstat Pascal TIWAY RDSTS istat xtn tag rilen ri32 sstat RDSTS istat xtn tag rilen ri32 sstat C tiway rdsts amp istat amp xtn amp tag amp rilen ri32 amp sstat rdsts amp istat amp xtn amp tag amp rilen ri32 amp sstat Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag The short form of the address highway and Secondary can be used rilen The read buffer length as defined by the specified Secondary usually 3 ri32 The Secondary and attached device status is returned in 1132 sstat The attached device Operation
83. 5 amp mask amp rsplen amp rsp275 amp sstat wrtgat amp istat amp xtn amp tag amp nnnn wb275 amp mask amp rsplen amp rsp275 amp sstat Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Thelong form of thetag must be used nnnn The nnnn argument defines the number of data element locations to write to wb275 The write buffer argument refers to the data element locations being transferred to the location specified in tag mas See Chapter 3 for an explanation of masks rsplen Thelength of the response buffer in bytes rsp275 The rsp275 argument contains the data returned by GATHER in the 500 505 format TIWAY Host Software for PC User Manual stat The Secondary status argument contains the code for the current state of a specific NI M based attached device Current state means the state the device is in when the response to the subroutine call is returned Current state is returned for all attached devices except Series 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the statethat is returned is the state that existed before the subroutine call was issued Table 3 7 shows the seven possible values Related Calls The WRTGAT subroutine is a combinati
84. 50 300 600 1200 2400 4800 9600 19200 38400 57600 115200 ROROr O oO ono 0 DOWN 1 UP THESE VALUES ARE NOT AVAILABLE ON THE HOST PORT Host Command Time out Table DIPSWITCH 1 Description Down Down 0 sec Accepts No Host Commands SANM Mode Network Address Error 000 00000 OOO O OOOO 000 00000 000 O OOOO Oeo 00000 eoo e 6000 000 ooooe eee o OOOO 000 00000 000 00000 ROM Checksum Error Legend O Flashing O Off Extinguished TIWAY Host Software for PC User Manual Unilink Dipswitch Reference Card H 1 For BDLC Protocol Dipswitch Settings DIPSWITCH 1 DIPSWITCH 2 PIE HOST COMMAND UP TEST MODE TIMEOUT DOWN RUN MODE 00 2 STANDALONE NM MODE UP HIU EHA amp 01 10 SEC IO LOOP TEST 10 20 SEC DOWN MHIU EHA 11 40 SEC BDLC ADDRESS HOST PORT BAUD RATE UP SYNCHRONOUS UNUSED DOWN ASYNCHRONOUS HOST PORE UNUSED UP FULL DUPLEX DOWN HALF DUPLEX d uwusep UNUSED HOST PORT DOWN BDLC PROTOCOL Dipswitch Settings For Configuring A Stand alone Network Manager DIPSWITCH 1 DIPSWITCH 2 UP TEST MODE HOST COMMAND DOWN RUN MODE TIMEOUT 0 UP HIU EHA amp IO LOOP TEST DOWN MHIU EHA TIWAY BAUD RATE UP SYNCHRONOUS TIWAY DOWN ASYNCHRONOUS UP FULL DUPLEX DOWN HALF DUPLEX UNUSED UP AUTO REDUNDANT MEDIA DOWN NO REDUNDANT MEDIA UP NRZI HIU NM BUFFERS DOWN NRZ UP DISC DEFAULIS TO NIT
85. 50 continued ETE Read Loop Variable 2DLM 2DD1D2 D23 or or Select next loop 2DFLLM 2DD0D1 D23 Loop number Indicates presence of 16 loop software Loop number 1 16 for 16 loop software Lower display mode Blank do not use Setpoint SP Deviation Output Bias Gain Rate Reset First digit of loop number 0 1 for 16 loop software Loop number 1 8 for 8 loop software second digit of loop number 1 6 for 16 loop software D3 D10 Process variable in floating point D11 D18 Lower display value in floating point D19 D22 V table loop status word D23 CCU status flags Value UU rr 7 CO U 2 X X Xx loops are being calculated a loop is critical Il NQouanwnro a B X is not E S TIWAY Host Software for PC User Manual PM550 CCU Task Codes D 9 Table D 1 CCU Task Codes for PM550 continued TE Read Loop Constant 2ED1D2 D23 or Select next loop 2DD0D1 D23 Loop number Indicates presence of 16 loop software Loop number 1 16 for 16 loop software Lower display mode Blank do not use Setpoint SP Deviation Output Bias Gain Rate Reset First digit of loop number 0 1 for 16 loop software Loop number 1 8 for 8 loop software second digit of loop number 1 6 for 16 loop software D3 D10 Process variable in floating point D11 D18 Lower display value in floating point D19 D22 V table loop status word D23 CCU status flags Value UU rr
86. 64 0000 0057 D70A 0000 0000 0000 0000 0000 0000 0000 07 378B E006 0000 0065 0000 4049 4049 3F80 3F80 3F80 3F80 3F80 3F80 3F80 CF65 0000 0000 4049 OFF8 OFF8 4000 0057 OFF8 4049 OFF8 F80 0000 3F80 0057 2141 1BC7 3F80 0000 0000 0000 0000 0000 0000 0000 0000 Figure 6 8 565 Non extended Upload File Example TIWAY Host Software for PC User Manual File Transfer Subroutines 6 17 Transfer File Descriptions continued O C O C CO OY OY OY 4040 3135 2052 2D53 0000 6064 7000 0064 7064 0065 400 0000 3E23 6064 0000 0000 42C8 0000 42C8 0000 0000 0000 42C4 0000 4000 0000 42C6 0000 3F80 0000 40A0 0000 4120 0000 F80 0000 3F80 0000 3F80 0000 3F80 0000 4479 C000 3C23 D70A 0000 0001 3F80 0000 3F80 0000 0000 0002 3F80 0000 3F80 0000 0000 0003 3F80 0000 3F80 0000 0000 0004 3F80 0000 3F80 0000 0000 0005 3F80 0000 3F80 0000 0001 6006 3F80 0000 3F80 0000 0001 6007 3F80 0000 3F80 0000 0001 6008 3F80 0000 3F80 0000 0001 6009 3F80 0000 3F80 0000 0001 600A 3F80 0000 3F80 0000 0000 000B 3F80 0000 3F80 0000 0000 000C 3F80 0000 3F80 0000 0000 000D 3F80 0000 3F80 0000 0000 000E 3F80 0000 3F80 0000 0000 000F 3F80 0000 3F80 0000 2 0 c Q O O O OY Oi O OY OY O O O CO e 0401 4F52 2020 4E4F 2020 0C8 60C8 6000 4000 0000 7E00 08C8 3F80 44BB 8000 4348 0000 44C8 44E0 FF34 42C8 06A4 0000 0000 0000 3FFF DF3C Figure 6 8 565 Non extended Up
87. 75 sstat TIREAD istat xtn tag nnnn rsplen rsp275 sstat C tiway tiread amp istat amp xtn amp tag amp nnnn amp rsplen amp rsp275 amp sstat tiread amp istat amp xtn amp tag amp nnnn amp rsplen amp rsp275 amp sstat Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion nnnn The nnnn argument defines the number of data element locations to be read rsplen The response buffer length argument defines the maximum length of the response buffer when it is returned it contains the actual length in bytes of the response See discussion of this argument for TI GET for an explanation on how it is computed rsp275 The rsp275 argument contains the returned data in the 500 505 format TheTIREAD subroutine is similar tothe TI GET subroutine except that TIREAD returns the data in 500 505 format The TIREAD subroutine is the complement of the TI WRIT subroutine TIWAY Host Software for PC User Manual Subroutine Library 10 51 10 40 TIWRIT The TIWRIT subroutine writes to consecutive memory locations in a specified NI M based attached device The data are passed in the 500 505 format as an array of bytes TIWRIT is an implementation of Primitive 30 Call Format BASIC an
88. 9AAAADDDD 1lAAAAXXXX 1AAAADDDD TIWAY Host Software for PC User Manual Table D 1 CCU Task Codes for PM550 continued Meaning Find Illegal Ladder Instruction Rev 8 1 only AAAA L Memory location to begin search Task Code L memory location of illegal instruction response 00 Noillegal instructions 01 Illegal ladder instruction 02 Invalid parameter 03 Invalid special function control block 04 Partial instruction at end of memory LLLLLL Dedmal L memory location of illegal instruction If no illegal instructions are found 1B 100 is returned Read Image Register 0CO00 OCFF X0 X255 0D00 OEFF CRO CR511 OF 00 OFFF YO 255 Optional number of contiguous values to read 1 F Value 0 or 1 of discrete I O read Write Image Register 0CO00 OCFF X0 X255 0D00 OEFF CRO CR511 OF00 OFFF YO 255 Value 0 or 1 of discrete I O read 13 characters maxi mum AAAA Read Yellow Deviation Value Loop number 1 8 Indicates presence of 16 loop software LL Loop number 1 16 for 16 loop software DDDDDDDD Yellow deviation value in excess 64 floating point notation Write Yellow Deviation Value Loop number 1 8 Presence of 16 loop software Loop number 1 16 for 16 loop software DDDDDDDD Yellow deviation value in excess 64 floating point notation TIWAY Host Software for PC User Manual 1BAAAA 1BCCAAAALLLLLL 1DAAAAN 1EAAAAB 20L or 20FLL 20DDDDDDDD
89. AG TBL PRODUCT TIWAY HOST SOFTWARE FOR PC DESCRIPTION Tag table definitions Up to 12 characters may be used in a tag name The tag name field may be separated from the rest of the fields by any non hexadecimal character and the remaining fields may be delimited by any non hexadecimal character except lower case a f Lower case a f characters may be used in any hexadecimal field The extra 2 byte address field must be used for ALL extended addresses regardless of whether those tags are long or short Tagname HH SS TT AAAA AAAA comments First tag is maximum length CCCCCCCC Upper or lower case hexadecimal may be used AAAAAAAAAAAA BBBBBBBBBBBB CCCCCCCCCCCO DDDDD MARK MyTagName TIWAY Host Software for PC User Manual 01 02 03 00000004 01 02 03 00000004 01 02 03 0000ABCD 01 02 03 00000001 01 02 01 00000002 01 02 01 00000003 01 02 03 00000004 01 02 02 00000003 01 01 06 00000001 01 01 01 00000001 01 01 03 00000001 00 01 01 00000001 02 01 01 00000001 01 01 First tag A new tag And a little variety A little vanity An example hwy 1 sec2 v memory address 1 1 character name it is different fom MARK packed x V memory discrete x bad highway number bad highway number Short tag Figure 8 1 Sample Tag Table Tag Table 8 3 9 1 9 2 9 3 Chapter 9 Network Autoconfiguration File Intiod cBorni imei zy x ici jw v er exco a Network Autoconfigure File Template R
90. ASIC CALL TIWAY TIGET istat xtn counter32 nnnn rsplen ri135 sstat FORTRAN CALL TIGET istat xtn counter32 nnnn rsplen ri135 sstat Pascal TIWAY TIGET istat xtn counter32 nnnn rsplen ri135 sstat TIGET istat xtn counter32 nnnn rsplen ri135 sstat C tiway tiget amp istat amp xtn counter32 amp nnnn amp rsplen amp ri135 amp sstat tiget amp istat amp xtn counter32 amp nnnn amp rsplen amp ri135 amp sstat This call reads a specified number of consecutive pieces of data from the location specified by the address in this case the tag name counter32 The data is returned in the response buffer array ri135 and a composite status is returned in istat The services described below are performed 1 A Host Adapter Command Code 01 command buffer is formatted and a TIWAY Primitive 20 command is appended to the command buffer by the call to TIGET 2 Thetag name counter32 is converted to a highway Secondary data element type and data element location to identify the data to be returned Counter32 is defined in the tag table with its appropriate tag specification see Chapter 8 for further discussion 3 Thenumber of data to return nnnn is appended to the command buffer 4 Themaximum length of the response buffer in bytes indicated in rsplen is passed to the device driver 5 The request is issued to the unit of the Host Adapter device driver each unit corresponds to a
91. AY Host Software Package provides a communication interface between the TI WAY network and a host computer using the Unilink Host Adapter The Unilink Host Adapter allows communication with up to 254 controllers or other Secondaries on a TIWAY network by connecting a host computer to the network The TIWAY Host Software Package provides access to all of the Secondary functions available through the network as well as a complete set of network management and diagnostic facilities Levels of The TIWAY Host Software Package provides the highest level of Communication communication between an operator and the Secondaries on a TIWAY network To make communication with a Secondary more user friendly there are different levels of communication between each of the network components as shown in Figure 2 1 Each level has its own format for communicating with each level building on the next lower level Host Computer User Application Software TIWAY Subroutine Calls TIWAY Host Software Command Codes Host Adapter Primitives NIM Task Codes Secondary Figure 2 1 Network Communication Levels TIWAY Host Software for PC User Manual Overview 2 3 Host Software Functions continued First at the most basic level thereis Task Code communication between the Network Interface Module NI M and the controller Each dass of controller model uses a
92. Command Code 01 and TI WAY Primitive 01 are added to the command and stripped from the response See the documentation for individual PLCs for information concerning the Task Codes they support NOTE Only experienced programmers should use the NATIVE subroutine BASIC and CALL TIWAY NATIVE istat xtn tag cmdlen cmd275 rsplen rsp275 sstat FORTRAN CALL NATIVE istat xtn tag cmdlen cmd275 rsplen rsp275 sstat Pascal TIWAY NATIVE istat xtn tag cmdlen cmd275 rsplen rsp275 sstat NATIVE istat xtn tag cmdlen cmd275 rsplen rsp275 sstat C tiway native amp istat amp xtn amp tag amp cmdlen cmd275 amp rsplen amp rsp275 amp sstat native amp istat amp xtn amp tag amp cmdlen cmd275 amp rsplen amp rsp275 amp sstat Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used cmdlen The cmdlen argument specifies the length of the command buffer cmd275 Thecmd275 argument contains a Task Code command buffer rsplen The response buffer length argument specifies a maximum length for the response to the NATIVE request and the actual length on return in bytes rsp275 The r
93. DDDD or L Loop number 1 8 3EFDDDDDDDD F 16 oop LL Loop number 1 16 for 16 loop software DDDDDDDD Low alarm value in excess 64 floating point notation Write Low Alarm Value 3FLDDDDDDDD 3FDDDDDDDD or or L Loop number 1 8 3FFLLDDDDDDDD 3FFDDDDDDDD F 16 loop LL Loop number 1 16 for 16 loop software DDDDDDDD Low alarm value in excess 64 floating point notation D 16 PM550CCU Task Codes TIWAY Host Software for PC User Manual Appendix E Error Listings E1 Facility 1 TIWAY Subroutine Library Exceptions een n n n n n n n n nn E2 Facility 2 Network Exceptions 0occcoccococ ee nmm E3 Facility 3 Host Adapter Intemal Exceptions cccccccccccrcc eee n n n n n n n n nn EA Facility 4 Host AdapterExCeptiONS cooccccccccccc nnn nnn nen nnn nnn E5 Facility 5 TIWAY Primitive Exceptions seen mmm E6 Facility 6 Operating System Status Exceptions eese nnn nn nnn nnn E7 Facility 7 I O Status Exceptions ooccccccccccc nnne nnn nnn ES Facility 8 CIM Exceptions oocococcccc nnn nmm E9 Facility 9 Native Task Codes TIWAY Host Software for PC User Manual Error Listings E 1 E 1 E 2 Facility 1 TIWAY Subroutine Library Exceptions Error Listings These errors shown in Table E 1 are detected by the TI WAY Subroutines and generally represent invalid or inconsistent arguments All subroutines are discussed in this user guide Table E 1 Facility
94. DLIN editor EDLIN YOURFILE return New file return 1 ALIGN MSG TIMSGPF YOURPROG TIWAYPF return 2 MAP return 3 YOURPROG return 4 A FORTRAN LIB return 5 shift break C gt return C gt 1 2 3 4 etc are the computer prompts The above file combines YOURPROG OBJ TIWAYPF OBJ ALIGN OB TIMSGPF OBJ and MSG OBJ files The executable file will be placed in the default runfile in this case TIWAY E XE A public symbol map is created and produced by the switch MAP see Link Options section for more information on switches A list file called YOURPROG MAP is produced and the library file called FORTRAN LIB on disk drive A is searched for subroutines Toinvoke the Link using the above file type the following command LINK YOURFILE return TIWAY Host Software for PC User Manual Installation 1 17 Link Options 1 18 Insta lla tion Seven options which control linking operations are recognized by Link These seven options are called switches and must be preceded in the command line by a forward slash Switch names may be grouped at the end of any one command line or scattered at the end of several command lines Switches may be abbreviated using any number of the letters which make up the switch name however these letters must appear in sequential order The seven switches are described in the following paragraphs DSALLOCATE The switch DSALLOCATE directs Li
95. Declaration composite error status returned for the call integer integer write only state Secondary should be 1 3 File Transfer ftype transfer request type integer integer read only pname length of program name integer integer read only Unilink proram name 1 TheFortran dedarations are determined according to Figure 3 1 MS FORTRAN does not support type byte All arguments declared as type byte above should be declared as integer for MS FORTRAN 3 ThePascal dedarations are determined according to Figure 3 2 integer bary16 bary275 cim mask iary4 iary32 iary135 iary254 mask type tag array tag type 3 8 TIWAY Subroutine Calling Arguments 16 bit integer packed array 1 16 of byte packed array 1 275 of byte packed array 1 16 of boolean array 1 4 of integer array 1 32 of integer array 1 135 of integer array 1 254 of integer packed array 1 32 of boolean array 1 32 of tag ptr tag ptr tag type case integer of 0 array 1 5 of integer binary 1 packed array 1 11 of character ASCII 2 packed array 1 16 of character tag name End Figure 3 1 Fortran Declarations TIWAY Host Software for PC User Manual The Pascal declarations are determined according to the following list integers are 16 bit integer values bary 16 Packed Array 1 16 of byte bary275 Packed Array p1 275 of byte cim mask Packed Array 1 16 of Boole
96. E command to define the blocks The WG command is the implementation of Primitive 52 TIPROG gt WG Tag specifier 40102010020 Number of data elements decimal 4 Data free format hex DATA AAAA BBBB CCCC DDDD MSB is block 32 LSB is block 1 Mask of data acquisition blocks hex eight digits 00000001 Response buffer 4 bytes received 00 04 00 05 CIM Functional The CIM Functional Commands determine and assess the performance of Commands CI M based attached devices on a network valid for PM550s only CC Command The CIM command control unit status command reads the status of the command control unit valid for PM550s only TIPROG gt CC Tag specifier 0102 CCU status hex 0050 CR Command The CIM read command reads consecutive i mage register locations from the specified Secondary The first example shown below identifies the Secondary using an ASCII string the second uses a tag name located in the tag table Valid for PM 550s only TIPROG gt CR Tag specifier 40102010001 Number of data elements decimal 10 Response buffer 20 bytes received 10 02 11 04 12 06 13 08 14 0A 00 00 00 00 00 00 00 00 00 00 TIPROG gt CR Tag specifier SETPT Number of data elements decimal 1 Response buffer 2 bytes received 44 FE 7 32 Interactive Operator Utilities TIWAY Host Software for PC User Manual CW Command TheCIM write command writes to consecutive image register locations in the specified Secondary valid for P
97. EN amp RSP275 The variable tag is declared of type TAG TYPE TAG TYPE isa typedef union The variables isat xtn and rsplen are integers The variable rsp 275 is of type s bary275 which is also a typedef union TIWAY Host Software for PC User Manual Programmer s Notes for PC F7 ES Fortran TIWAY subroutine calls from Fortran are very simple and straightforward If you have problems calling TI WAY subroutines from Fortran try compiling the program with the NOOPTIMIZE qualifier Compiling Fortran programs with the optimizer has caused problems dueto errors in the Fortran compiler F 8 Programmer s Notes for PC TIWAY Host Software for PC User Manual F 6 Linking Programs with the TIWAY Subroutine Library For more information on linking your application with the TI WAY Host Library refer to Section 1 6 for additional link options You may also need to refer to the user guide for the language you are using TIWAY Host Software for PC User Manual Programmer s Notes for PC F9 F 7 Using Upload and Download from an Applications Program If you wish to use the upload and download facilities found in TIUSER with a program you may link these facilities with an application program as follows LINK Your_program UPLOAD TIFUNC TISUBM TISUBF TIBDAT LINK Your_program DNLOAD TIFUNC TISUBM TISUBF TIBDAT F 10 Programmer s Notes for PC TIWAY Host Software for PC User Manual Appendix G 500 505 and Host Computer Data Thereis a sign
98. GET subroutine is similar tothe TIREAD subroutine however TIGET converts to the host format and TIREAD does not TIWAY Host Software for PC User Manual Subroutine Library 10 49 10 38 TIPUT TheTIPUT subroutine is used to convert data from the host format to the 500 505 format and to write to consecutive memory locations in a specified NIM based attached device TIPUT is an implementation of Primitive 30 Call Format BASIC and CALL TIWAY TIPUT istat xtn tag nnnn wi135 sstat FORTRAN CALL TIWAY TIPUT istat xtn tag nnnn wi135 Pascal TIWAY TIPUT istat xtn tag nnnn wi135 sstat TIPUT istat xtn tag nnnn wi135 sstat C tiway tiput amp istat amp xtn amp tag amp nnnn amp wi135 amp sstat tiput amp istat amp xtn amp tag amp nnnn amp wi135 amp sstat Notes on Call Explanations of the terms used in the call format follow Format itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Thetag argument specifies the address list that is to be returned to the caller This argument may take any of the available forms The tag is converted to an address list either by searching the tag table by converting the specification directly or by a combination of the two See Declaration for tag typein Figure 3 1
99. Grsecis roit dr dte dias cute ace ro aces aun Reb Noteson Call Format 225222 40 4t hne C ACCRUE AG e wed dede de E a eae 4 4 Host Adapter Command Code Subroutines 4 5 TIVAY Primitive Subroutines ccccccccccccc na nar n nara rara nna 4 6 CIM Functional Command Subroutines TIWAY Host Software for PC User Manual TIWAY Interface Subroutines Topical 4 1 4 1 4 2 Overview To assist application programmers the TI WAY Interface Subroutines provide high level network services through the subroutine call facility This set of subroutines must be linked with the applications program The dasses of subroutines available in this library indude e Session Control Subroutines These subroutines must be called by the application program to initiate and terminate the use of the TI WAY library subroutines See Section 4 2 e Host Adapter Command Code Subroutines These subroutines correspond directly to the Host Adapter Command Codes The data necessary to create a Host Adapter Command Code command buffer and the pertinent data to be returned by the response to that command code are passed as arguments to the subroutine call See Section 4 4 e TI WAY Primitive Subroutines These subroutines correspond directly to a subset of the TIWAY Primitives The data necessary to createa TIWAY Primitive command buffer and the pertinent data to be returned by the response to that Primitive are passed as arguments to the subroutine call See Sect
100. Hex number of words 01 80 DDDD Data to be written Read I mage Register 62CAAANNN X CR Y AAA Hex starting address NNN Hex number of bits to read 001 100 for X or Y 001 200 for CR B Hex value of 4 bits Write Image Register 63CAAANNNB 63B EI A C 2 CR 63 HDLC 4 Y AAA Hex starting address NNN Hex number of bits to write 001 100 for X or Y 001 200 for CR B Hex value of four bits Clear User Memory 640M 1 L memory 2 V memory Cumulative 4 C memory TIWAY Host Software for PC User Manual CIM Functional Command Codes C 1 Table C 1 CIM Functional Command Codes continued Meaning Corman MAN Download memory 65SSMMOODDDD 65SSMMII or 65SS where or 65SS SS 2 where SS 2 initial download block continue download terminate download request download L memory V memory Cumulative C memory CCU not in start up C and L in ROM extended C extended L hex data Upload memory 66SSMM 00 66SSMMIIDDDD initial request continue terminate repeat previous block L memory V memory Cumulative C memory C andL in ROM extended C extended L hex data Read errors 67XXNNCCNNCC hex number of error types hex error number 00 2F hex error count 00 FF Clear error hex error number 00 2E or FF FF clears all errors Get CCU status 69XY start up hold run remote not run program C 2 CIM Functional Command Codes TIWAY Host Software for PC U
101. I RWL SH RWL SL RWL YP RWL SS RWL ACK RWL SS 4002 N 1 MAP 0000 01 01 NMAP TM RWL DT RWL YR RWL MCH 01 RWL MCH 02 RWL 0001 01 01 NMAP MCH 05 RWL MCH 06 RWL MCH 07 RWL MCH 08 RWL 0002 01 01 NMAP MCH 10 RWL ACK RWL SS 4004 SPINDLE VALUES SS 4008 N 1 VAL SS 4010 VALUESL UESL L MCH 07 RWL MCH 08 RWL MCH 09 SS 4020 VALUESLUE UESL L MCH 07 RWL MCH 08 RWL MCH 09 SS 4040 VALUESLUE Al jUESL L MCH 07 RWL MCH 08 RWI ss 4080 VALUESLUE 1 JUESL CH 07 RWL MCH 08 RWI ss 4100 VALUESLUE 1 UESL L H 07 RW 08 RW SS 4200 VALUESLUE 1 UESL L H 07 RW 08 RW SS 4400 VALUESLUE 1 jUESL L H 07 RW 08 RW SS 4800 VALUESLUE i UESL L H 07 RW 08 RW SS 5000 VALUESLUE 1 ESL L 07 RW 08 RW SS 6000 VALUE E 1 ESL L 07 RW 08 RW Figure 6 18 Unilink Specific Segment Upload File Example TIWAY Host Software for PC User Manual File Transfer Subroutines 6 33 7 1 7 2 7 3 Using TIUSER and TIPROG 00ococccccc nnn mI nsnm TIUSER Utility ACTIVATE COMMANG os fica ci oid a ead bas backs bad oud as CHANGESIATE Command 2 ccc HH a eer bens DEACTIVATE COMMA xci hc cic rcc ecce cete bg eee ec ean es DOWNLOAD
102. IGET command reads consecutive memory locations from a specific Secondary and converts the data from the 500 505 format The TG command is an implementation of Primitive 20 TIPROG gt TG Tag specifier 40102010001 Number of data elements decimal 10 Data element 1 decimal and hex 1 0001 Data element 2 decimal and hex 2 0002 Data element 3 decimal and hex 3 0003 Data element 4 decimal and hex 4 0004 Data element 5 decimal and hex 5 0005 Data element 6 decimal and hex 6 0006 Data element 7 decimal and hex 7 0007 Data element 8 decimal and hex 8 0008 Data element 9 decimal and hex 9 0009 Data element 10 decimal and hex 10 000A TIPROG gt TP Command TheTIPUT command writes consecutive memory locations in a specified Secondary and converts the data from the host format to 500 505 format The TP command is an implementation of Primitive 30 TIPROG gt TP Tag specifier 4010201000B Number of data elements decimal 2 Next 16 bit data element decimal or hexH C3C3H Next 16 bit data element decimal or hexH 0001H TIPROG gt TR Command The 500 505 read command reads consecutive memory locations from a specified Secondary Data are returned in 500 505 format The TR command is an implementation of Primitive 20 TIPROG gt TR Tag specifier 40102010001 Number of data elements decimal 10 Response buffer 20 bytes received 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 00 09 00 0A TIPROG gt 7 30 Interact
103. M 550s only TIPROG gt CW Tag specifier 40102010001 Number of data elements decimal 5 Data element 1 hex 1 Data element 2 hex Data element 3 hex Data element 4 Data element 5 Data element 6 Data element 7 Data element 8 Data element 9 Data element 10 2 3 hex 4 hex 5 hex 6 he 7 hex 8 hex 9 he 1 229099989 0 RL Command The read loop command reads loop parameters You are prompted for a loop number that determines the type of data returned valid for PM 550s only Possible responses are 01 display only 02 tuning only 03 display and tuning Notice that the combination of all loops and display and tuning combined is not allowed The first example below uses an ASCII string to respond to the tag specifier prompt the second uses a tag name TIPROG gt RL Tag specifier 0102 Loop number decimal 1 Requested loop data decimal 33 10 00 00 00 00 00 00 00 00 01 00 00 00 00 00 04 26 40 00 00 00 00 00 00 TIPROG gt RL Tag specifier SETPT Loop number decimal 1 Requested loop data decimal 03 10 03 EC 80 00 00 00 00 00 01 00 00 00 00 00 04 26 40 00 00 00 00 00 00 00 00 00 04 11 00 00 00 00 00 00 04 33 E7 FD 80 TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 33 TIPROG Utility continued R1Command TheR1 command the equivalent of the RNDRD1 subroutine defines a data acquisition block valid for
104. ORTRAN packed array 1 275 of byte Pascal tibuf The write only 500 505 buffer argument is the destination buffer 500 505 format Declaration byte array FORTRAN packed array 1 275 of byte Pascal Notice that no buffer lengths are passed They areimplied from the tt and nnnn arguments The HST2TI subroutine is the reverse of the TI 2HST subroutine TIWAY Host Software for PC User Manual Subroutine Library 10 29 10 21 INIT INIT reserves system resources used by the software package Call Format BASIC and CALL TIWAY INIT istat xtn portstr FORTRAN CALL INIT istat xtn portstr Pascal TIWAY INIT istat xtn portstr INIT istat xtn portstr C tiway init amp istat amp xtn amp portstr init amp istat amp xtn amp portstr Notes on Call Explanations of the terms used in the call format follow Format xn Thetransaction number must be zero There is no valid second half entry point for any subroutine that does not actually access the H ost Adapter portstr Used to select and initialize the appropriate communications port This must be an ASCII string specifying the port number baud rate number of data bits number of stop bits parity number of retries and length of time out in hex The following is an example of a port set up string P1 19200 7 1 E 3 A This string specifies port 1 19200 baud 7 data bits and 1 stop bit standard for the host adapter even parity
105. P DOWN NO DISC UP AFTER CTS DELAY DOWN NO DELAY W H 2 Unilink Dipswitch Reference Card TIWAY Host Software for PC User Manual A Activate ACTVAT ACTVAT 4 8 Adapter diagnostics ADIAG 4 8 7 22 Addressing arguments 3 18 ASCII specification binary seinen 19 data elements 3 17 highways Eu secondaries tag name ii fiction 338 3 18 ADIAG Arguments addressing 3 6 buffers command read response write EE data mani platon 3 23 diagnostics list of subrantine 3 masks networ M 3 27 status Asynch conos 27 B BLDMSK 10 7 BRDCST 10 8 Broadcast BRDCST 4 8 7 23 10 8 Buffers command Build ae BLDMSK 10 7 Index C C dedarations C declarations list isop CCUSTS Change state CH can CHNGST 4 12 10 11 ional oe C 4 EI 14 16 10 40 LETTIOHTI30 47 10 42 10 43 4A4ll 10 won e pog CIMRD 4 15H4 cunei CIMWR Command em om adapter Compiling 1 12 Teo host 2 2 2 3 supported languages 2 5 CONFIG Configuration CONFIG 7 27 10 17 10 18 Configuring Unilink 9 2 Customer support 1 3 Index 1 D H Data acquisition 2 2 Hardware requirements 1 2 Data element types 3 14H 3 16 Help technical support 1 3 list of 3 14H3 16 Host MEE commands A 3 Pete ie conversi on 2 5 network activity statistics 10 5 DEACT 4 9 10 187 10 19 Host to Tl HST2TI 7 37 10 29 Deactivate
106. PAS Pascal examples Sample BAS BASIC examples Example command procedures for compiling and linking these programs in C are provided in MAKEC BAT and SampleC MAK Other language compiling and linking information is documented in this manual and additional information is located in readme Programmer s Notes for PC TIWAY Host Software for PC User Manual The example programs and command files are all located in the subdirectory where you installed the TI WAY Host Software and are accessible after installation of the TI WAY Host Software Package for personal computers E ach example program contains a call to subroutine s in the TIWAY Subroutine Library FULLSAMP C contains a call to each subroutine in the TIWAY subroutine library It is important to have a thorough understanding both of the language being used and of how it passes arguments All arguments passed to TI WAY subroutines must be passed by reference The one exception is thetag argument that can also be passed by descriptor Most languages do pass integers and arrays that make up the majority of the TIWAY subroutine arguments by reference Since character strings are seldom used except for thetag argument the default argument passing mechanisms of most languages are usually sufficient The one exception to this rule is C which passes integers as values by default For more information on calling TIWAY subroutines in C refer to the Programmer s Notes below The argumen
107. PM 550s only The block can be activated to gather the specified data using the R2 R3 or R4 command TIPROG gt R1 Tag specifier 0102 Number of blocks decimal 3 Defining the first data acquisition block Tag specifier 40102010001 Number of data elements decimal 10 Defining the second data acquisition block Tag specifier 40102020001 Number of data elements decimal 10 Defining the third data acquisition block Tag specifier 40102010064 Number of data elements decimal 2 R2 Command TheR2 command the equivalent of the RNDRD2 subroutine gathers a block of data or a group of blocks previously defined using R1 or R3 The buffer returned contains only the data specified by the blocks and those data are in 500 505 format valid for PM550s only TIPROG gt R2 Tag specifier 0102 MSB is block 16 LSB is block 1 Mask of data acquisition blocks hex four digits 0005 01 02 03 04 05 06 07 08 09 0A 00 00 00 00 00 00 00 00 00 00 00 00 10 00 7 34 Interactive Operator Utilities TIWAY Host Software for PC User Manual R3 Command TheR3 command the equivalent of the RNDRD3 subroutine gathers data from a block of data acquisition blocks specified by a mask and defines new data acquisition blocks valid for PM550s only TIPROG gt R3 Tag specifier 0102 Number of blocks decimal 3 Defining the first data acquisition block Tag specifier 40102010001 Number of data elements decimal 10 Defining the second da
108. Riaokiadoraciucbid rg ado a baat LISECOMMANG 21er taceo C ade tee d de ele Pee E Ee ae Ede a dao SIATISTIC S COMMANG ici A ECKE RH as UPLOAD COMMANA sui teet eee tte e ERE REGED ute d a ad VERIFY Command susto ioa hioc hate Ama prac pra cid ia aaa dea qoas E d OUT Command sirane tree anda terree arca er el T de e rte Ain vi Contents 73 8 1 8 2 9 1 9 2 9 3 10 1 10 2 10 3 10 4 10 5 10 6 10 7 10 8 10 9 10 10 10 11 10 12 TPROG UY 5isissszsasasusuvsVesssk usez4uskusresuesskss xeiokriierka nas Session Control Commands 00occcccccc een Host Adapter Commands iier eer E eben edo E esie NU ee e dace e waded Base HIU Commands ecd ee peas OE Ge EEA a Brae ai TIWAY Primitive Command Su reres direi iiaaaeaoe eere CIM Functional Commands isc ie re A E Ro a Support Commands viii et e ei e E e e tede tele dett e dae ad Chapter8 Tag Table Defining Tag NameS ssssssssssuunssnnnnnnnnnnnnnsnesuusuunnnnnnnnnnnnnuno Building the Big Bible coii avessi iege au eria dew Eod rbrader ion E Chapter9 Network Autoconfiguration File Introduction ssssssssssssssnssnuununnnnnnnnnnnnnnsnusnusuunuunnnnnnnnnnnno Network Autoconfigure File ooocccccccccc Template Record Data RECOM ee bte A cleaner aes RR ug oko ue a a RU aed KR RU CR COMMEN e UTERIS Record EO ING eek ete ERRPRRU dO ded eee fod cee eae Gone EBD Liege RA E Rd Network Autoconfiguration Process cooccccccccccc nnn nnn Chapter10 Subro
109. SIEMENS SIMATIC TIWAY Host Software for PC User Manual Order Number PPX TIWAY 8108 3 Manual Assembly Number 2587871 0008 Third Edition ADANGER DANGER indicates an imminently hazardous situation that if not avoided will result in death or serious injury DANGER is limited to the most extreme situations A WARNNG WARNING indicates a potentially hazardous situation that if not avoided could result in death or serious injury and or property damage A CAUTION CAUTION indicates a potentially hazardous situation that if not avoided could result in minor or moderate injury and or damage to property CAUTION is also used for property damage only accidents Copyright 1996 by Siemens Energy amp Automation Inc All Rights Reserved Printed in USA Reproduction transmission or use of this document or contents is not permitted without express consent of Siemens Energy amp Automation Inc All rights including rights created by patent grant or registration of a utility model or design are reserved Since Siemens Energy amp Automation Inc does not possess full access to data concerning all of the uses and applications of customer s products we do not assume responsibility either for customer product design or for any infringements of patents or rights of others which may result from our assistance MANUAL PUBLIC ATION HISTORY SIMATIC TIWAY Host Software for PC User Manual OrderMan
110. Secondaries connected 02 TIPROG gt XP Command The XP command the equivalent of the XPAR subroutine provides the lowest level of access in TI PROG It allows you to pass commands that are embedded in the appropriate host U HA protocol but not availablein the TIPROG utility as a string of bytes In the example shown below the UHA command code FF is used to reset the Host Adapter NOTE No morethan 128 characters may be entered for a single command buffer If an odd number of characters are entered the package inserts a O preceding the last character For example if FFE were entered the package converts this entry to FFOE a WARNNG Resetting the Unilink can be dangerous in some installations Resetting the Unilink causes a loss of communication which could cause unpredictable controller behavior that could result in death and or serious injury or damage to equipment Do not use this routine without thoroughly understanding how it might impact operations directed by the controller The following example shows how to reset the Unilink from TIPROG NOTE After issuing a reset to the Unilink Host Adapter you must follow these steps 1 Issue a dummy command such as command code 21 to the Unilink Host Adapter using the BDLC host protocol because the first response following a UHA reset returns Reconfigure the Unilink Host Adapter Reconnect all Secondary devices Reallocate all Source IDs Redefine all macros URWN
111. Software for PC User Manual BR Command The broadcast command simultaneously sends a command buffer that you specify to all Secondaries on the highway you specify Before using BR be aware that the command sends a message but does not guarantee or acknowledge that the message has been received Review the cautions listed in the description of the BRDCST subroutine The BR command is the implementation of command code 02 At the CMD prompt you supply a command buffer that contains a TI WAY Primitive The format is length of Primitive Primitive code and Primitive data For more information refer to the XPAR subroutine and to the Secondary user guides Use the PO command to solicit responses to the BR message Prompt TIPROG gt BR Command buffer free format hex CMD 0006200100100001 Response TIPROG gt DA Command The deactivate command is used to disconnect a Secondary from the specified highway preventing any communication between the host computer and the Secondary The DA command is the implementation of command code 05 Prompt TIPROG gt DA List of Secondaries free format hex LIST 2 Response List of disconnected Secondaries 1 Secondaries disconnected 02 TIPROG gt or Prompt TIPROG gt DA List of Secondaries free format hex LIST 010203040506 Response List of disconnected Secondaries 6 Secondaries disconnected 01 02 03 04 05 06 TIPROG gt TIWAY Host Software for PC User Manual Interactive Operator Utili
112. Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used rsplen The rsplen argument must specify the maximum length of the response buffer response buffer size when the POLL subroutine is called It contains the actual length of the response on return The response buffer for POLL contains the entire response to the Host Adapter Command Code including the command code identifier rsp275 The rsp275 argument contains the response from the Secondary The contents of this response depends on the command sent by BRDCST The POLL subroutine must be used after the BRDCST subroutine TIWAY Host Software for PC User Manual Subroutine Library 10 35 10 27 PUTMSG Call Format Notes on Call Format 10 36 Subroutine Library The PUTMSG subroutine takes one argument the composite status as returned from a previous call to a TIWAY Subroutine It prints a message containing the facility code and message code and a text if one exists for that status on the operator s console BASIC and CALL TIWAY PUTMSG gt istat FORTRAN CALL PUTMSG istat Pascal TIWAY PUTMSG istat PUTMSG istat C tiway putmsg amp istat putmsg amp istat Explanations of the terms used in the call format follow itat The status argument is the composite status returned previously by a TIWAY Subroutine Declaration integer TIWAY Host Software for PC U
113. THER istat xtn tag mask rsplen rsp275 sstat Pascal TIWAY GATHER istat xtn tag mask rsplen rsp275 sstat GATHER istat xtn tag mask rsplen rsp275 sstat C tiway gather amp istat amp xtn amp tag amp mask amp rsplen amp rsp275 amp sstat gather amp istat amp xtn amp tag amp mask amp rsplen amp rsp275 amp sstat Notes on Call Explanations of the terms used in the call format follow Format istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used mask See Section 3 9 of this manual for an explanation of masks rsplen The response buffer length argument specifies a maximum length for the data to be returned and the actual length on return in bytes rsp275 The rsp275 argument contains the gathered data in 500 505 format stat The Secondary status argument contains the code for the current state of a specific NI M based attached device Current state means the state the device is in when the response to the subroutine call is returned Current state is returned for all attached devices except Series 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the state that is returned is the state that existed before the subroutine call
114. The memory appears as memory PC transmission address convention order G 2 500 505 and Host Computer Data TIWAY Host Software for PC User Manual The original value is preserved V n 501D hex is stored as 501D in the PC computer If you do not wish conversion to take place then use the TIREAD routine The result of the TIREAD operation is as originally shown memory PC transmission address convention order The V n value is stored in the PC computer as 1D50 hex The corollary to TI GET writing to a Secondary from the PC computer is the TIPUT routine while the corollary tothe TIREAD routine is TIWRIT In other words TIPUT transmits our example 501D in MSB LSB order memory PC transmission address convention order The value is stored in V n as 501D hex TIWAY Host Software for PC User Manual 500 505 and Host Computer Data G 3 G 4 500 505 and Host Computer Data The TIWRIT routine on the other hand transmits in the as is order memory PC transmission address convention order n 1 MSB 2 In this last example 501D hex is stored in the PM 550 as 1D50 hex UsetheHST2TI and TI 2HST routines with data manipulation routines that do not automatically perform the data conversion The TI2HST routine reads our example 501D hex value from the PM550 in MSB LSB order and writes into successive memory in the PC computer in LSB MSB order PC memory transmission convention address order ee TIWAY Host Software f
115. UPLOAD subroutine an attempt is made to upload all requested segments until successfully completed or an error occurs If an error occurs while uploading a segment the upload is terminated and the appropriate istat is returned to you e If a specific segment upload has been requested from a device that does not support program names the program name entered in the TIUSER UPLOAD command or passed to the UPLOAD subroutine should be a string containing one or more blanks 6 6 File Transfer Subroutines TIWAY Host Software for PC User Manual Download When using the download function keep the following guidelines in mind e All Secondary memory is cleared prior to a download e Downloads of previously uploaded transfer files are permitted only to the same device or between like devices i e 520 to 520 565 to 565 etc e Thetarge device the Secondary to receive the download must be in the program mode before a DOWNLOAD is allowed Series 500 505 NIMs must be in the remote mode as well e A memory check is made prior to download to insure that the configuration contained within the transfer file fits into the target device If the transfer file contains 2 kbytes of logic memory the target device must be configured for at least 2 kbytes of logic memory as well e Downloads to the 560 565 cause the memory configuration table to be rewritten The NIM however only updates this table upon powerup or reset In order to achieve this tab
116. UT TP istat xtn tag nnnn wil35 sstat format 30 TIREAD TR bra xtn tag nnnn rsplen rsp275 Reads block 500 505 format The related code numbers given for each subroutine are Host Adapter Command Code numbers See SIMATIC TIWAY Unilink Host Adapter User Manual for a further description of these commands l1 XPAR can be used to send any TI WAY NIM commands The related codes for all the NIM primitives are primitive code numbers All NIM primitive subroutines use Host Adapter Command Code 01 See relevant NIM manual for further description of these primitives TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 3 Reference List of Subroutines and Arguments continued Table 3 1 Subroutines and Arguments Reference List continued Subroutines Name Arguments Description TIPROG TIWAY NIM Primitives continued i Writes a block of data TIWRIT istat xtn tag nnnn wb275 sstat SIMATIC TI format WRBUF istat xtn tag cc nnnn wb275 pstat sstat Performs buffered write istat xtn tag nnnn wb275 mask rsplen Writes and gathers blocks with WRTGAT rsp275 sstat mask 52 CIM Functional Commands CIMWR CW istat xtn tag nnnn wb275 Writes data RDLOOP RL istat xtn tag rtype rsplen rsp275 Reads loop data RNDRD1 R1 istat xtn tag nblk taglst nnlst Defines blocks 6D 00 RNDRD2 R2 istat xtn tag cmask rsplen rsp275 Gathers blocks using mas
117. WAY Interface Subroutines Topical TIWAY Host Software for PC User Manual Host Adapter Command Code Subroutines continued ACTVAT ADIAG BRDC ST Before any communication is allowed with a Secondary the Secondary must be logically connected to the network using the ACTVAT subroutine After the Secondary has been connected the host computer can communicate freely with it If a Secondary is connected to the highway when the call is issued it can be included in wi4 and is listed as successfully connected ACTVAT is the implementation of command code 04 The ADIAG subroutine returns a list of statistics diagnostics collected by the Host Adapter about the Host Adapter s network usage ADIAG is the implementation of command code 08 The BRDCST subroutine broadcasts the user specified command buffer to all Secondaries on the specified highway The command buffer must be one that all the Secondaries can interpret Using BRDCST lowers the overhead associated with long command buffers that are issued to several Secondaries BRDCST is the implementation of command code 02 NOTE The Secondaries do not immediately respond to the broadcast the individual responses must be solicited by using POLL PM550 CIMs PPX PM 550 502 and PPX PM 550 503 do not support the BRDCST subroutine and ignore all broadcast messages PM550 NIMs PPX PM 550 5038 PPX PM 550 5039 and PPX PM 550 5040 support BRDCST The BRDCST routine is intended to be im
118. Y Host Software Object Library for compiled application programs contains eight separate object modules E ach supported language uses its own specific object modules except MS FORTRAN and MS Pascal which use the same object modules There are two object modules which are used with all languages when the message facilities of the software are included The object files are listed in Table 1 2 by language Table 1 2 ObjectFiles tangas Timkorde MS FORTRAN 1 TIWAYPF OBJ MS PASCAL 2 TIMSGPF OBJ 1 TIWAYBCM OB 2 TIMSGCM OBJ 7 1 TIWAYC OBJ All compiled languages 5 MEC Ont The order in which the above object files and your application program are linked to the MS DOS operating system is extremely important to the correct operation of your program The link order for each language is specified Carefully read the description of the linking order for the language you intend to use and follow it exactly MS BASIC Compiled NOTE Additional information regarding Linking with other compilers is provided in the file named readme The message facility may or may not be used and for this reason has been separated from the rest of the package TIWAY Host Software for PC User Manual Installation 1 19 MS FORTRAN without messages Link YOURPROG TI WAY PF F ORTRAN MS FORTRAN with messages Link ALIGN MSG TIMSGPF Y OURPROG TIWAY PF YOURPROG FORTRAN M S Pascal without messages Link YOURPROG TI WAY PF Pascal M S Pa
119. a simple subroutine interface for formatting a command buffer sending it to a Host Adapter and by proper format through a Host Adapter to any connected Secondary and receiving a copy of the entire response This transaction gives you the ability to use facilities that are not supported by other TIWAY Subroutines TI WAY Primitives that are not supported CIM Functional Commands that are not supported and all Task Codes A specific example is the Host Adapter Reset Command Code FF XPAR provides two services First the command and response buffers are formatted to contain the data to be interpreted by the Host Adapter without including the link level protocol encapsulation NITP or BDLC protocol packet Second optional error detection is provided for Host Adapter TIWAY Primitives and CIM Functional Commands The CIM Functional Command error checking is also suitable for PM550 CCU Task Codes Use an error checking argument to determine the amount and type of error checking performed The XPAR simply generates the message delimiters the character count and the checksum for the message body you supply NOTE You should be familiar with the Host Adapter and any addressed Secondaries before using the XPAR subroutine TIWAY Host Software for PC User Manual TIWAY Interface Subroutines Topical 411 4 5 TIWAY Primitive Subroutines Each TI WAY primitive subroutine corresponds with a TIWAY Primitive The intent is to provide the applica
120. ached devices except Series 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the state that is returned is the state that existed before the subroutine call was issued Table 3 7 shows the seven possible values 5 integer local input output memory size TIWAY Host Software for PC User Manual Subroutine Library 10 17 10 12 DEACT The DEACT subroutine logically disconnects one or more Secondaries from the specified highway Disconnecting a Secondary removes that Secondary s entry from the host adapter s Secondary log preventing any communications between that Secondary and the Host Adapter until the Secondary is again connected to the Host Adapter with the ACTVAT subroutine DEACT is the implementation of command code 05 The DEACT command results in the issuing of an HDLC DISC tothe Secondary depending on the configuration of the UHA NOTE A Secondary is successfully disconnected only if it is connected and functioning properly when DEACT is issued When a NIM is disconnected it resets the test mode is entered and the NIM executes its startup sequence A Series 500 NIM attached to a 560 or 565 has its memory configuration table updated at this time Call Format BASIC and CALL TIWAY DEACT istat xtn hwy wilen wi4 rilen ri4 FORTRAN CALL DEACT istat xtn hwy wilen wi4 rilen ri4 Pascal TIWAY DEACT istat xtn hwy wilen wi4 rilen ri4 DEACT istat xtn hwy wilen wi4 rilen ri
121. acking Up Your SoftWare ss sca ciesatereaerpe e RERO RERNI E aa haa PR EA baat dtes Installation ciis eri o UE eR en ACER Phe HERR CER ERE ROC ERR E Ken Program linking 55 2534 oce nicas casa ae Object Code Files cresen eren hene ste viewed ie tds Linking on the PC iie Ree RE RET ECEREG CE FD Iia SR Ed kd aue E Dnk O pONS dm Latlice O m Compiling with Lattice C Executing in Interpreted BASIC oocccccccccccc nnne nnn nnn Getting Started 1 dpud eer oe e va eere ata ctt Typical BASIC StartUp ees eene e termes otc Price Micke dace Eck e ER Calling Subroutines in BASIC 20 me Subroutine Calling Parameters 00 cece m Passing Parameters to Subroutines Named Tag Table Maintenance cccccceeeeee eee ee nnn Creating the Named Tag Table eee eet ett Accessing a Named Tag Specification 6 60 eee Chapter2 Overview 2 1 2 2 TIMAY System Characterislics coocccccccccc eee eee eee 2 2 Host Software Functions s esses hh nu narra naar ara 2 3 Levels of Communication Lo eee eee eee e ees 2 3 Languages Supported ccccccccccc een ener 2 5 Data Format Gorwvetfso euer ee dat C done e Cea e Oel ORC e era ede 2 5 Contents iii Chapter3 TIWAY Subroutine Calling Arguments 3 1 3 2 3 3 3 4 3 5 3 6 37 3 8 3 9 3 10 3 11 OVerVileW viiz ax kei a cia Reference List of Subroutines and Argument
122. added to each line by placing a space between the data address and the comment The tag table is loaded into memory by executing the file TAG EXE This fileis executed by typing TAG and pressing the return key when the monitor prompt is displayed This program will load the tag table in the PC s memory If desired the table can be edited and reloaded by issuing the TAG command again at any time Tags are stored in file TAG TBL 1 26 Insta lla tion TIWAY Host Software for PC User Manual Named Tag Table Maintenance continued Accessing a To access a Named Tag specification from a program use the name in the Named Tag form of an ASCII string as the tag argument in the TI WAY subroutine calls Specification The TIWAY subroutines interpret a value in a tag argument field as follows e fthefirst byte in the string is an ASCII 7 then the remainder of the string is interpreted as an ASCII specification e If the first byteis an 0 then the string is interpreted as a binary specification Otherwise the entire string is a key and the TAG region is searched for the specification definition When using Pascal FORTRAN C or C the tag name may be specified immediately within quotes or may be the value of a variable which contains the ASCII string In BASIC only the specification of a tag name within a variableis allowed BASIC does not support the immediate specification TIWAY Host Software for PC User Manual Installation 1 27 2 1
123. ag names is defined within a text file called the tag table A means of automatically configuring the Unilink Host Adapters on a TIWAY network called the Network Autoconfiguration File is also described See Chapter 9 TIWAY Host Software for PC User Manual Eight appendices are provided They are e Host Adapter Command Codes e TIWAY Primitives e CIM Functional Command Codes e SIMATICePM550 CCU Task Codes e Error Listings e Programmer s Notes for PC e 500 505 and Host Computer Data e Unilink Dipswitch Reference Card Related Several related publications that are available from Siemens Energy amp Publications Automation Inc should be used in addition to this manual These publications are listed below Manual Title Manual Number SIMATIC Unilink Host Adapter User Manual PPX TIWAY 8121 SIMATIC 505 TIWAY Network Interface Module NIM PPX TIWAY 8124 x User Manual Unilink Universal Network Adapter Installation and PPX TIWAY 8106 Operation Manual TIWAY Host Software for PC User Manual Preface xv Technical Assistance xvi Preface Several other related publications are available that may also be helpful in addition to those listed above SIMATIC 520C 530C Programmable Controller U ser PPX 530 8107 Manual SIMATIC 505 Programming Reference Manual PPX 505 8104 x SIMATIC 530 Programmable Controller User Manual PPX 530 8101 Micro Remate Control Unit User Manual PPX IT 160 If you need additio
124. al Status is returned in sstat as usual The RDSTS subroutine returns status information that can be affected by the CHNGST subroutine Not available for all Secondaries TIWAY Host Software for PC User Manual Possible Values Symbol Value Device Definition sstat Attached Device Operational Status Mode 00 Operational and performing instruction data type and loop execution RUN 01 Operational and performing instruction and data type and loop execution with a non fatal error detected RUN with non fatal error 02 Operational and not performing instruction data type execution with loop execution PROGRAM 03 Operational and not performing instruction data type or loop execution START or REMOTE 04 Operational and not performing instruction data type execution with loop execution and a non fatal error detected PROGRAM with non fatal error 05 Operational and not performing instruction and data type or loop execution and a non fatal error is detected START or REMOTE with non fatal error 80 Not operational due to a fatal error condition FATAL ERROR ri32 1 Attached Device Auxiliary Power Source Status 00 Auxiliary power source good 01 Auxiliary power source not available 80 Auxiliary power source bad see Secondary user manuals for more information ri32 2 Secondary Operational Status 00 Operational 01 Channel A is not functional 02 Channel B is not functional ri32 3 Secondary local remo
125. an iary4 Array 1 4 of integer iary32 Array 1 32 of integer iary135 Array 1 135 of integer iary254 Array 1 254 of integer mask type Packed Array 1 32 of Boolean Case ARRAY OPTION of o byte e byte bary275 o int e int Array 1 69 of integer o real e real Array 1 69 of real End tag array Array 1 32 of tag type tag type Casetag option of asd Packed Array 1 11 of char ASCII binry Array 1 5 of integer Binary tag nam Packed Array 1 16 of char Tag Name End wiary256 Array 1 256 of word integer Figure 3 2 Pascal Declarations TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 9 Reference List of Arguments continued Table 3 3 contains the Argument Reference List for BASIC and C C Table 3 3 Argument Reference List for BASIC and C C hwy oo highway number hwy mm tag tt data element type PC port setup string data element type address specification tt data element type Declaration BASIC Declaration C C Addressing integer array integer int read only integer char byte array integer integer array integer Buffer Specification Command buffers integer array mes Read buffers integer array iary32 cmd275 command buffer command buffer length reponse bia ri32 response buffer read write ri254 response buffer integer array iary254 read write rilen respons
126. and type HE A WARNNG O The TIPROG utility is intended primarily as a tool for you the TIWAY applications programmer It provides you with interactive access to the TIWAY Subroutine Library It prompts you for the required arguments and displays the returned data and status messages It should be noted that TIPROG gives full access to all TIWAY functions and you must exercise caution if you are accessing Secondaries which are controlling operating machines and processes Remote state changes could cause unpredictable controller behavior that could result in death and or serious injury or damage to equipment Do not use this routine without thoroughly understanding how it might impact operations directed by the controller 7 16 Interactive Operator Utilities TIWAY Host Software for PC User Manual Table 7 3 Alphabetized List of IPROG Commands with Subroutines and Primitives TIPROG Equivalent Subroutine Command Session Control Subroutines FI Finish TIWAY Subroutines FIN Session control IN Initialize TIWAY Subroutines INIT Session control TIWAY Primitive Subroutines x ewmeestaerdenesam A NS ex Gmeniuraum CIC TWA Primitives DE ainewata ods OEFBLK TIWAY Primitives S LEA qm Get Primitive length GETLEN TIWAY Primitive 04 Rel 1 0 NIM native Task Code NATIVE TIWAY Primitive 01 RS Readstatus Ross Tiway Primitives TG Read data host format TIGET TIWAY Primitive 20 TP Write data
127. apter Included are tables that can be used as quick reference to arguments used by each subroutine calling conventions and data element types e TIWAY Interface Subroutines Topical See Chapter 4 The TIWAY Subroutine Library described later in this manual encompasses all of the commonly used Host Adapter Command Codes NIM primitives and CIM Functional Commands e TIWAY Support Subroutines See Chapter 5 The TIWAY Support Subroutine Library described later in this manual provides a wide range of host computer services including logical to physical address conversion and data format conversion e File Transfer Subroutines See Chapter 6 TIWAY Host Software for PC User Manual Preface xiii xiv Preface e Interactive Operator Utilities See Chapter 7 Two Interactive Operator Utilities described later in this manual provide generalized access to the facilities available through the TI WAY libraries The purpose of the TIUSER Utility is to provide a shortcut to selected network management functions e g connecting or disconnecting Secondaries The primary purpose of the TIPROG Utility is to provide an interactive programmer interface to the Host Software As such TIPROG serves as a useful tool for learning the applications before coding them and is useful for short ad hoc requests for information or supervisory control Because many of the calling arguments are common to most of the TI WAY subroutines the calling ar
128. artial download Constant memory partial download S memory loop tables partial download S memory analog alarms partial download S memory SF programs partial download S memory SF subroutines partial download IR WF memory partial download WXY memory Unilink specific segment download which is translated to mmmm field in primitive where SSeS OEE Set to select specific segment requested for upload Always set to 1 for mmmm Set to 1 for extended mmmm NOTE For ftype gt 4000 the passed ftype value is masked with the mask value in the upload file For download selection of a specific segment to occur the bits must match This implies partial segment download is supported flen Length of file specification filename Declaration integer fnam File specification filename for uploaded data Declaration string or character array TIWAY Host Software for PC User Manual Subroutine Library 10 23 10 15 HLL TheFILL subroutine is used to fill a number of contiguous data elements starting at a specified address FILL is the implementation of Primitive 32 Call Format BASIC and CALL TIWAY FILL istat xtn tag nnnn pattern sstat FORTRAN CALL FILL istat xtn tag nnnn pattern sstat Pascal TIWAY FILL istat xtn tag nnnn pattern sstat FILL istat xtn tag nnnn pattern sstat C tiw
129. ask The PC version of the software only supports one highway therefore hwy 1 secadd The secadd argument is the TIWAY Secondary address set by NIM dip switches for the specified Secondary tt Thett argument is the data element type in the controller aaaa Theaaaa argument is the data element location in the controller 10 32 Subroutine Library TIWAY Host Software for PC User Manual 10 24 LKUIGS TheLKUTGS subroutine returns address information that describes the address specification passed to it The address specification can be any of the available types tag name ASCII or binary LKUTGS looks up a tag name or derives the address information from the address specifier LKUTGS and LKUTGL are identical in function they differ in providing different granularity of address information and are distinguished by the number of arguments passed to them Call Format BASIC and CALL TIWAY LKUTGS gt istat xtn tag addlst FORTRAN CALL LKUTGS istat xtn tag addlst Pascal TIWAY LKUTGS istat xtn tag addlst LKUTGS istat xtn tag addlst C tiway Ikutgs amp istat amp xtn amp tag addlst Ikutgs amp istat amp xtn amp tag addlst Notes on Call Explanations of the terms used in the call format follow For Dedaration Format Types see Table 3 2 and Table 3 3 istat Error codes arereturned in the status field xn Thetransaction number must be zero tag Thetag argument specifies the ad
130. ata record format is shown in Figure 9 2 AAAAA nn nn nnn Figure 9 2 Network Autoconfiguration File Data Record Format Data records must start with one of the following keywords ALCHBW is used primarily to assist you in ALCNMB CFGHIU CNFGHA CNFGNM END EOF and HWY Each keyword correlates to a specific data record type TIWAY Host Software for PC User Manual Network Autoconfiguration File 9 3 Network Autoconfigure File continued HWY Record The HWY record begins the definition for a particular UHA and contains a flag that determines whether the UHA should be reset or not SeeFigure 9 3 Host Adapter Identifier Reset 1 232 Y N V Figure 9 3 HWY Record Format CNFGHA Record The CNFGHA data record configures the UHA specifies the HIU address and a maximum secondary address and allocates memory See Figure 9 4 kckck ck UHA CONFIGURATION kk UHA Configuration HIU in EHA mode HIU in Memory EHA mode Maximum Allocation IU HIU Secondary 0 16K M onlyaddressaddress 1 24K HIU 0 254 1 254 2 as much as possible VV VV CNFGHA Figure 9 4 CNFGHA Record Format 9 4 Network Autoconfiguration File TIWAY Host Software for PC User Manual CFGHIU and ALCHBW Records The CFGHIU and ALCHBW records are used to configure either a HIU or a MHIU Figure 9 5 shows CFGHIU and ALCHBW records KKKKK UHA CONFIGURATION HIU Configuration
131. ation 1 25 1 8 Named Tag Table Maintenance This section tells you what a tag and a tag table mean and how to build and install the TI WAY tag table A tagis a data structure that uniquely identifies the path to a piece of information located in a TIWAY Secondary There are three methods of specifying a tag e Binary specifications array of integers immediately specifying the path e ASCII specifications ASCII string immediately specifying the path e Named specifications logical name indirectly referencing a path Specifying of a tag is further discussed in Chapter 8 Creating the Named tag specifications are defined in the MS DOS file TAG TBL This file Named Tag Table can be edited using any ASCII text editor Comments for the user of this file are indicated by the character in the first column of any line The maximum length of a tag is determined by a four digit hexadeci mal number that is the first uncommented linein thefile After this appears tag specifications or additional comments can follow Each uncommented line in the file is used to specify one tag The first item in each line specifies the tag name A space is used to separate the tag name from the second item which is the highway number always 01 for the PC version of the TI WAY Host Library The third item specifies the Secondary address in hex the fourth specifies the data element TT type and the fifth specifies the address in hex Comments can be
132. ations port e As several host computers that communicate through their respective communications ports to a single network A logical means for identifying each network is provided through the hwy argument This argument is a logical means of identifying a specific UHA TIWAY network attached to a host computer communications port The value of hwy is always set to 1 on the PC version of the TI WAY Host Software Package Each Secondary on a TI WAY network has a unique Secondary address in the range 01 to 254 decimal If the Secondary is attached to redundant media this address is used for both media The data element type spedifies a set of memory locations within a Secondary The list of data element types is listed in Table 3 4 Secondaries using CIM interfaces PM 5505 use a different set of data element types than Secondaries using NIM interfaces however data element types are always specified as one of the NIM data element types and the software converts that to the appropriate CIM type TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 17 Addressing continued Data Element Location Selection Addressing Arguments Address Specification After the data element type has been specified an individual piece of data is selected by a data element location When a single address must reference a block of data the base data element location specifies the first address of a block of data F
133. ave Remote State Rev 8 0 only Write L Memory Instruction or Argument 14AAAADDDD 14DDDD AAAA Starting address C000 CFFF for 2K C000 DFFF for 4K DDDD Instruction or argument NOTE Enter all parts of timer or counter instruction with one Task Code TIWAY Host Software for PC User Manual PM550 CCU Task Codes D 3 Table D 1 CCU Task Codes for PM550 continued Meaning Programming Status 0 Program in progress 1 Program complete 2 Program incomplete 3 Erase error X 1 TMS2516 EPROM 2 TMS2532 EPROM AAAA Address of invalid verify Fill L Memory AAAA Starting address C000 CFFF for 2K C000 DFFF for 4K NNNN Number of addresses to fill FFFF Data word to fill in memory Delete an L Memory AAAA Address C000 CFFF for 2K C000 DFFF for AK DDDD Words to be inserted Insert Words Into L Memory AAAA Starting address C000 CFFF for 2K C000 DFFF for 4K DDDD Words to be inserted Find an L Memory Word Task Code starting address C000 CFFF for 2K C000 DFFF for 4K or response address of XXXX XXXX Word to be found MMMM Bits to be ignored Find IR Address of L Memory AAAA Task Code starting address C000 CFFF for 2K C000 DFFF for 4K or response address of XXXX XXXX Word whose address is to be found DDDD Word at AAAA D 4 PM550 CCU Task Codes Task Code Response 15 15NXAAAA m 17AAAA 17DDDD 18AAAADDDD 18DDDD 19AAAAXXXXMMMM 1
134. ay fill amp istat amp xtn amp tag amp nnnn amp pattern amp sstat fill amp istat amp xtn amp tag amp nnnn amp pattern amp sstat Notes on Call Explanations of the terms used in the call format follow Format istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Thelong form form of the address highway and Secondary must be used nnnn The nnnn argument specifies the number of data element locations to be filled Each data element is two bytes long pattem The pattem argument is an integer field that fills a consecutive block of memory on a specified NIM based attached device The pattem argument is always a word in host format which is converted to 500 505 format before being sent to the attached device The valid range for pattem is O to 65535 stat The Secondary status argument contains the code for the current state of a specific NI M based attached device Current state means the state the device is in when the response to the subroutine call is returned Current state is returned for all attached devices except Series 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the state that is returned is the state that existed before the subroutine call was issued Table 3 7 shows the seven possible values 10 2
135. ble density e Onehard disk drive with 1 Megabyte available disk space e Oneserial port e Supported compiler e Appropriate software language manual s NOTE The hard disk drive can be replaced with the floppy disk drive if desired However this is not recommended due to the amount of disk storage space necessary to store data and develop programs TIWAY Host Software for PC User Manual Software Requirements Customer Support You need the following software to install and use the TI WAY Host Software Package e Operating System MS DOS Revision 3 0 or later e Oneor more of the following programming languages Microsoft C Microsoft C MS BASIC Interpretive or BASIC for IBM PC Interpretive Compiled BASIC MS QUICKBASIC MS FORTRAN MS Pascal Borland Turbo Pascal Lattice C NOTE The software listed above may be purchased from your local computer dealer NOTE Support for QUICKBASIC and Turbo Pascal is provided using a limited subset of this package which indudes only the functions INIT XPAR and FIN f you need assistance with the procedures outlined in this manual contact your Siemens distributor or sales office If you need assistance in contacting your distributor or sales office in the United States call 800 964 4114 You may also contact the Technical Services Group at 423 461 2522 TIWAY Host Software for PC User Manual Installation 1 3 1 2 PC Software Package Files Table 1 1 contains a li
136. broutines can be executed TIWAY Support Routines TIWAY Host Software for PC User Manual Table 5 1 Reference List of Support Subroutines EEN E AMA BLDMSK Builds a mask from a list of block numbers GETMSG istat EU en str80 Returns Returns the text of an error message text of an error Returns the text of an error message tat xtn tt HST2TI latat XEN EG AND Performs conversions from host format to 500 505 format hstbuf tibuf istat xtn tt fmt tilen LKUFMT Looks up a data element type returns format information hostlen cimtyp LKUTGL istat xtn tag hwy Looks up a tag name returns an address parameter list long secadd tt aaaa format LKUTGS istat xtn tag addlst Looks up a tag name returns an address parameter list short 9 format PUTMSG istat Displays an error message on a your terminal istat xtn tt nnnn tibuf TI2HST hstbuf Performs conversions from 500 505 format to host format TIXTN istat xtn Calls the second half of a subroutine that does I O and returns an error message if I O is not complete TIXTNW istat xtn Calls the second half of a subroutine that does I O and waits to respond when I O is complete These subroutines are not part of the main TI WAY subroutine library In order to reduce the size of applications programs they are located in a separate library module TI MSG which may be linked if needed TIWAY Host Software for PC User Manual TIWAY Support Routines 5 3
137. cate HIU bandwidth IEA DEE Po JA Report HIU bandwidth allocation 08 ReportHIUStatus i 2 n 3 5 z 5 z For further details refer to the SIMATIC TIWAY UNILINK Host Adapter User Manual PPX TIWAY 8121 x TIWAY Host Software for PC User Manual Hos Adapter Command Codes A 1 Table A 1 HostAdapter Command Codes continued Command Code Report network manager network statistics A 2 Host Adapter Command Codes TIWAY Host Software for PC User Manual Appendix B TIWAY Primitives Table B 1 TIWAY Primitives Universal Command Language Exception reporting Buffered write Read block single contiguous block 33 50 Define block up to 32 separate blocks Gather blocks as defined 3 Define records up to 32 separate records 6 Gather defined records 57 Write and gather defined records 60 Unilink Secondary Adapter See the individual TIWAY NIM user manuals for the subset of TIWAY primitives supported by each Secondary TIWAY Host Software for PC User Manual TIWAY Primitives B 1 Appendix C CIM Functional Command Codes Table C 1 CIM Functional Command Codes Meaning Command Response Read User Memory 60M AAANN 60DDD 2 V memory 4 C memory 8 A memory AAA Hex starting address NN Hex number of words 01 80 DDDD Hex memory contents Write User Memory GIMAAANNDDDD 61DDDD El A 2 V memory 61 HDLC 4 C memory 8 A memory AAA Hex starting address NN
138. ched device The pattem argument is always a word in the host format that is converted to 500 505 format before being sent to the attached device The valid range of values for pattern is O to 65535 The CIM Command Code specifier argument defines which of four operations is to take place in a CI M based attached device during uploading or downloading of data Specific values for ss are discussed in Chapter 10 The taglst argument allows an array of addresses to be specified at one time taglst is an array of addresses with each element of the array containing the address of a corresponding tag See Chapter 8 for information on building tag tables The arguments in question include aaaalst blklst nrecs nrecsl nrecs2 numblks recblks recnums reclst1 rec Ist2 and ttlst NOTE Many other arguments listed in Table 3 2 and Table 3 3 are not discussed in this section because they are not general in nature but are specific to a certain routine These arguments are discussed within the context of the routine description in Chapter 10 TIWAY Host Software for PC User Manual 3 8 Diagnostics The nblks argument number of blocks available and primlen argument primitive length are used only in the GETLEN subroutine a diagnostic subroutine that returns the maximum primitive length and the maximum number of data acquisition blocks supported by a specified NIM based attached device The numbers are returned as integers in the host format
139. chronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used primlen The Primitive length argument contains the maximum primitive length in bytes integer in host format nblks The number of blocks available argument contains the maxi mum number of data acquisition blocks supported by the specified NIM based attached device integer in host format The GETCON command performs the same Primitive and returns additional information for Series 500 505 Rel 2 1 and later NIMs TIWAY Host Software for PC User Manual Subroutine Library 10 27 10 19 GETMSG Call Format Notes on Call Format 10 28 Subroutine Library The GETMSG subroutine returns an error message to the caller in an 128 character string GETMSG is called with the composite status returned in theistat field obtained from a previous call to a TIWAY Subroutine BASIC and CALL TIWAY GETMSGC istat rsplen str128 FORTRAN CALL GETMSG istat rsplen str128 Pascal TIWAY GETMSC istat rsplen str128 GETMSG istat rsplen str128 C tiway getmsg amp istat amp rsplen str128 getmsg amp istat amp rsplen str128 Explanations of the terms used in the call format follow itat The composite status from a previous call is passed to the GETMSG subroutine Declaration integer rsplen GETMSG is called with the response length buffer containing the maximum length of the str128 argument On ret
140. cked array 1 275 of byte Pascal Notice that no buffer lengths are passed They are implied from the tt and nnnn fields The TI2HST subroutine is the reverse of the HST2TI subroutine TIWAY Host Software for PC User Manual Subroutine Library 10 47 10 37 TIGET TheTIGET subroutine is used to read consecutive memory locations from a specified NI M based attached device and to convert the data from the 500 505 format to a format compatible with the host TIGET is an implementation of Primitive 20 Call Format BASIC and CALL TIWAY TIGET istat xtn tag nnnn rsplen ri135 sstat FORTRAN CALL TIGET istat xtn tag nnnn rsplen ri135 sstat Pascal TIWAY TIGET istat xtn tag nnnn rsplen ri135 sstat TIGET istat xtn tag nnnn rsplen rsp135 sstat C tiway tiget amp istat amp xtn amp tag amp nnnn amp rsplen amp ri135 amp sstat tiget amp istat amp xtn amp tag amp nnnn amp rsplen amp ri135 amp sstat Notes on Call Explanations of the terms used in the call format follow Format itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Thetag argument specifies the address list that is to be returned to the caller This argument may take any of the available forms The tag is converted to an address lis
141. command consisting of the following fields Host Adapter Command Code Secondary address and network data if applicable The command is formatted for the Host Adapter to read For more information refer to theUnilink Host Adapter User Manual PPX TIWAY 8121 x rsplen The rsplen argument specifies the maximum length of the response buffer and the actual length on return in bytes rsp275 The response buffer contains the actual response from the H ost Adapter on return If any directive status errors facility 7 or some of the I O status errors facility 6 were detected rsp275 does not contain a response One cause may be that the command buffer was not sent to the Host Adapter entyp The entyp argument is specified by the caller to indicate the amount and type of error reporting to be performed on the istat variable The valid options follow 00 Argument errors and I O errors are reported 01 Host Adapter errors are reported 02 Host Adapter and TIWAY Primitive errors are reported 04 Host Adapter and CIM Functional Command errors are reported TIWAY Host Software for PC User Manual Subroutine Library 10 61 Appendix A Host Adapter Command Codes Table A 1 HostAdapter Command Codes Command Code z a z 5 a E 0 z E i n 2 13 Allocate macro storage buffers i 15 Gather macro responses 16 Enable disable macro execution 17 Initialize macro response buffer 18 Report memory usage 19 Allo
142. d device This command has two sets of state options depending on whether the attached device is NIM or CIM based Prompt TIUSER gt CHAN Tag specifier 0102 H ex operating state values 00 execute loops and logic 01 to execute loops but not logic 02 to not execute either Current state 02 Are you sure you want to change state Y Desired state 00 Response Return state 00 TIUSER gt The utility prompts you for a Secondary address Depending on whether the attached device is CIM or NIM based you are presented with one of two lists of options The option list for a NIM based attached device is shown in the example above If the attached device is CI M based the option list is Enter 1 remote mode 2 non remote mode 3 program mode 4 non program mode Type in a number representing the desired option and the Secondary state is changed to that option A WARNING A configuration switch ICHANGESTATE is provided to disallow default or allow remote change state operations In many applications to remotely start and stop machines or processes could cause unpredictable operation that could result in death or serious injury and or damage to equipment Remote change state operations should only be allowed at sites where no hazard would result The CHANGESTATE option is only checked prior to this subroutine TIPROG or user written applications are not disallowed 7 6 Interactive Operator Utilities TIWAY Hos
143. d CALL TIWAY TIWRIT istat xtn tag nnnn wb275 sstat FORTRAN CALL TIWRIT istat xtn tag nnnn wb275 sstat Pascal TIWAY TIWRIT istat xtn tag nnnn wb275 sstat TIWRIT istat xtn tag nnnn wb275 sstat C tiway tiwrit amp istat amp xtn amp tag amp nnnn amp wb275 amp sstat tiwrit amp istat amp xtn amp tag amp nnnn amp wb275 amp sstat Notes on Call Explanations of the terms used in the call format follow Format istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Thetag argument specifies the address list that is to be returned to the caller This argument may take any of the available forms The tag is converted to an address list either by searching the tag table by converting the specification directly or by a combination of the two See Declaration for tag typein Figure 3 1 nnnn The nnnn argument defines the number of data element locations to write to wb275 The write buffer contains the data to be written The data should be in the 500 505 format stat The Secondary status argument contains the code for the current state of a specific NI M based attached device Current state means the state the device is in when the response to the subroutine call is returned Current state is returned for all
144. d CCU is not executing ladder logic Protected and CCU is not executing ladder logic Write Timer Current Value 29NNCCCC 29CCCCF Number of timer 1 F Current value Not protected and CCU is executing ladder logic Protected and CCU is executing ladder logic Not protected and CCU is not executing ladder logic Protected and CCU is not executing ladder logic Read Status of Counter NN 2APPPPCCCCF Number of timer 1 F Preset value Current value Not protected and CCU is executing ladder logic Protected and CCU is executing ladder logic Not protected and CCU is not executing ladder logic Protected and CCU is not executing ladder logic TIWAY Host Software for PC User Manual PM550 CCU Task Codes D 7 Table D 1 CCU Task Codes for PM550 continued T Write Counter Preset Value 2BNNPPPP 2BPPPPF Number of counter 1 F Preset value Not protected and CCU is executing ladder logic Protected and CCU is executing ladder logic Not protected and CCU is not executing ladder logic Protected and CCU is not executing ladder logic Write Counter Current Value 2CNNCCCC 2CCCCCF Number of counter 1 F Current value Not protected and CCU is executing ladder logic Protected and CCU is executing ladder logic Not protected and CCU is not executing ladder logic Protected and CCU is not executing ladder logic D 8 PM550 CCU Task Codes TIWAY Host Software for PC User Manual Table D 1 CCU Task Codes for PM5
145. d Re Mok Ra ce aoe ob a Rie dic deta dp A Pascal De clarations 52 235 2 2 heo en cC Dee XP DO Xd dic dace C D clarations eroe ce RO mcn CPC ERE awa EE P ORE E a ce aedes 5IL Upload File Foma t serii eis eter e be Bor ore ra Pa Re x edel A A 51 Upload File Example 5 ior RR RRERERRER TER ER ERR hed eee ick 520 530 Upload File Fomati ii rssi penini inr ienr RERERREE EE a GR RE de 530 Upload File Example spiese Im 520C 530C Upload File Format ssssssss I 520C Upload File Example ssssssss e 560 565 Non extended Upload File Format 0 ccc cece cent e 565 Non extended Upload File Example 0 cece eect e 560 565 Extended Upload File Format ccc cece cette eee eee een en nes 565 Extended Upload File Example ss see 560 565 Generic Upload File Format 0 cece cee n 560 565 Generic Upload File Example 0 cece eects PM550 and IT 160 MRCU Upload File Format 0c cece cece eee n PM550 Upload File Example nere ner ape ends otras eee eee Re Pe Unilink Generic Upload File Format 06 ccna Unilink Generic Upload File Example ssssee ne Unilink Specific Segment Upload File Format ccc ccc cece eee n I Unilink Specific Segment Upload File Example sausas TIUSER Help Menu Screen cerrar teni une cir na Y RR Y era A eh Rs TIPROG Help MENU i secet eens cec ee OR e Rar agen eene reda REM RUE ends Sample Tag Table ossi
146. d interface between a personal computer as a host computer and the TI WAY Communications Network through the SIMATIC Unilink Host Adapter This manual describes the TI WAY Host Software conventions It is a programmer s reference guide before using the TIWAY Host Software Package you should be familiar with the host computer and its operating system the Unilink Host Adapter and the TIWAY Communications Network Host specific information is not included in this manual The manual describes the installation and use of the software and includes programming notes for compiling and linking with the TI WAY library as well as information on PLC and Host Computer Data F ormats You need to be familiar with MS DOS commands and operations before you install the software If you are not familiar with DOS or if you do not understand how to connect devices via a serial communications com port to your personal computer you may want to contact your PC consultant for installation assistance Introduction to the The purpose of this manual is to provide the applications programmer with User Manual the information necessary to create programs that communicate with the TIWAY network The TI WAY Host Software Package consists of the following components e TIWAY Subroutine Calling Arguments See Chapter 3 Because many of the calling arguments are common to most of the TIWAY subroutines the calling arguments are discussed in a separate ch
147. ddress returned address dddd returned address status value address 1 1024 aaaa address 1025 8192 word force status value Figure 6 3 520 530 Upload File Format TIWAY Host Software for PC User Manual File Transfer Subroutines 611 Transfer File Descriptions continued TAG NAME 0753 HWY STA 07 53 IME 18 JUN 1995 09 29 27 97 MODEL 30 CONFIG lFFF 0800 0000 O3FF 0001 E5B4 8401 B9A0 89A9 EDB3 0009 BDAO 8A01 9802 8401 B5AO0 1FF1 8000 8000 8000 8000 8000 1FF9 8000 8000 8000 8000 8000 0001 AAAA BBBB CCCC DDDD 0010 0009 2CEC 4C2D 309F 3D38 3A12 07F1 0000 0000 0000 0000 0000 07F9 0000 0000 0000 0000 0000 ST 0000 96 Figure 6 4 530 Upload File Example 6 12 File Transfer Subroutines TIWAY Host Software for PC User Manual TAG NAME hhaa HWY STA hh aa IME dd mmm yyyy hh mm ss ss MODEL 2C 3C CONFIG 1111 vvvv 0000 iiii tctr drmm sreg tmov ones where tctr number of timer counters drmm number of drum edrums sreg number of shift registers tmov number of table moves ones number of one shot instructions L 0001 MEMORY pups Configuration L 1111 0001 0009 V vvvv nnnn nnnn nnnn nnnn nn nnnn nnnn nnnn WXY 0001 nnnn nnnn nnnn nnnn n nnnn nnnn WXY iiii nnnn nnnn nnnn nnnn n nnnn nnnn channel always 0 base 1 for 520 520C 0 F for 530 530C a slot 0 F Vo IOC Ocbs jj
148. dentifies which of three possible data types display only tuning only or display and tuning is to be returned These extensions to the tag are described in Chapter 10 with the subroutine arguments for CIMDNL CIMUPL and RDLOOP After an address has been determined it can be specified in one of three ways as an alphanumeric name stored in a tag table as an ASCII string or as a binary number These specification methods are discussed in the following sections 3 18 TIWAY Subroutine Calling Arguments TIWAY Host Software for PC User Manual Tag Name Specification ASCII Specification The TIWAY Host Software Package supports a tag table which consists of a set of alohanumeric tag names and the physical address that corresponds to each tag name Any address that does not begin with a or ASCII identifiers or a null binary identifier is assumed to be a tag name Tag names and the tag tables are discussed in further detail in Chapter 8 A tag name isa string of ASCII characters but it cannot begin with a or t must either be as long as the tag name length specified at installation or beterminated in an ASCII null character Keep in mind that the time difference between looking up tag names and converting them from one of the direct specification forms is very short compared to the length of a single network transaction Therefore as a general practice use the form that is most logical for an application i
149. dress list that is to be returned to the caller This argument may take any of the available forms The tag is converted to an address list either by searching the tag table by converting the specification directly or by a combination of the two See Declaration for tag typein Figure 3 1 addlst The addlst argument contains a binary specification This can be used to convert a tag name or other non direct specification to a binary format The addlst argument also contains the lead in null character to identify it as a binary specification TIWAY Host Software for PC User Manual Subroutine Library 10 33 10 25 NATIVE Call Format Notes on Call Format 10 34 Subroutine Library The NATIVE subroutine allows you to bypass the normal Primitive processing and execute a native Task Code directly Primitives are high level commands that are not specific to any PLC model Instead NIMs use the Task Code commands that are native to the attached PLC to perform the function requested by the primitive TheNATIVE subroutine accepts a Task Code command buffer appends it to the Host Adapter Command Code and TI WAY Primitive length and Primitive 01 and passes it to the Secondary The response without H ost Adapter and TIWAY Primitive overhead is returned in the response buffer This is similar tothe XPAR subroutine except that instead of the NITP protocol being added to the command and stripped from the response the NITP protocol Host Adapter
150. e The BLDMSK subroutine can be used to build a mask TIWAY Host Software for PC User Manual Subroutine Library 10 41 10 32 RNDRD3 Call Format Notes on Call Format The RNDRD3 subroutine gathers data from a block of data acquisition blocks specified by a mask and defines new data acquisition blocks NOTE Unlikethe NIM DEFBLK subroutine any new definition starts with the first block and all blocks defined after the first are numbered sequentially from that number BASIC and CALL TIWAY RNDRD3 istat xtn tag cmask rsplen rsp275 nblk taglst nnlst FORTRAN CALL RNDRD3 istat xtn tag cmask rsplen rsp275 nblk taglst nnlst Pascal TIWAY RNDRD3 istat xtn tag cmask rsplen rsp275 nblk taglst nnlst RNDRDS istat xtn tag cmask rsplen rsp275 nblk taglst nnlst C tiway rndrd3 amp istat amp xtn amp tag amp cmask amp rsplen amp rsp275 amp nblk amp taglst amp nnlst rndrd3 amp istat amp xtn amp tag amp cmask amp rsplen amp rsp275 amp nblk amp taglst amp nnlst Explanations of the terms used in the call format follow istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used cmask A mask 16 bit spaces long specify
151. e rsplen rsp275 The length argument has two distinct uses On entry to TIWAY the length specifies the maximum buffer length to avoid buffer overflow the TIWAY Subroutine does not return more than that amount of data On return the TI WAY Subroutine returns the length actually used NOTE Do not use a constant for the length of a buffer in which the TI WAY Subroutines returns data The TIWAY Subroutine Library has two command buffer arguments cmdlen and cmd275 C mdlen specifies in integer format the number of bytes to be contained in cmd275 Cmd275 contains in an array of bytes the command built by the user The response buffer arguments are rsplen and rsp275 Rsplen specifies in integer format the number of bytes to be contained in rsp275 Rsp 275 contains in an array of bytes the response returned tothe call All response buffers are byte oriented TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 21 Buffer Specification continued Read Buffers Write Buffers The read buffers rilen ri4 ri32 11135 and ri254 are those that you read returned by the call to the TIWAY subroutine Rilen specifies in integer format the number of integers to be contained in ri4 ri32 11135 or ri254 The other buffers contain in an array of integers the data returned by the call tothe subroutine The write buffers wilen wblen wi4 wi135 and wb275 are read by the computer written by you
152. e C without messages Link CL 4Y OURPROG TI WAYC TIWAY C L CL Lattice C with messages Link ALIGN MSG TI MSGC CL YOURPROG TIWAYC TIWAY C L CL Lattice C provides four different memory models to the programmer s p d These memory models affect the addressing capabilities and efficiency of the compiled program To use TI WAY subroutine libraries with a program written in Lattice C the programmer must compile that program using the L memory model If MAKELC BAT has been used to install the Lattice C compiler the batch fileLCL BAT will compile your programs using the L memory model If your compiler has not been installed using MAKELC BAT refer to the Lattice C Compiler Reference M anual provided with your Lattice C compiler for information on how to compile your programs using the L memory model TIWAY Host Software for PC User Manual Installation 1 21 1 7 Exec uting in Interpreted BASIC Getting Started 1 22 Insta lla tion As previously noted a program in BASIC may be executed in the interpretive mode This means that each line of the program is read converted to machine code and executed before the next program line is read This allows you to write and debug your program in an interactive environment The disadvantage of executing a program in the interpretive mode is that it runs much more slowly than the compiled version of the same program NOTE Seethe MS BASIC SoftwareLibrary Manual for additional informati
153. e Network AutoconfigureFileis a text editable file that contains all information necessary to configure a Unilink Host Adapter UHA as a Host Interface Unit HIU a Network Manager NM or a Master Host Interface Unit MHIU Thisinformation is contained within file records There are two types of records within the file e A template record which contains information which aids in configuring a UHA e A data record which contains the actual configuration data The Network Autoconfigure File is found in the NETAUTOC DAT file Several template records are used together to describe the UHA configuration data field that is edited within a data record The template record describes the field to be edited defines the valid range for the field entry and delineates the field within the record Each template record must start with an exclamation point in column 1 Figure 9 1 shows the format of this record field field field description description description range range range EN VV VV VVV Figure 9 1 Network Autoconfiguration File Template Record Format The data record contains an identifier field and data fields The identifier field columns 1 6 is used to select the specific configuration activity The data fields are used to contain the configuration specific data The position of the data fields vary from record to record The user is aided in placing field data in the correct columns by a template The generic d
154. e RNDRD4 subroutine performs two functions in the same call and same host adapter transaction It writes to a set of sequential memory locations see the CI MWR subroutine for more detail and also gathers data from one or more data acquisition blocks specified by a mask BASIC and CALL TIWAY RNDRD4 istat xtn tag nnnn wb275 cmask rsplen rsp275 FORTRAN CALL RNDRDA istat xtn tag nnnn wb275 cmask rsplen rsp275 Pascal TIWAY RNDRD4 istat xtn tag nnnn wb275 cmask rsplen rsp275 RNDRDA istat xtn tag nnnn wb275 cmask rsplen rsp275 C tiway rndra4 amp istat amp xtn amp tag amp nnnn amp wb275 amp cmask amp rsplen rsp275 rndrd4 amp istat amp xtn amp tag amp nnnn amp wb275 amp cmask amp rsplen amp rsp275 Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used nnnn Theread write nnnn argument is the number of data elements to convert Declaration integer wb275 The write buffer contains the data to be written The data should bein the 500 505 format cmask A mask 16 bit spaces long specifying which of 16 blocks may be accessed The MSB specifies block 16 while the
155. e buffer length integer int read write Buffer Specification Response buffers rsp275 response buffer integer array bary275 read write rsplen response buffer length integer int read write Buffer Specification Write buffers integer char write buffer length write buffer integer array write buffer integer array write buffer write buffer length integer array integer lTheC declarations are determined according to Figure 3 3 3 10 TWAY Subroutine Calling Arguments TIWAY Host Software for PC User Manual Table 3 3 Argument Reference List for BASIC and C C continued Declaration Declaration Definition BASIC C C Data Manipulation cc UCL instruction option integer int read only code define list array of block numbers to integer array iary32 read write mask from nnlst array of data elements per integer array bary16 read write block int nnnn number of data elements integer read write nnnnlst array of data elements per integer iary32 read only block pattern Dm to fiilmemory integer array int read write SS CIM function option code integer int read only str128 error message byte array string128 read only taglst array of addresses integer tag array read only length of data type in 500 505 format integer int read write Diagnostics maximum number of data in t Network Access lTheC declarations are determined according to Figure 3 3 TIWAY H
156. ecord exi ee dac eda ed ados odas ec RR Vara Re ORC Data RECOM vicio a eie o c Rae dev a aod Roe dk Oana COMMONS hed IP m Record EQ RING eiue eese exce e eine deceat eek hfc el wer TR eal i e cba a d Network Autoconfiguration Process ccc cece cece eee eee eee eee nnne TIWAY Host Software for PC User Manual Network Autoc onfig uration File 9 1 9 1 9 2 Introduction The Network Autoconfigure File is a convention that permits you to start up the network without operator intervention Each Unilink Host Adapter on the network s can be identified and configured as follows e Ifthe UHA is selected as a Host Interface Unit HIU make required definitions and select its bandwidth e fthe UHA is selected as a Network Manager NM make required definitions For HIUs on the network allocate NM buffers and select its preferred channel e ftheUHA is selected as a Master Host Interface Unit MHIU make required definitions allocate NM buffers and select its bandwidth and preferred channel Network autoconfiguration is achieved by Editing a text file that defines the network configuration Executing a program that reads this file and performs the necessary network definitions The following paragraphs discuss this feature in greater detail Network Autoconfiguration File TIWAY Host Software for PC User Manual 9 2 Network Autoconfigure File Template Record Data Record Th
157. ect Secondaries from highway List connected Secondaries List Secondary diagnostics Upload Secondary memory to file Download file to Secondary memory Verify Secondary memory against file Show saved Secondary memory file status Change State of Secondary Leave Utility Figure 7 1 TIUSER Help Menu Screen TIWAY Host Software for PC User Manual ACTIVATE The ACTIVATE command is used to connect a Secondary or Secondaries to Command the TI WAY network The utility attempts to connect the specified Secondary to the highway and prompts for another Secondary to connect This is repeated until all desired Secondaries are connected To terminate the command enter RETURN and the TIUSER gt prompt is returned The address specification requires only the highway and Secondary address e 9 40102 would specify the first highway and Secondary number 02 Any further address specification is ignored The LIST command can be used to verify that the Secondary has been connected Prompt TIUSER gt ACTI Secondary activation Input tag for Secondaries to activate one per line lt RETURN gt toterminate Tag specifier Response Tag specifier 0102 to activate a highway 1 Secondary 2 Tag specifier RETURN gt to terminate the command TIUSER gt TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 5 TIUSER Utlity continued CHANGESATE Command The CHANGESTATE command is used to change the state of an attache
158. ed NIM based attached device TIPUT is an implementation of Primitive 30 4 14 TIWAY Interface Subroutines Topical TIWAY Host Software for PC User Manual TIWAY Primitive Subroutines continued TREAD TWRIT WRIGAT The TIREAD subroutine reads consecutive memory locations from a specified NIM based attached device Data is returned in the NATIVE 500 505 format as an array of bytes TIREAD is an implementation of Primitive 20 The TIWRIT subroutine writes to consecutive memory locations in a specified NIM based attached device The data is passed in the NATIVE 500 505 format as an array of bytes TIWRIT is an implementation of Primitive 30 The WRBUF subroutine is used to write to consecutive memory locations in NIM based attached devices that support buffered program memory It stores data temporarily in the NIM and downloads it from the NIM tothe Unilink upon request WRBUF is theimplementation of 5TI Primitive 33 NOTE The5Tl makes use of this facility for program downloads See the 5TI NIM User Manual for a detailed description of this facility A WARNING Before transferring a new program by calling WRBUF clear L memory completely If this is not done parts of residue programs may be executed This could cause unexpected controller behavior that could result in death or serious injury and or equipment damage Use FILL with pattern 0000 to entirely clear L memory The WRTGAT subroutine combines the func
159. ed in your programs to make the necessary declarations for any TI WAY subroutine calls automatically You may find it more expedient however to make these declarations yourself if you wish to use only a few of the routines in the TIWAY Subroutine Library In BASIC array element O is generally not used by the programmer but for TIWAY subroutines this element is used as the first element of the array All TIWAY subroutines must be called in BASIC with the BY REF qualifier External subroutine declarations for TI WAY subroutines must also use this qualifier Programmer s Notes for PC TIWAY Host Software for PC User Manual FA The SAMPLE C SAMPLE2 C and SAMPC TYP files contain both the variable declarations and the type definitions required to call all subroutines in the TI WAY Subroutine Library These files can be included in your programs to automatically make the necessary dedarations for any TI WAY subroutine calls If you wish to use only a few of the routines in the TIWAY Subroutine Library you may find it more expedient to make these dedarations yourself C automatically passes arrays by reference but integer values and typedefs of unions or structures are not automatically passed by reference A structure union or integer must have a preceding ampersand when calling a routine from the TI WAY Subroutine Library For example a call to the TIWAY subroutine POLL is made as follows POLL amp ISTAT amp XTN TAG amp RSPL
160. eee 2 number of connect Secondary commands processed ffff 2 number of disconnect Secondary commands processed gggg number of read Secondary log commands processed hhhh 2 number of read Secondary diagnostic commands processed iiii number of read adapter diagnostic commands processed jjjj 2 number of reset adapter commands processed kkkk total number of poll cycles 1111 total number of frames transmitted to Secondaries mmmm total number of timeouts nnnn total number of frames received from Secondaries 0000 total number of frames re transmitted null for UHA pppp total number of receive errors qqqq total number of transmit errors null for UHA rrrr total number of Secondary initializations ssssssss current system clock value in 256 microsecond intervals Rel 1 0 TIWAY Host Adapters return a reserved field set to zero in elements ssssssss The system clock for these models is returned in the two elements immediately following the ssssssss field TIWAY Host Software for PC User Manual 10 3 BLDMSK Call Format Notes on Call Format Example The BLDMSK subroutine builds a mask from a list of block numbers BASIC and CALL TIWAY BLDMSK mask list FORTRAN CALL BLDMSK mask list Pascal TIWAY BLDMSK mask list BLDMSK mask list C tiway bldmsk mask list bldmsk amp mask list Explanations of the terms used in the call format follow mas
161. egin Generic Download Downloading Program Memory Downloading Data Memory Generic Download completed TIUSER gt TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 9 TIUSER Utlity continued 7 10 gt gt gt f answer to generic download request no Select transfer code 90 download all except 94 download S memory loop tables WXY IR and WF 95 download S memory analog alarms 91 download L memory 96 download S memory SF programs 92 download V memory 97 download S memory SF subroutines 93 download constant memory 98 download IR WF memory 99 download WXY memory Enter transfer code 90 Response Downloading program Downloading memory type Download completed TIUSER gt gt gt gt f you attempt to download from a device type unrecognized by the package to the same device or another of the same type the following series of prompts messages appears Note that only a generic download is attempted Prompt TIUSER gt DOWN File specification C TIWY6911 MYFILE EXT File created on 10 UN 95 17 34 19 Uploaded from highway 1 station 12 Model Isthis the desired file Y gt gt gt lf answer yes Prompt Tag specifier 0109 gt gt gt 1f the transfer is between like devices Response WARNING UNKNOWN DEVICE TYPE xxx Select Generic Download configuration 1 Download all memory 2 Download Program Memory only
162. em occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Thelong form of the tag must be used cc ThePrimitive option code specifies which of four memory storage actions should take place Possible Primitive option code values are 00 Set storage RAM to null and start temporary storage of data 01 Continue temporary storage at address specified in tag 02 Replace attached device memory with storage memory 03 Abort temporary storage Primitive option code arguments may or may not be accompanied by data Thennnn argument is used to determine whether the buffer is appended If nnnn is 0 no data accompanies the cc argument The specified amount of data accompanies the cc argument if nnnn is anything other than zero 10 56 Subroutine Library TIWAY Host Software for PC User Manual nnnn The nnnn argument contains the number of data element locations being transferred by the call wb275 The write buffer argument refers to the data element locations being transferred in the current call pstat Primitive Status O data transfer in progress 1 data transfer has been aborted stat The Secondary status argument contains the code for the current state of a specific NI M based attached device Current state means the state the device is in when the response to the subroutine call is returned Current state is returned for all attached devices except Serie
163. en eines teeta cae erie ee eee Roos al ai Network Autoconfiguration File Template Record Format 0 0c cece eee Network Autoconfiguration File Data Record Format cece cece eee aee HWY Record Format 0 ccc en CNFGHA Record Format sssssssesseee haa CFGHIU and ALCHBW Record Formats ccc eect cnet nnn ALCNMB and CNFGNM Record Formats 0 ccc cece ccc nn END Record Formation a ra da Rs DAR done EOF Record FOME oi tis eed te bead Eh awd ee Bead bis dee ee andes Contents xi List of Tables 1 1 1 2 3 1 3 2 3 3 3 4 3 5 3 6 3 7 4 1 4 2 4 3 5 1 62 6 3 6 4 6 5 7 1 72 7 3 A 1 B 1 C 1 E 5 E 6 E 7 xii PC Software Package Filles cius deese pee RE e Ra t RE Rd RR Fa RU ew 1 4 ODIECURICS icc rr 1 18 Subroutinesand Arguments Reference List 0 eects 3 3 Argument Reference List for Fortran and Pascal cc ccc eee e eee e eee oo 3 6 Argument Reference List for BASIC and C C cece nnn 3 10 Data Element YPES iret sina ccna 3 14 Accessing the Network with Xtn 0 0 ccc cece ener m 3 27 Facility Emor Nurbets arsaa nenir oea tiia ei Pela Paes een 3 29 Seven Possible Subroutine Values 00 eect tte tee 3 30 Host Ada pter Command Code Subroutines cece eee eee 4 7 TIWAY Primitive Subroutines lsssssesssss mm 4 11 CIM Functional Command Code Subroutines ccc ees 4 15 Reference List of Support Subroutines
164. er BASIC and CALL TIWAY RNDRD2 istat xtn tag cmask rsplen rsp275 FORTRAN CALL RNDRD2 istat xtn tag cmask rsplen rsp275 Pascal TIWAY RNDRD 2 istat xtn tag cmask rsplen rsp275 RNDRD2 istat xtn tag cmask rsplen rsp275 C tiway rndrd2 amp istat amp xtn amp tag amp cmask amp rsplen amp rsp275 rndrd2 amp istat amp xtn amp tag amp cmask amp rsplen amp rsp275 Explanations of the terms used in the call format follow istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used cmask A mask 16 bit spaces long specifying which of 16 blocks may be accessed The MSB specifies block 16 while the LSB specifies bit 1 For example cmask 810A hex 1000000100000101 binary would select blocks 1 3 9 and 16 rsplen The response buffer length argument defines the maximum length of the response buffer when it is returned it contains the actual length in bytes of the response See discussion of this argument for TI GET for an explanation on how it is computed rsp275 The rsp275 argument contains the returned data in the 500 505 format The blocks gathered with the RNDRD2 subroutine can be defined using the RNDRD1 or RNDRD3 subroutin
165. er received E 8 Eror Listings TIWAY Host Software for PC User Manual E5 Facility 5 TIWAY Primitive Exceptions These errors Shown in Table E 5 are detected by NIM based attached devices while processing a TIWAY Primitive Table E 5 Facility 5 PRIMITIVE TWAY Primitive Errors Message Number Description Hex 00 Primitiveisnotimplemented 01 Data type tt is not defined on device Data element location nnnn is out of range 5 Primitive has insufficient data unit bytes 05 Number of bytes received does not match length 06 Device in wrong mode for Primitive execution 07 User program has communications disabled 08 Written data type location nnnn did not verify 09 Data type location nnnn is write protected y E x x i 11 Data acquisition block number exceeds the maximum allowed The block number requested has not been defined The number of data bytes in requested block too large Report by condition data type location too big 12 13 L E e Data type not allowed in specified device Error in attached device communications 18 Data type not implemented in NIM but is in device 19 Data element location out of range TIWAY Host Software for PC User Manual Eror Listings E 9 Facility 5 TIWAY Primitive Exceptions continued Table E 5 Facility 5 PRIMITIVE TWAY Primitive Errors continued Description Attached device communications is not establi
166. es for PC F1 F 1 F2 General Infomation Before calling any TI WAY subroutines which use the istat variable it is recommended that the istat variable be set to 1 This is an out of range value for the error status After calling each TIWAY subroutine the istat variable indicates the success or failure of the function If istat is still equal to 1 the subroutine was abnormally aborted and did not complete The following information has been provided to aid you in learning how to invoke the TIWAY Subroutine Library from an application s program The TIWAY Subroutine Library has been written in assembly language to provide speed efficiency and a simple interface to the five supported languages n most cases calling a TIWAY subroutine is no more difficult than calling a subroutine written in the same language If you do encounter difficulties in interfacing your programs with the TIWAY Subroutine Library after reading the following notes refer to the programmer s reference and the user guide for your application s language The Programmer s Notes for PC have been divided into eight sections General Information Pascal BASIC C Fortran Linking Programs with the TIWAY Subroutine Library and Using U pload and Download from an Applications Program Example programs for some of the languages have been provided in FULLSAMP C a full C example that calls all library functions Sample C and Sample2 C a small C example Sample
167. etrieve data Download and retrieve data Write VCA and retrieve data Write IR and retrieve data CC hex block count 1 10 M 2 V memory 4 C memory 8 A memory AAA hex starting address NN hex number words to read 1 80 DDDD data read or written 16 bit block selection mask CR Y hex number of bits to write 001 100 for Y 001 200 for CR hex value of 41R bits C 4 CIM Functional Command Codes 6AD1 D79 old 6ADO0D1 D79 new 6ALT old 6ADOD1 D79 6DOOCCM AAANN 6D00 6DO1EEEE 6DO1EEEEDDDD 6DO2EEEECCM 6DO2EEEECCCC AAANN 6DO3EEEEMAAANN DDDD 6DO4EEEECAAA QQQB 6DO3EEEEDDDD 6DOA4EEEEDDDD TIWAY Host Software for PC User Manual Appendix D PM550 CCU Task Codes This appendix provides a limited definition of the PM 550 CCU Task Codes Pleaserefer tothe SIMATIC PM550 NIM User Manual for more details Table D 1 CCU Task Codes for PM550 aum 01 Return CCU Status O1ABRRX 2 Start Up 3 Hold 5 Run 0 Not Program Mode 1 Program Mode Current CCU revision must be 07 or greater for 8 loop CCUs 0 CCU not in Remote 1 CCU in Remote Read Error NN 02DD NN Error number from system error DD Number of occurrences of error NN CCU RAM ROM Status and Memory 04 or OOER 1 LinRAM 2 LinROM 4 CinRAM 8 CinROM B Copy L ROM toRAM C Copy C ROM to RAM N is not cumulative TIWAY Host Software for PC User Manual PM550 CCU Task Codes D
168. fic tag table To perform this initialization call the INIT subroutine The complement of INIT is the FIN finish subroutine which can be used to release the system resources reserved during the INIT call If a program exits or aborts you do not need to call FIN INIT reserves system resources and initializes the port used by the software package FIN is the complement of the INIT subroutine It releases system resources reserved during the INIT call After FIN has been called none of the other subroutines can be called until an INIT is called TIWAY Interface Subroutines Topical TIWAY Host Software for PC User Manual 4 3 Computer Port Setup Initialization INIT Subroutine Initialization Call Format Notes on Call Format You must always invoke the INIT subroutine first in your application program in order to use the host TI WAY adapter library INIT has different arguments depending on the specific host package involved F or the PC TIWAY package the INIT routine is defined as follows BASIC CALL TIWAY INIT istat xtn portstr FORTRAN CALL INIT istat xtn portstr Pascal TIWAY INIT istat xtn portstr INIT istat xtn portstr C tiway init amp istat amp xtn amp portstr init amp istat amp xtn amp portstr Explanations of the terms used in the call format follow itat The status argument must be specified but it may be specified as a null argument in FORTRAN xn The
169. filename Declaration integer fnam File specification filename for uploaded data Declaration string or character array pnlen Length of Unilink program name for specific segment transfer Declaration integer pname Unilink program name for specific segment transfer Declaration string or character string TIWAY Host Software for PC User Manual Subroutine Library 10 55 10 433 WRBUF Call Format Notes on Call Format The WRBUF subroutine is used to write to consecutive memory locations in NIM based attached devices that support buffered program memory It stores data temporarily in the NIM and downloads it from the NIM tothe PLC upon request WRBUF is theimplementation of 5TI Primitive 33 The 5TI uses this subroutine for program downloads Refer tothe SIMATIC 5TI NIM User Manual BASIC and CALL TIWAY WRBUF istat xtn tag cc nnnn wb275 pstat sstat FORTRAN CALL WRBUF istat xtn tag cc nnnn wb275 pstat sstat Pascal TIWAY WRBUP istat xtn tag cc nn wb275 pstat sstat WRBUF istat xtn tag cc nnnn wb275 pstat sstat C tiway wrbuf amp istat amp xtn amp tag amp cc amp nnnn amp wb275 amp pstat amp sstat wrbuf amp istat amp xtn amp tag amp cc amp nnnn amp wb275 amp pstat amp sstat Explanations of the terms used in the call format follow istat Status which indicates successful completion of function or error message indicating what probl
170. gram MSG Contains text for error messages used in the TI WAY Host Software Package This file contains the settings which are used by NETAUTOC EXE to automatically configure the host adapter NETAUTOC DAT This file contains a network management utility program which is used to configure the host adapter automatically Uses NETAUTOC DAT This file contains instructions relating directly to installing the TI WAY Host NETAUTOC EXE README Software for PC calling up programs relating to software installation as well as instructions for compiling TI WAY application programs SAMP C TYP This is the C Indude file which contains data types used in this package This is an Indude filefor Pascal programs It declares the TIWAY subroutines SAMP PAS to be external and gives all the procedure declarations For the Pascal user SAMP PAS PAS contains forward dedarations to be used in programming This is another Pascal Indude file which contains the data types which are used in the SAMP PAS PAS declarations SAMP PAS TYP T For the Pascal user SAMP_PAS TYP contains type dedarations to be used in programming This file contains a sample BASIC program to be used as an example when SAMPLE programming in that language 1 4 Insta lla tion TIWAY Host Software for PC User Manual Table 1 1 PC Software Package Files continued File SAMPLE C This file contains a sample C program to be used as an example when programming in
171. guments are discussed in a separate chapter Tables are included that can be used as a quick reference to the arguments used by each subroutine their calling conventions and the data element types See Chapter 3 The TIWAY Subroutine Library encompasses all of the commonly used Host Adapter Command Codes TI WAY Primitives and CIM Functional Commands See Chapter 4 The TIWAY Support Subroutine Library provides a wide range of host computer services induding logical to physical address conversion and data format conversion See Chapter 5 TheFile Transfer Routines provide a way to upload and download programs and data to and from the Secondaries through a user written application program written in any of the supported languages See Chapter 6 Two Interactive Operator Utilities provide generalized access to the facilities available through the TI WAY libraries The purpose of the TIUSER utility is to provide a shortcut to selected network management functions e 9 connecting or disconnecting Secondaries The primary purpose of the TIPROG utility is to provide an interactive programmer interface to the TIWAY Subroutine Library As such TIPROG serves as a useful tool for learning about TIWAY subroutines The utility also allows the programmer to test TI WAY applications before coding them and is useful for short requests for information or supervisory control See Chapter 7 A symbolic means of referencing address specifications called t
172. haa If you are downloading to a NI M based attached device you can edit the file and download only the portions of it that you want 7 8 Interactive Operator Utilities TIWAY Host Software for PC User Manual Prompt TIUSER2 DOWN File specification CA TIWY 6911 MYFILE EXT File created on 10 UN 95 17 34 19 U ploaded from highway 1 station 12 Model 550 Isthis the desired file Y gt gt gt lf answer yes Prompt Tag specifier 40109 Highway or station mismatch proceed Y gt gt gt lf answer yes fand the transfer is permitted by the package Prompt Select specific segment download y n displayed for Unilink only gt gt gt lf answer yes Prompt Select segment mask hex HHHH Response Begin specific segment download Downloading segment 1 mask value HHHH Downloading segment n mask value HHHH Specific segment download completed TIUSER gt Response Nosegments specified for specific transfer no bits set in mask TIUSER gt Response WARNING Not all specific segments transferred error in downloading requested segment TIUSER gt gt gt gt 1f answer to specific segment download request no Prompt Select Generic Download y n gt gt gt lf answer yes Prompt Select Generic Download configuration 1 Download all memory 2 Download Program M emory only 3 Download Data Memory only Enter selection 1 3 3 Response B
173. he TIPC if Interpreted BASIC is used it is necessary to copy the file BASIC EXE into the same directory as the program TI BASIC EXE BASIC EXE is found on the disk supplied with the BASIC manual In the case of IBM compatible PCs not TI PCs it is necessary to copy either BASIC COM or BASICA COM intothe same directory as TIBASIC EXE and rename BASIC COM or BASICA COM to BASIC EXE For example copy BASICA COM from floppy to hard disk as follows COPY A BASICA COM CA TIWAY BASIC EXE Compiled Languages For compiled languages the necessary compiler files can be copied to the same directory as the TI WAY files or the DOS PATH command can be used to cause the system to search the appropriate directories Loading the Device Driver The steps listed below will install and load the TIWAY Host Software device driver into the correct directory 1 Transfer control of your system to your root directory This can be done by using the Change Directory CD command 2 Copy the hardware device driver file for your system TIPC HADVRTI DEV IBM HADVRIBM DEV AT HADRVAT DEV to your root directory Use the COPY command 3 Reboot the computer to load the TI WAY Host Software device driver TIWAY Host Software for PC User Manual Installation 1 11 14 Using TWAY Once the TIWAY Host Software is installed in your system it is ready to be used The TIWAY subroutine libraries support the following computer languages e MS BASIC for TIPC
174. i e never returns with the FIRSTHALF NOTFINISHED YET error TIWAY Host Software for PC User Manual TIWAY Support Routines 5 5 6 1 6 2 6 3 Chapter File Transfer Subroutines OVerVileW coro uix gxxweixR o a KEINE ERRARE wh be eee Rhee eee ER ES Partial Memory Transfers eer Transfers Between Different Typesof Devices Generic Upload Download ssssssssssesse nnns Specific Segment Transfers 20 ett menn Subroutine Descriptions cece nnns nan UPLOAD c smicas naci exce RS Goin obice Nori Ka RO takai AAA DNLOAD gc Upload soii HACER iad Cad bid geek qe kd dde eR ig DO WING gd over stated cetera Ee nae iac ces Dd Mc o t cu MC arenes ena eect Transfer File Descriplions ccoccccccc I mmm mmm TransferFile Name Specification ooocoooccocoorcororer ee me Transfer File Construction sssssesee RH s Transfer File Formats sssssseee RR haee TIWAY Host Software for PC User Manual File Transfer Subroutines 6 1 6 1 Overview Partial Memory Tansfers Two callable procedures UPLOAD and DNLOAD are provided to cause transfers of Secondary memory stored within ASCII files e Both procedures are callable from the applications program only e Both procedures are separate from the rest of the TI WAY Host Software Package e Each procedure resides in a separate linkable object module Upload and download file transfer functionality supported includes the following Partia
175. ic download e Specific segment download Unilink only e Download between different devices After you request DOWNLOAD you are prompted for the file specification filename The file characteristics induding the creation date highway Secondary address and attached device model number are displayed for verification which you are asked to supply You arethen prompted for the Secondary address to receive the download If the highway or Secondary address does not match the file characteristics you are asked to verify that this mismatch is your intention The specified attached device is checked to see if itis NIM or CIM based If it is not the download cannot proceed Finally the download is attempted Only memory types contained within the upload file are downloaded If the file does not contain V memory for example DOWNLOAD proceeds to constant memory no error message is displayed If any TIWAY error occurs during DOWNLOAD the operation stops and an error message is displayed Chapter 6 contains more information on transfer files In the example on the next two pages a file that was previously uploaded from highway 1 Secondary 12 is downloaded to highway 1 Secondary 9 You were requested to verify the download to a different Secondary Because the response was yes the download was performed NOTE If the upload file contains extended addressing the extended version of the tag specifier must be used i e hhaa not zh
176. ificant difference in the way data is stored within 500 505 Secondaries and the way data can be stored within IBM compatible computers It is important that you understand these differences and how the TIWAY Host Software Package treats them This format is best described by example The hexadecimal value 501D is stored within PM 550 V memory as follows memory address 500 505 Convention MSB LSB Thetransmission order across the TIWAY network is MSB followed by LSB In our example 50 is followed by 1D That value is stored in a computer in the order received memory transmission address order pm TIWAY Host Software for PC User Manual 500 505 and Host Computer Data G 1 However assuming this value was defined within an applications program astype WORD INTEGER two byteinteger PC data formats definethe first byte as the LSB and the second as MSB This is opposite of the true value 501D hex becomes 1D50 byte swapping memory PC transmission address convention order The TIWAY Host Software Package has two mechanisms available to resolve this conflict When reading data from a 500 505 Secondary if conversion from 500 505 format to PC format is required then usethe TIGET routine TIGET reads the value 501D hex from the PM550 or other 500 505 controller and performs the necessary byte swap In the example above TI GET stores 50 hex received first in the MSB of the WORD INTEGER and stores 1D hex received second in the LSB
177. ifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used ilen The rlen argument contains the length of ri32 i32 The read buffer is specified in integers as an array of words The array is returned in host format Values are 1 2 Secondary address 2 2 number of times polled 3 2 number of frames transmitted 4 2 number of time outs 5 number of frames received 6 2number of frames re transmitted 2 number of received errors from Secondary 2 number of transmitted errors to Secondary 2 number of times Secondary initialized 7 8 9 since last Host Adapter reset TIWAY Host Software for PC User Manual Subroutine Library 10 45 10 35 SECLOG Call Format Notes on Call Format Related Calls 10 46 Subroutine Library The SECLOG subroutine returns a list of all Secondaries currently connected to the specified highway SECLOG is the implementation of command code 06 NOTE Thelist returned from SECL OG represents only the existence of an entry in the Host Adapter Secondary log table for that Secondary not that the Secondary is currently available Secondaries not disconnected DEACT routine remains in this list even if the Secondary is physically disconnected or powered down BASIC and CALL TIWAY SECLOG istat xtn hwy rilen ri254 FORTRAN CALL SECLOG istat xtn hwy rilen ri254 Pascal TIWAY
178. ii pp ii pp ii pp pp pel Configuration where jj more to follow finished nn dddd 0j dddd dddd 0j where start address returned address dddd returned address status value F aaaa rrrr F aaaa aaaa rrrr where address 1 1024 aaaa address 1025 8192 word force status value Figure 6 5 520C 530C Upload File Format TIWAY Host Software for PC User Manual File Transfer Subroutines 613 Transfer File Descriptions continued TAG NAME 072c HWY STA 07 2C IME 18 JUN 1995 09 28 43 MODEL 2C CONFIG 0800 0400 0000 0080 0100 001F 001E 001E 0001 E5B4 8401 B9AO0 89A9 8401 0009 BDAO 8A01 9802 8401 8A03 0011 EBD1 EBD6 99A0 8402 9803 07E9 8000 8000 8000 8000 8000 07F1 8000 8000 8000 8000 8000 07F9 8000 8000 8000 8000 8000 0001 0011 0022 0003 0004 0008 0009 0009 4C2D 000B 000C E 0010 0011 0011 0012 0013 501D 0018 03E9 0001 0002 0003 0004 0008 03F1 0009 000A 0000 0000 0000 03F9 0000 0000 0000 0000 0000 0000 00 00 60 01 60 02 07 60 06 60 0008 00 08 60 09 60 0A 60 67 OE 67 0010 00 10 FF 11 FF 12 FF E FF 16 FF 0018 00 18 FF 19 FF 1A FF E FF 1E FF 0000 00 Figure 6 6 520C Upload File Example 6 14 File Transfer Subroutines TIWAY Host Software for PC User Manual TAG HWY NAME hhaa STA MOD IM EL F B CONFIG MEMORY Configuration repeat for each loop hh aa dd mm
179. in BASIC 20 n Subroutine Calling Parameters 0 0 ttt m Passing Parameters to Subroutines Named Tag Table Maintenance ccccccccccccccccc eee eee nena Creating the Named Tag Table cc nnns Accessing a Named Tag Specification 666s 1 26 TIWAY Host Software for PC User Manual Installation 1 1 1 1 Overview Background Requirements Hardware Requirements 1 2 Installation This chapter describes the installation and machine dependent features of the SIMATIC TI WAY Host Software package developed for the personal computer PC Topics include e Making a backup copy of the TI WAY Host Software e Installing the TIWAY Host Software on your PC e Configuring your system to use the TI WAY Host Software Package e Linking application programs to the TIWAY Host Software libraries Please note that this chapter does not teach you how to compile programs written in any software language nor does it contain a description of the TIWAY subroutines The subroutines are described later in this manual The following documentation is also helpful e MS DOS operating system manual for your PC e Operating instructions for your PC e Appropriate software language manual s Thefollowing hardware constitutes the basic requirements necessary to support the TI WAY Host Software Package e BM9 compatible personal computer PC e 640Kbytes RAM e One floppy disk drive 5 1 4 or 3 1 2 double sided dou
180. inary Data Link Control BDLC frame and sends it to the host adapter e Thehost adapter strips away the command code section of the instruction and uses it for routing the remainder of the instruction primitive to the network e TheNIM takes the instruction isolates the part it needs and translates the remainder into specific PLC Task Codes that it sends to the controller 2 4 Overview TIWAY Host Software for PC User Manual Languages Supported Data Format Conversion At thelowest level e The controller executes the Task Codes and sends the response to the NIM e TheNIM uses the responses to the PLC Task Codes to generate the network response It embeds the response in the appropriate TI WAY Primitive and sends it through the network to the host adapter e Thehost adapter appends command code data to the response embeds it within an NITP frame and sends it to the host computer e Thedevice driver in the host computer strips off the NITP section of the response and sends the remainder to the TIWAY Subroutine e TheTIWAY Subroutine strips off the command code section of the response and sends the remainder to the user program e Your program takes appropriate action based upon the response The TIWAY Host Software Package which provides a convenient user interface to the TI WAY facilities makes the commands transparent to you or to any user and allows programming in high level languages Languages supported
181. ines EEEEN FW en eem EE Host Adapter Command Codes ACTVAT AC Jistat xtn hwy wilen wi4 rilen ri4 Connects Secondaries ADIAG AD istat xtn hwy rilen ri32 Reads host adapter diagnostics 08 BRDCST BR istat xtn hwy cmdlen cmd275 Broadcasts messages 2 POLL PO istat xtn tag rsplen rsp275 Polls Secondaries for responses SDIAG SD istat xtn tag rilen ri32 Reads Secondary diagnostics SECLOG SL istat xtn hwy rilen ri254 Reads Secondary log 06 XPAR XP EE 2 emd275 Sends user constructed command TIWAY NIM Primitives Xtn 02 DEACT DA istet xtn hwy wilen wi4 rilen ri4 Disconnects Secondaries 05 Xtn 03 Xtn 7 CHNGST CH listat xtn tag state sstat Changes state of Secondary 10 CONFIG CN istat xtn tag rilen ri32 sstat Reads Secondary configuration 03 istat xtn tag nblk cclst taglst DEFBLK DE nnnnist sstat Defines blocks 50 FILL FL istat xtn tag nnnn pattern sstat Fills blocks 32 GATHER GA istat xtn tag mask rsplen rsp275 Gathers blocks using mask 51 sstat Reads maximum primitive and GETLEN istat xtn tag primlen nblks block lengths al L istat xtn tag cmdlen cmd275 NATIVE NA rsplen rsp275 sstat Sends PLC task code 01 RDSTS RS istat xtn tag rilen ri32 sstat Reads Secondary status TIGET TG E xtn tag nnnn rsplen ril35 Reads block of data host format Writes to block of data host TIP
182. ing of each TIPROG session To end the session issue the Q command IN Command When you first enter TI PROG you must initialize the session by typing IN at the function prompt If you attempt to execute any other command before you have initialized the session you receive an error message WRONG INITed STATE Prompt TIPROG gt IN Enter port setup string e g P1 19200 7 1 E 3 A portstr Response TIPROG gt portstr Used to select and initialize the appropriate communications port This must be an ASCII string specifying the port number baud rate number of data bits number of stop bits parity number of retries and length of time out in hex Thefollowingis an example of a port set up string P1 19200 7 1 E 3 A FI Command TheF command finish releases the system resources It should be used to end a TI PROG session You do not need to issue the Fl command if your session has exited or aborted TIPROG FI TIPROG gt Q Command TheQ command ends the TIPROG session Prompt TIPROG gt Q Response c TIWY6911 gt CTRL Z TheCTRL Z key sequence cancels the TI PROG operation in progress 7 20 Interactive Operator Utilities TIWAY Host Software for PC User Manual Host Adapter The Host Adapter commands are used to configure the network and to Commands diagnose the operation of the network These commands can be used with all Secondaries but implementation is dependent on the the UHA mode and type of Host Adapter
183. ing which of 16 blocks may be accessed The MSB specifies block 16 while the LSB specifies bit 1 For example cmask 810A hex 1000000100000101 binary would select blocks 1 3 9 and 16 rsplen The response buffer length argument defines the maximum length of the response buffer when it is returned it contains the actual length in bytes of the response See discussion of this argument for TI GET for an explanation on how it is computed rsp275 The rsp275 argument contains the returned data in the 500 505 format 10 42 Subroutine Library TIWAY Host Software for PC User Manual nblk The number of blocks nblk argument specifies how many data acquisition blocks are to be defined The argument is also used in RDRAND and WRRAND to specify the number of data groups to be transferred taglst The taglst argument is an array of addresses of the tags that identify the data element type and starting data element location for each of the blocks defined The array contains an address for each of the blocks defined nblk elements Each array element must contain a full long tag specification nnist The nnls argument is an array of bytes Each array element specifies the number of data elements to be included in a particular block The array is nblk elements long TIWAY Host Software for PC User Manual Subroutine Library 10 43 10 33 RNDRD4 Call Format Notes on Call Format Related Calls 10 44 Subroutine Library Th
184. ion stat The Secondary status argument contains the returned state of the specified attached device for Series 500 505 NIMs Release 1 1 and earlier For later releases sstat contains the current state a WARNNG Remote state changes can be hazardous in some installations Remote state changes could cause unpredictable operation that could result in death or serious injury to personnel and or damage to equipment Do not use this routine without thoroughly understanding how it might impact equipment controlled by the programmable logic controller TIWAY Host Software for PC User Manual Subroutine Library 10 11 10 7 CIMDNL The CIMDNL subroutine downloads instructions or data into a PM550 Refer tothe CIM User s Manual for more information on the procedures necessary to do this CIMDNL is the implementation of CIM functional command 65 Call Format BASIC and CALL TIWAY CIMDNL istat xtn tag ss wblen wb275 cstat mm FORTRAN CALL CIMDNL istat xtn tag ss wblen wb275 cstat mm Pascal TIWAY CIMDNL istat xtn tag ss wblen wb275 cstat mm CIMDNL istat xtn tag ss wolen wb275 cstat mm C tiway cimdnl amp istat amp xtn amp tag amp ss amp wblen amp wb275 amp cstat amp mm cimdnl amp istat amp xtn amp tag amp ss amp wblen amp wb275 amp cstat amp mm Notes on Call Explanations of the terms used in the call format follow Format itat Status which indicates succe
185. ion 4 5 e CIM Functional Command Subroutines These subroutines correspond directly to a subset of the CIM Functional Commands The data necessary to create a CIM Functional Command buffer and the pertinent data to be returned by the response to that F unctional Command are passed as arguments to the subroutine See Section 4 6 The details on each specific function are presented in alphabetical order in Chapter 10 TIWAY Interface Subroutines Topical TIWAY Host Software for PC User Manual In this manual the calling conventions for each function are shown in the following six formats e TheFortran and BASIC call through the TI WAY entry point e TheFortran and BASIC call directly to the TI WAY Interface subroutine e ThePascal call through the TI WAY entry point e ThePascal call directly to the TIWAY Interface Subroutine e TheC call through the TI WAY entry point e TheC call directly to the TI WAY Interface subroutine The information provided is intended to be applicable to the implementation of TIWAY applications programs on any supported host computer H owever some arguments are system specific These arguments are flagged in the Notes on Call Format section NOTE More details are provided on each function in the Reference Section in alphabetical order Chapter 10 TIWAY Host Software for PC User Manual TIWAY Interface Subroutines Topical 4 3 Overview continued Examples of TIWAY Subroutine calls are B
186. itialized to the size of the response buffer prior to using them in a TIWAY subroutine call The TIWAY subroutines use these arguments to determine whether the response buffer is large enough to hold the data returned from the TIWAY Network This keeps other data in the program from unintentionally being corrupted If the buffer is not large enough or if the response length argument has not been initialized and contains a value of zero the TI WAY subroutine returns an isat value of 0109 hex The error message for facility 1 message 9 is User supplied buffer too small for requested function You must be familiar with how data is stored Remember that PCs do not store data in the same way as do the secondaries or the Host Adapter For example in PCs some data is stored in four bytes with the least significant byte first Integers are stored by the secondaries and the Host Adapter in two bytes with the most significant byte first Therefore an array of bytes in Fortran containing an integer value of one is stored in PC format as shown X 1 01 X 2 200 X 3 200 X 4 00 The same data in Series 500 505 format is shown below X 1 00 X 2 01 TheTI2HST and HST2TI support routines have been provided to handle these conversions for your convenience Programmer s Notes for PC TIWAY Host Software for PC User Manual F 2 TIWAY Host Software for PC User Manual Pascal The SAMP_PAS PAS file and the SAMP PAS TYP file contain both the
187. ive Operator Utilities TIWAY Host Software for PC User Manual TW Command The 500 505 write command the dual of TR writes consecutive memory locations in a specified Secondary Data is expected in 500 505 format NOTE No morethan 128 characters of data may be entered in a single TW command The TW command is an implementation of Primitive 30 TIPROG gt TW Tag specifier 4010201000D Number of data elements decimal 2 Data free format hex DATA 03 04 05 06 WB Command The write buffer command writes consecutive memory locations in Secondaries that support buffered L memory This command supports 5TI attached devices and the data element locations specified must be conti guous The WB command is the implementation of Primitive 33 TIPROG WB Tag specifier 0101 Command CC 00 Clear storage RAM and start temporary storage of data 01 Continue storage of data in temporary RAM 02 Replace attached device memory with stored data 03 Abort temporary storage CC Command hex 00 Number of data elements decimal 4 Data free format hex DATA 0000 1111 2222 3333 Primitive status hex 00 TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 31 TIPROG Utility continued WG Command The write and gather command combines the functions of the TIWRITE command and the gather command It is particularly useful in data acquisition applications To use the WG command you must first issue the D
188. k 6D 01 istat xtn tag cmask rsplen rsp275 nblk Defines and gathers BNOBES R3 taglst nnlst blocks mask 6D 02 istat xtn tag nnnn wb275 cmask rsplen Writes and gathers blocks using 6D 03 APEROS R4 rsp275 mask 6D 04 Status and Support Routines BLDMSK mask list Builds a mask of block numbers istat xtn tt nnnn hstbuf tibuf Converts data from host format to 500 505 format istat xtn tt fmt tilen hostlen cimtyp Returns information on format EMEN istat xtn tag hwy secadd tt aaaa Looks up a tag name returns an address parameter list istat xtn tag addlst Returns address information MN istat Displays error message mE l These subroutines are not part of the main TI WAY subroutine library In order to reduce the size of applications programs they are located in a separate library module TI MSG which may be linked if needed HST2TI LKUFMT LKUTGL LKUTGS PUTMSG The related codes for all the NIM primitives are primitive code numbers All NIM primitive subroutines use Host Adapter Command Code 01 See relevant NIM manual for further description of these primitives 3 Therelated code numbers given for the CI M Functional Commands are F unctional Command Task Code numbers All CIM Functional Command Code subroutines use Host Adapter Command Code 01 See SIMATIC PM550 CIM Manual PPX 550 8105 x for further functional command descriptions 3 4 TIWAY Subroutine
189. l memory transfers UPLOAD and DNLOAD e Transfers downloads between different types of devices DNLOAD only e Genericupload download U PLOAD and DNLOAD e Specific segment upload download UPLOAD and DNLOAD Partial memory transfers permit upload or download of a selected memory type using a transfer code which is the same as the VPU function code for a similar transfer on that device Table 6 1 shows those codes Table 6 1 Partial Memory Transfer Codes 93 Constant memory 65 S memory analog alarms 95 S memory analog alarms 66 S memory SF programs 96 S memory SF programs 67 S memory SF subroutines 97 S memory SF subroutines 98 IR WF memory 99 WXY memory 6 2 File Transfer Subroutines TIWAY Host Software for PC User Manual Selection Partial memory transfers are performed one memory type at a time each transfer is placed in a separate file Table 6 2 and Table 6 3 summarize allowable partial transfers for each device Table 6 2 Memory Selectable for Upload Type 520 530 520C 525 530C 560 565 MRCU MEM Full Full Full Full Full Full Full Full e IOC N A Full Full Full N A NA Full Full Full Full Full Ew EUN Partial Partial Partial Partial Partial Partial Partial V Full Full Full Full Full Full Full Partial Partial Partial Partial Partial Partial Partial Full Full Full WAT Table 6 3 Memory Selectable for Download sac SSO SCORES L Full Full Full Full Full Full
190. le rewrite the Secondary is disconnected reset and then reconnected after the table has been rewritten e TheDNLOAD routine terminates upon any network error e TheDNLOAD routineis also designed to support future products but that support is limited to generic downloads That is DNLOAD permits a download attempt to an unrecognized device type However only a generic download is attempted If the device does not support generic downloads then an error condition occurs NOTE f a download involving an unrecognized device type is attempted then only a download from an unrecognized device type to a like type is permitted Any combination of unrecognized device type and recognized device type or a different unrecognized type is not permitted For example type X to type X is allowed Type X to 565 565 to type X and type X to type Y are not allowed NOTE You must change from RUN mode to PROG mode before you attempt a download Use the CHNGST function option 02 to change the state of the controller from RUN to PROG Use CHNGST option 00 to return to RUN after you have performed the download TIWAY Host Software for PC User Manual File Transfer Subroutines 6 7 6 3 Transfer File Descriptions Transfer File Name Specification Transfer File Construction Transfer File Formats Any valid VMS file specification may be used in identifying a transfer file Transfer files are constructed as sequential text files with a maximum
191. lent CIM type hex 08 TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 37 TIPROG Utility continued LL Command The look up tag long format command returns address information that describes the address specification passed to it The address specification can be any one of the available types The example given below uses an ASCII string TIPROG gt LL Tag specifier 40102010001 Address list in hex 0000 0001 0002 0001 0001 Address elements hex Highway number 01 Secondary address 02 Data element type 01 Address offset 0001 LS Command The look up tag short format command returns address information that describes the address specification passed to it The address specification can be any one of the available types The example given below uses a tag name as the tag specifier TIPROG gt LS Tag specifier MyTagName Address list in hex 0000 0001 0002 0001 0003 Address elements hex Highway number 01 Secondary address 02 Data element type 01 Address offset 0003 7 38 Interactive Operator Utilities TIWAY Host Software for PC User Manual TH Command TheT to host command the complement of the host to TI command converts data from 500 505 format to host format This command is particularly useful in decoding the data that are returned by XP PO NA GA and WG TIPROG TH TT data element type hex 20 Number of data elements deci mal 3 TI DATA 00 00 00 0
192. licits a response only from the single specified Secondary POLL is the implementation of command code 03 NOTE The POLL routine is intended to immediately follow the BRDCAST routine Calling another TI WAY routine after BRDCAST and before POLL causes an invalid response i e the Secondary attempts to answer the new routine as if it were responding to the POLL request When using BRDCAST and POLL through a UHA refer to the Unilink Host Adapter User Manual PPX TIWAY 8121 x for the implementation of these commands for your specific U HA mode SDIAG The SDIAG subroutine returns a list of statistics diagnostics collected by the Host Adapter about a specified Secondary The statistics contain data about that Secondary s network usage and errors SDIAG is the implementation of command code 07 4 10 TIWAY Interface Subroutines Topical TIWAY Host Software for PC User Manual Host Adapter Command Code Subroutines continued SECLOG XPAR The SECLOG subroutine returns a list of all Secondaries currently connected tothe specified highway SECLOG is the implementation of command code 06 NOTE Thelist returned from SECL OG represents only the existence of an entry in the Host Adapter Secondary log table for that Secondary not that the Secondary is currently available Secondaries not disconnected DEACT routine remain in this list even if the Secondary is physically disconnected or powered down The XPAR subroutine provides
193. load File Example continued 6 18 File Transfer Subroutines TIWAY Host Software for PC User Manual SFP 0001 IN 0000 0000 0001 0001 0002 0002 0003 0003 0003 0004 0004 0004 0005 0005 0006 0006 0006 0007 0007 0007 0008 0009 0009 0009 000A Figure 6 8 565 Non extended Upload File Example continued TIWAY Host Software for PC User Manual File Transfer Subroutines 619 Transfer File Descriptions continued 6 20 H BA A Aa A A 2i z HUHUHUHHHHHH ra z SFS 03F7 IN 0000 24 180D 180D 1816 180D 0806 0406 1E00 1E00 1E00 1E00 600C 090D 091F 091F 091F 131F 7070 0117 000A 2000 000A 2000 0009 1F60 0014 1F00 0C01 5449 4D20 4455 4E4E 1809 oco 1809 oco 1809 OFF7 5449 4D20 4455 4E 1809 1E00 001F 0001 24 2 5449 4D20 4455 4E4E 1E00 001F 0001 24 3 5449 4D20 4455 4E 1E00 001F 0001 24 1E00 SFS O3FE OFFE IN 0000 SES O3FF IN 0000 IOC IOC IOC IOC IOC IOC IOC IOC IOC IOC IOC IOC 80 80 80 80 80 80 85 85 85EF 85F0 85FF ST 0000 00 1F 20 2F OE 10 DO DF 85E0 1809 OFF 1809 01 00 64 L 00 FF L 00 FE L 00 1E00 1E00 00 FF
194. m m m m 131F 7070 0117 000A 2000 000A 2000 0009 1F60 0014 1F00 E00 001F 0001 24 1 5449 4D20 4455 4E E00 001F 0001 24 00 FF 00 FF 01 07 00 00 L 00 00 L 00 00 FF 00 FE 0226 24 0225 24 0A1F 700A 1F00 0B14 1312 1124 1615 24 FE BE FF FF 00 FE Figure 6 10 565 Extended Upload File Example continued File Transfer Subroutines TIWAY Host Software for PC User Manual TAG NAME aaaa HWY STA nn nn TIME aaaa MODEL 65 1111 vvvv cccc iiii tctr drmm sreg tmov ones ssss tttt CONFIG where drmm sreg tmov ones ssss Ettt yYyYVy ww dd dd dd dd dd dd VVyy WW ZZ YYYY WW Yyyy Ww dd mmm yyyy hh mm ss ss tctr number number number number number of of Of of of size of S size of total memory dd dd dd dd dd dd dd dd dd dd timer counters drum edrums shift registers table moves one shot instructions memory dd dd dd dd dd dd dd dd dd dd dd dd Figure 6 11 560 565 Generic Upload File Format TIWAY Host Software for PC User Manual File Transfer Subroutines 6 27 Transfer File Descriptions continued TAG NAME 0202 HWY STA 02 02 TIME 10 SEP 1995 14 11 42 02 MODEL 65 CONFIG 00002000 00000800 00000800 00000028 00000400 00000083 00000800 00000400 00000800 00002C00 00040000 0000 00 00 15 55 0
195. m yyyy hh mm ss ss 60 65 llll vvvv cccc iiii tctr drmm sreg tmov ones ssss tttt where VVVV 0001 Goode 0001 iiii LP 0001 RS 0001 RS Oxxx AA 0001 0001 1111 0001 nnnn ecc d spad vfad vfad otad otad srsr sphi tctr drmm sreg tmov ones ssss tttt number number number number number size o mmmm mmmmn mmmm nnnn kkkk kkkk nnnn nnnn nnnn nnnn nnnn nnnn nnnn of of of of of f S MMM nnnn nnnn rsad rsad timer counters drum edrums shift registers table moves one shot instructions memory size of total memory mmmm mmmm srsr cfl sphi spl g cflg pvlo o splo hial pvhi pvhi loal loal hhal llal llal ydal oda hhal rocl rset rocl aldb aldb gain rset rat rat 000x 000x eeee sss S SSSS ETET SSSS LEE ccecce nnnn nnnn nnnn nnnn pvad spad spad pvad rate rate cf dglc dglc vfad vfad g cflg pvlo pvlo pvhi pvhi hial loal loal sphi hhal sphi spl o splo hial hhal llal llal ydal ydal odal odal rate rate a db aldb Figure 6 7 560 565 Non extended Upload File Format TIWAY Host Software for PC User Manual File Transfer Subroutines 615 Transfer File Descriptions continued SFP pppp cccc nnnn nnnn nnnn nnnn 00ee 00ss aaaa aaaa tttt tttt IN 0000 dddd dddd dddd dddd
196. mand The DE command is the implementation of Primitive 50 TIPROG gt DE Tag specifier 0102 Number of blocks decimal 5 Arbitrary limit of 4 blocks in TIPROG Number of blocks decimal 2 Definition for first data acquisition block Block number decimal 32 Tag specification 30102000001 Number of data elements decimal 20 Definition for second data acquisition block Block number decimal 1 Tag specification 40102010004 Number of data elements decimal 2 TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 27 TIPROG Utility continued FL Command Thefill command can be used to fill a consecutive block of memory in a 5TI or PM550 attached device with a specified pattern To view the results of the fill command use the TG command The FL command is the implementation of Primitive 32 TIPROG gt FL Tag specifier 40101010001 Number of data elements decimal 10 Pattern hex four digits C3C3 GA Command The gather command is used to gather data from the data acquisition blocks defined using the DE command The TH and LF commands are useful in processing the results of the gather command The GA command is the implementation of Primitive 51 TIPROG gt GA Tag specifier 0102 MSB is block 32 LSB is block 1 Mask of data acquisition blocks hex eight digits 8000000 Response buffer 40 bytes received 85 29 86 01 BO 01 00 01 01 F4 60 21 60 22 60 23 60 24 60 25 60 26 60 27 60 28 00
197. mediately followed by the POLL routine Calling another TI WAY routine after BRDCST and before POLL causes an invalid response i e the Secondary attempts to answer the new routine as if it were responding to the POLL request When using BRDCAST and POLL through a UHA refer to the Unilink Host Adapter User Manual PPX TIWAY 8121 x for the implementation of these commands for your specific U HA mode TIWAY Host Software for PC User Manual TIWAY Interface Subroutines Topical 4 9 DEACT The DEACT subroutine logically disconnects a Secondary or list of Secondaries from the specified highway Disconnecting a Secondary removes that Secondary s entry from the Host Adapter s Secondary log preventing any communications between that Secondary and the Host Adapter until the Secondary is again connected to the Host Adapter with the ACTVAT subroutine DEACT is the implementation of command code 05 The DEACT command results in the issuing of an HDLC DISC tothe Secondary depending on the configuration of the UHA NOTE A Secondary is successfully disconnected only if it is connected and functioning properly when DEACT is issued When a NIM is disconnected it resets the test mode is entered and the NIM executes its startup sequence A 500 505 NIM attached to a 560 or 565 has its memory configuration table updated at this time POLL The POLL subroutine polls the specified Secondary for the response to the broadcast it received most recently POLL so
198. mmandsavailableinTIPROG a 7 18 Interactive Operator Utilities TIWAY Host Software for PC User Manual Figure 7 2 shows the TIPROG Help Menu screen as it appears when you type HE AC ACTVAT Activate Secondary SDIAG Secondary diagnostics AD ADIAG Get adapter diagnostics SECLOG Secondary log BR BRDCST Broadcast message TIGET Read data host format CH CHNGST Change Secondary state TI2HST Convert TI to host format CN CONFIG Get configuration TIPUT Write data host format DA DEACT Deactivate Secondary TIREAD Read Data TI format DE DEFBLK Define data blocks WRBUF Buffered write FI FIN Finish TIWAY routines WRTGAT Write and gather blocks FL FILL Fill block TIWRIT Write data TI format GA GATHER Gather blocks XPAR Transparency command GL GETLEN Get primitive length HT HST2TI Convert host to TI format INIT Initialize TIWAY routines CR CIMRD CIM read LF LKUFMT Lookup format CIMWR CIM write LL LKUTGL Lookup tag long format RNDRD1 CIM download random LS LKUTGS Lookup tag short format RNDRD2 CIM retrieve random NA NATIVE NIM native task code RNDRD3 CIM define and gather PO POLL Poll response RNDRDA4 CIM write and gather RS RDSTS Read status RDLOOP Read CIM loop data Q Exit utility Also Z This message Figure 7 2 TIPROG Help Menu TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 19 TIPROG Utility continued Session Control Commands ThelN command initialize must be issued at the beginn
199. n BASIC 100 TIWAY 2 0 INS INIT 1 PORT P1 19200 7 1E 3A 110 CALL TIWAY INS ISTAT PORT Call INIT subroutine 120 ADIAG 55 XTN20 HWY 1 130 CALL ADIAG ISTAT XTN HWY RILEN RI132 0 Call ADIAG subroutine Thefile DEF BAS creates and initializes variables that can reference all of the TIWAY subroutines This file can be MERGED into a BASIC program and executed as a subroutine thereby saving the programmer time and effort If the BASIC program is to be compiled the MERGE statement can be deleted and the program will be ready to compile 1 24 Insta lla tion TIWAY Host Software for PC User Manual Executing in Interpreted BASIC continued Subroutine Calling Parameters Passing Parameters to Subroutines Because MS BASIC uses a method different from FORTRAN and Pascal to pass variable and array addresses several differences exist in the manner in which parameters are declared when using the TI WAY subroutines With the exception of variables used for floating point numbers all variables and arrays used in the TI WAY subroutines should be declared as INTEGER Those variables declared in FORTRAN as INTEGER 4 can be declared as INTEGER arrays with a dimension of 2 A complete list of the variable declarations for BASIC is found in Chapter 3 of this manual BASIC does not pass parameter addresses in the same manner as does FORTRAN or Pascal Because of this the naming of parameters specifically arrays is different wi
200. nal help contact your Siemens distributor or sales agent If you need assistance in contacting your distributor or sales office in the United States call 800 964 4114 If additional technical assistance is needed call the Technical Services Group in J ohnson City Tennessee at 423 461 2522 TIWAY Host Software for PC User Manual 1 1 12 13 14 1 5 1 6 1 7 1 8 Chapter 1 Insta lla tio n OVEIVICW occccccc 00 Background Requirements ssssssssssssse eee eese Hardware Requirements ssssssssssss eene eer Software Requirements ssssssess m Customer SUP POM iuret eh rope e Ene AA ek del ee nC Go ea n t PC Software Package Files o occooccccccccc eee eee eee nn Operation i5 dicere aia a aa a eed ia die a Pe CR Rat die aces Software Installation and Operation Backing Up YourSoftware sssssssssssss eee Instala tioN aia eibi act decet aberit dba diui do dude b ea Ve dd dede de teu dodo a Program linking 55 222339 R a anew RR IRR Ns wena OR aA Object Code Fes ia riiag kaaa ARS Ede Ra Eo ER P EORR GRACE oe eee RR linking on the PC rastas eire peor datada heads babere baa nde dd Pasa d Edel EE latice C EET Compiling with Lattice C Executing in Interpreted BASIC oocccccccccccc nnne nnn nn Getting Started ios re pes Etpe a RR Red co ce Rr Pop RR RC RC RR Dead Typical BASIC StartUp tim ae dart remake aman e je gi dee Bv d ee d By bd od Calling Subroutines
201. ne waits until the I O is complete and then executes the second half In this case the fully synchronous case all processing is performed with a single call either to the TI WAY entry point or tothe individual subroutine This is the normal case and is supported in all operating systems Thetransaction number is a read only variable and can be specified with the constant zero in the argument list If a subroutine is called with a transaction number of 1 only the first half of the subroutine is executed before control returns to the programmer The transaction number is overwritten with a new number identifying that transaction and a copy of the first half argument list is kept by the TI WAY library To receive the results from the I O the second half the TI XTN or TIXTNW subroutine must be called Either of these subroutines is called with only an istat and the transaction number that was returned from the first half The results from the I O in the second half are returned through the copy of the first half argument list that is no arguments to return data are required by the TIXTN or TIXTNW entry points The only difference between the TIXTN and TIXTNW subroutines occurs when the 1 0 is not finished when they are called The TIXTN subroutine returns immediately with a status of FIRST HALF NOTFINISHED YET facility 1 message 10 hex and you should call it back later The TIXTNW subroutine waits for the I O to complete before returning
202. nfiguration File is ready for the actual configuration process This process can be invoked two ways e nteractively e From a command file Theinteractive version is invoked by typing RUN SYS SYSTEM NETCONFIG from DCL If the process is to be executed from a command file then the following line should be added RUN SYS SYSTEM NETCONFIG 9 8 Network Autoconfiguration File TIWAY Host Software for PC User Manual Chapter 10 Subroutine Library WEE S T enceeee MOD ADAG 103 BIDMSK iia 103 BRDOST E cde Por TER IO PER SERERE RDELE E nies 05 COM us oes usq Ne putas Ms adducam ma ee UNE ia ES eee D MS c sed vio o c ET MB C IPPO O N AA A A Ame ee o i00 C Ea UAT GONG Wi Dto dee o O rcm D qe DT ELE USUS sisi rE Ar RAE DLE m D X e 10 17 GATHER me Ou GENEN A 10 19 GEIMSG MENTRE 10 20 HSM ee eee ee nee ee re UA INIT M 1059 MUERE o hee ses se nace o BERN oct eee PEE cl See ee ere re ee dalt ee A ioci esie renin iiiaae aen iode TIWAY Host Software for PC User Manual Subroutine Library 10 1 10 25 10 26 10 27 10 28 10 29 10 30 10 31 10 32 10 33 10 34 10 35 10 36 10 37 10 38 10 39 10 40 10 41 10 42 10 43 10 44 10 45 10 2 Subroutine Library TIWAY Host Software for PC User Manual This chapter lis
203. ngth Notes on Call Explanations of the terms used in the call format follow Format itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination tag Theshort form of the tag highway and address can be used Since UPLOAD is written in FORTRAN the tag argument must be passed by descriptor See the programming manual for thelanguage you are using for information on passing arguments by descriptor 10 54 Subroutine Library TIWAY Host Software for PC User Manual ftype Specifies what type of download is requested according to its value Declaration integer 10 generic upload of all memory 11 generic upload of program memory 12 generic upload of data memory 60 upload all memory NIM attached device 61 partial upload L memory 62 partial upload V memory 63 partial upload Constant memory 64 partial upload S memory loop tables 65 partial upload S memory analog alarms 66 partial upload S memory SF programs 67 partial upload S memory SF subroutines 24000 Unilink specific segment upload which is translated to mmmm field in primitive where A SS AT Set to select specific segment requested for upload Always set to 1 for mmmm Set to 1 for extended mmmm flen Length of file specification
204. nk to load all data into the high end of the data segment By using the DSAL LOCATE switch without using the HI GH switch an application program is allowed to dynamically allocate any available memory which is below the area on the high end of the data segment occupied by data The application program can havethis allocated area pointed to by the same DS pointer NOTE Pascal and FORTRAN programs require this dynamic allocation HIGH The switch HIGH causes Link to place the run image as high a possible in memory NOTE Do not use this switch with Pascal or FORTRAN programs LINENUMBERS Theswitch LINENUMBERS directs Link to include the line numbers and addresses of source statements in the list file MAP The switch MAP directs Link to include all global symbols in the list file These symbols are listed alphabetically at the end of the file NO Theswitch NO causes Link to ignore default libraries which may be specified by the compiler PAUSE The switch PAUSE causes Link to stop processing and allow diskettes to be changed in the disk drives before continuing STACK The switch STACK creates a stack of the same size specified by number At least one of the object modules must contain a stack allocation statement or Link returns an error message For further information concerning Link consult the MS DOS operating system manual TIWAY Host Software for PC User Manual Program Linking continued Link Order TheTIWA
205. nload 6 4 File Transfer Subroutines TIWAY Host Software for PC User Manual Specific Segment Tansfers Table 6 5 Memory Selectable for Generic Upload Download ELI Program Memory Full partial Data Memory Full partial pm Selection Generic memory transfers are selected by requesting transfers of all memory types program memory or data memory Each upload request is placed in a separate file Another special feature of the Unilink Secondary adapter is the segmentation of Secondary device memory The UPLOAD and DNLOAD routines support transfers of either all segments or of specific segments It is your responsibility to know how the segments are defined You must also know the Secondary device memory program name Consult the SIMATIC Unilink Secondary Adapter User Manual for further information on the use of specific segments Selection Thetransfer of specific segments to and from a Unilink Secondary adapter is selected by setting appropriate bits within a selection mask Either all or specific segments may be selected for transfer E ach upload request is placed in a separatefile It is your responsibility to know which bits within the mask correspond to the desired segment These bits are specific to an application TIWAY Host Software for PC User Manual File Transfer Subroutines 6 5 6 2 Subroutine Desc riptions UPLOAD TheUPLOAD subroutine uploads the contents of a Secondary to a text file on the host system This proced
206. nly 01 Executing w non fatal error 02 No execution 02 Executing loops only 03 No execution 04 Executing loops w non fatal error 05 No execution w non fatal error 80 Fatal error DD Secondary state hex 02 Returned operational status hex 03 A WARNING Remote state changes can be dangerous in some installations Remote state changes could cause unpredictable controller behavior that could result in death and or serious injury or damage to equipment Do not use this routine without thoroughly understanding how it might impact operations directed by the controller 7 26 Interactive Operator Utilities TIWAY Host Software for PC User Manual CN Command The configuration command displays the configuration total memory sizes of the specified Secondary The CN command is the implementation of Primitive 03 TIPROG gt CN Tag specifier 0102 Configuration parameters decimal Device type hex 40 Instruction data memory size 16384 Variable data type memory size 26624 Constant data type memory size 0 Local input output memory size 16 Global input output memory size 2032 DE Command The define block command defines a data acquisition block and specifies data that are to be returned from the block NIMs have 32 blocks that are definable by memory location and length Using the DE command independent blocks can be defined Notethat the DE command only defines the block to retrieve the data use the GA com
207. ns the state the device is in when the response to the subroutine call is returned Current state is returned for all attached devices except Series 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the state that is returned is the state that existed before the subroutine call was issued Table 3 7 shows the seven possible values Table 3 7 Seven Possible Subroutine Values we Bemsm Operational and performing instruction data type and loop execution Operational and performing instruction data type and loop execution with a non fatal error detected 02 Operational and not performing instruction data type execution with loop execution Operational and not performing instruction data type or loop executi on Operational and not performing instruction data type execution with loop execution and a non fatal error detected 05 Operational and not performing instruction data type or loop and a non fatal error detected 8 Not operational dueto a fatal error condition Fatal and non fatal errors are defined by each unique device 3 30 TIWAY Subroutine Calling Arguments TIWAY Host Software for PC User Manual Chapter 4 TIWAY Interface Subroutines Topical 4 1 OVOCIVICW ii DL cee ie ier bhGee tees eee ies uate 4 2 Session Control Subroutines snnm raa narra 4 3 Computer Port Setup Initialization INIT S btroutine Initia liZdtiOTi 5 tacere Ca enc EC Y ad IER i ce Gall FOUN bz eene em
208. nstead of one that is based on time efficiency Only severe limitations such as insufficient memory for the tag table may force you to use an alternative that is not the most logical Specifying the address directly as an ASCII stringis an alternative that allows you to specify addresses that do not appear in the tag table and is particularly applicableto interactive use The ASCII string for non extended addressing consists of 11 bytes of ASCII data The first byte of the character string specified is a or followed by the highway Secondary address data type and data location The format follows HHSSTTAAAA where signifies ASCII specification follows HH Highway number in hex 2 hex digits SS Secondary address in hex 2 hex digits TE Data element type in hex 2 hex digits AAAA Data element location in hex 4 hex digits If extended addressing is being accessed the address can be specified by a similar ASCII character string The first byte of the character string specified is a followed by the highway Secondary address data type and data location The format follows HHSSTTAAAAAAAA where HH Highway number in hex SS Secondary address in hex TT Data element type in hex AAAA AAAA Data element location in hex TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 19 Addressing continued Binary Specification The short form of an address can be generated
209. ntrol returns to you See Table 3 5 You must later issue another call for the response using the xtn argument value returned by the first half call Table 3 5 Accessing the Network with xtn 00 The I O request is sent The response to the request is returned 1 Thel O request is sent Control returns to you You must issue the TIXTN or TIXTNW subroutine to read the response Synchronous and asynchronous completion buffered I O and TIXTN and TIXTNW subroutines are discussed in Chapter 10 TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 27 3 11 Status Determination The TIWAY Host Software Library allows you to determine the status of several different variables Most significant and common to every subroutine is the istat argument Composite Enor Each TIWAY subroutine call returns a single 2 byte integer status The Reporting istat returned status contains the facility number and the message number Argument within that facility with the facility in the high byte and the error in the low byte For example if a host adapter cable is not connected a network transaction initiated by a TI WAY subroutine call times out and the isat value returned equals 1794 decimal or 0702 hex This is interpreted as Facility 07 Message 2 which reads Device timeout see Appendix E In addition to the status information provided in isat a message generati on facility and a message reporting facility pr
210. on Dueto the dynamic nature of the MS BASIC interpreter there are differences in the programming procedures for TI WAY subroutines These differences are in variable declaration and initialization Methods of passing arrays and single variables to the TI WAY subroutines are also different Tousethe TIWAY subroutines in theinterpretive mode follow these steps 1 UsetheMS DOS COPY command to load your licensed copy of MS BASIC into the directory containing the TI WAY subroutines 2 Executethe TIBASIC EXE program to load the TIWAY subroutines and start the BASIC interpreter This is why BASIC EXE must bein the same directory 3 n your program locate the starting address of the subroutine library by reading memory locations 0 03E 0 and 0 03E 1 The contents of these locations are The low byte of the starting address is in 03E0 The high byte of the starting address is in O3E 1 NOTE Thefile DEF BAS contains the necessary statements to load the starting address into your BASIC program The BASIC instruction Merge can be used to add this file to your program Refer to the MS BASIC Language Manual for additional information TIWAY Host Software for PC User Manual Executing in Interpreted BASIC continued Typical BASIC For this typical application assume that the TI WAY files are contained in a Startup hard disk directory named TI WAY Assume also that the default drive is the hard drive and that you are using a TIPC
211. on of TIWRIT and GATHER The BLDMSK subroutine can be used to build the mask TIWAY Host Software for PC User Manual Subroutine Library 10 59 10 45 XPAR The XPAR subroutine provides a simple subroutine interface for formatting a command buffer sending it to a Host Adapter and by proper format through a Host Adapter to any connected Secondary and receiving a copy of the entire response This transaction gives you the ability to use facilities that are not supported by other TIWAY Subroutines TI WAY Primitives that are not supported CIM Functional Commands that are not supported and all Task Codes A specific example is the Host Adapter Reset Command Code FF NOTE You should be familiar with the Host Adapter and any addressed Secondaries before using the XPAR subroutine XPAR provides two services First the command and response buffers are formatted to contain the data to be interpreted by the Host Adapter without including the link level protocol encapsulation NITP or BDLC protocol packet Second optional error detection is provided for Host Adapter TIWAY Primitives and CIM Functional Commands The CIM Functional Command error checking is also suitable for PM550 CCU Task Codes An error checking argument is used to determine the amount and type of error checking performed The XPAR simply generates the message delimiters the character count and the checksum for the message body you supply NOTE After issuing a reset
212. or 16 loop software DDDDDDDD Orange deviation in excess 64 floating point notation Read Reset Value 38DDDDDDDD L Loop number 1 8 F Presence of 16 loop software LL Loop number 1 16 for 16 loop software DDDDDDDD Reset value in excess 64 floating point notation Write Reset Value 39LDDDDDDDD 39DDDDDDDD or 5 peep Mumbo S 39F LLDDDDDDDD F Presence of 16 loop software LL Loop number 1 16 for 16 loop software DDDDDDDD Reset value in excess 64 floating point notation Read Loop Rate 3ADDDDDDDD L Loop number 1 8 F 16 loop LL Loop number 1 16 for 16 loop software DDDDDDDD Loop ratein excess 64 floating point notation Write Loop Rate 3BLDDDDDDDD 3BDDDDDDDD _ or Or L Loop number 1 8 3BFLL 3AF DDDDDDDD or 3AF DDDDDDDD F 16 loop LL Loop number 1 16 for 16 loop software DDDDDDDD Loop ratein excess 64 floating point notation Read High Alarm Value 3CDDDDDDDD L Loop number 1 8 F 16 loop LL Loop number 1 16 for 16 loop software DDDDDDDD High alarm valuein excess 64 floating point notation or 3CF DDDDDDDD TIWAY Host Software for PC User Manual PM550CCUTaskCodes D 15 Table D 1 CCU Task Codes for PM550 continued Write High Alarm Value 3DLDDDDDDDD 3DDDDDDDD or or L Loop number 1 8 3DFLLDDDDDDDD 3DFDDDDDDDD F 16 loop LL Loop number 1 16 for 16 loop software DDDDDDDD High alarm valuein excess 64 floating point notation Read Low Alarm Value 3EDDDD
213. or Numbers Type of Error TI WAY detected by the TI WAY Subroutine Library NETEXCEPT detected by the Host Adapter network exception INTERNEXCP detected by the Host Adapter adapter internal exception HOSTEXCEPT detected by the Host Adapter host exception PRIMITIVE detected by NI M based attached devices while processing a TI WAY Primitive OPERATING SYSTEM detected by the operating system while processing an operating system request O STATUS detected by the device driver while processing O 8 CIMEXCEPT detected by CI M based attached devices while processing a CI M Functional Command 9 NATIVE TASK CODES detected by the Secondary being accessed The error type entyp argument used only in the XPAR subroutine contains a code that indicates the amount and type of error checking to be performed Possible codes are shown in the Notes on Call Format section of the XPAR subroutine in Chapter 10 The CIM status field contains additional status as defined by the ii field in the response buffer Refer to the CIM User Manual for a more complete description of potential responses The following status reporting conventions assist you in identifying the source of error TIWAY Subroutine Calling Arguments 3 29 Status Determination continued Secondary Status sstat Argument The Secondary status argument contains the code for the current state of a specific NI M based attached device Current state mea
214. or PC User Manual TheHST2TI routineis the corollary to TI2HST for writing data to a 500 505 Secondary memory PC transmission address convention order e TIWAY Host Software for PC User Manual 500 505 and Host Computer Data G 5 Appendix H Unilink Dip switch Reference C ard Dipswitch Settings For NITP Protocol DIPSWITCH 1 HOST COMMAND TIMEOUT TIWAY BAUD RATE UP SYNCHRONOUS DOWN ASYNCHRONOUS TIWAY UP FULL DUPLEX DOWN HALF DUPLEX UP NRZI DOWN NRZ UP NITP Run Time LED Display O O O O O O Adapter Online Receive Transmit Good LED Error Codes No Error Run Mode No Error Diagnostic Mode Diagnostics ROM Checksum Error 0000 RAM Test Error TIWAY Port 1 External Loopback Error TIWAY Port 2 External Loopback Error Host Port Port 3 Loopback Error 000 O Port 4 Loopback Error TIWAY Serial Communications Controller Failure PIM Checksum Error CPU Failure 5 Volt Power Supply Failure Watchdog Timer Failure External I O Loopback Error DIPSWITCH 2 O 0 UP TEST MODE DOWN RUN MODE UP HIU EHA amp IO LOOP TEST DOWN MHIU EHA HOST PORT BAUD RATE UP SYNCHRONOUS DOWN ASYNCHRONOUS OSU HOR UP FULL DUPLEX HOST PORT DOWN HALF DUPLEX UP EVEN PARITY DOWN ODD PARITY HOSTEORY UP PARITY ENABLED DOWN PARITY DISABLED HOD HOR e Oe O00 000 Baud Rate Table SWITCHES BAUD RATE MSB LSB 110 1
215. or the download operation to be enabled If the PM550 is in any other mode a facility 8 message 67 hex Invalid Download Sequence error is returned TIWAY Host Software for PC User Manual Subroutine Library 10 13 10 8 CIMRD Call Format Notes on Call Format Related Calls 10 14 Subroutine Library The CIMRD subroutine reads consecuti ve memory locations from the specified CI M based attached device BASIC and CALL TIWAY CIMRP istat xtn tag nnnn rsplen rsp275 FORTRAN CALL CIMRD istat xtn tag nnnn rsplen rsp275 Pascal TIWAY CIMRD istat xtn tag nnnn rsplen rsp275 CIMRD istat xtn tag nnnn rsplen rsp275 C tiway cimrd amp istat amp xtn amp tag amp nnnn amp rsplen amp rsp275 cimrd amp istat amp xtn amp tag amp nnnn amp rsplen amp rsp275 Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used nnnn The nnnn argument specifies the number of data element locations to be filled Each data element is two bytes long rsplen The response buffer length argument specifies a maximum length for the data to be returned and the actual length on return in bytes
216. or the 5TI NIM PM550 NIM and Series 500 NIM Rel 1 0 the data element location is a 16 bit value However for the Series 500 505 NIM Rel 2 1 that supports extended memory the data element location may be a 16 bit non extended addressing or 32 bit extended addressing value Data element type and data element location must be specified if you plan to use any memory functions TIWAY Interface Subroutines generally require all four address elements the highway the Secondary the data element type and the data element location The argument for the full address is the tag argument The full address tag argument is called the long form of the tag throughout this document Some subroutines require only a portion of the full tag argument Subroutines that need the highway and the Secondary but not the data element type and data element location are identified as needing only the short form of the tag Subroutines that require the short form of the tag discard both the data element type and data element location if they are provided Subroutines that address all Secondaries on a specified highway use only the hwy argument and need not include the Secondary the data element type or the data element location Three CIM Functional Command Subroutines further define the tag argument with either the mm argument or the rtype argument The mm argument specifies a subset of the CIM data element types called memory areas The rtype argument i
217. ork TIWAY Host Software for PC User Manual Subroutine Library 10 19 10 13 DEFBLK The DEFBLK subroutine is used to define PLC memory locations See the applicable NIM user manuals for a complete description of the data acquisition Primitives DEFBLK is the implementation of Primitive 50 Call Format BASIC and CALL TIWAY DEFBLK istat xtn tag nblk cclst taglst nnnnist sstat FORTRAN CALL DEFBLK istat xtn tag nblk cclst taglst nnnnist sstat Pascal TIWAY DEFBLK istat xtn tag nblk cclst taglst nnnnist sstat DEFBLK istat xtn tag nblk cclst taglst nnnnist sstat C tiway defblk amp istat amp xtn amp tag amp nblk cclst taglst nnnnlst amp sstat defblk amp istat amp xtn amp tag amp nblk cclst taglst nnnnlst amp sstat Notes on Call Explanations of the terms used in the call format follow Format itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used nblk The number of blocks nblk argument specifies how many data acquisition blocks are to be defined The argument is also used in RDRAND and WRRAND to specify the number of data groups to be transferred cclst An array containing block numbers for each block to be defined taglst
218. ort a program name In this event the record exists but the name is blank e Two header records exist for each segment A record containing the segment selection mask A record containing the segment name e Records containing data returned for each requested segment is organized sequentially after the two segment header records e As with the generic transfer file data records for each segment contain additional data to promote faster downloads TIWAY Host Software for PC User Manual File Transfer Subroutines 6 9 Transfer File Descriptions continued TAG NAME hhaa HWY STA hh aa IME dd mmm yyyy hh mm ss ss MODEL 00 CONFIG 1111 0000 0000 iiii L 0001 nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn L 0009 nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn nnnn Figure 6 1 5Tl Upload File Format 0101 01 01 18 JUN 1995 09 29 27 97 00 0400 0000 0000 0400 E5B4 8401 B9A0 89A9 EDB3 BDAO 8A01 9802 8401 B5A0 8000 8000 8000 8000 8000 8000 Figure 6 2 5T Upload File Example 6 10 File Transfer Subroutines TIWAY Host Software for PC User Manual TAG NAME hhaa HWY STA hh aa IMI dd mmm yyyy hh mm ss ss 2 1 MODI 0 30 CONFIG lll vvvv 0000 iiii 0001 mmmm mmmm rmmrmm mmmm 0009 mmmm mrmmm mmmm mmmm 1111 0001 0009 VVVV WXY 0001 WXY iiii ST nnnn IR aaaa IR aaaa start a
219. ost Software for PC User Manual TIWAY Subroutine Calling Arguments 3 11 Reference List of Arguments continued Table 3 3 Argument Reference List for BASIC and C C continued Declaration Declaration Definition BASIC C C ea quee state Secondary should be File Transfer ftyp transfer request type integer integer read only pname length of program name integer integer read only Unilink proram name lTheC declarations are determined according to Figure 3 3 312 TIWAY Subroutine Calling Arguments TIWAY Host Software for PC User Manual TheC declarations are determined according to the following list integer is a 16 bit word Packing and unpacking of bits within integers is required char is an unsigned 8 bit byte typedef char bary16 16 typedef char bary275 275 typedef char cim_mask 16 typedef int iary4 4 typedef int iary32 32 typedef int iary135 135 typedef int iary254 254 typedef char mask_type 42 typedef union int binary 5 char ascii 11 char name 16 jtag type typedef tag typetag array 32 Figure 3 3 C Declarations TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 13 3 4 List of Data Elements Types Table 3 4 shows data element TT types for the controller Table 3 4 Data Element Types Data Element me Type in hex o Format Data Element Description radar CI meray integer Constant C or K memory
220. ots ed ce is LKUFMTSubroutine sssssesee RH a ERUTGIE SUBTOUGINE xui raria reet cen tied os cea is ia ira LKUTGS Subroutine saoire tieien RII ea PUIMSG SUb routine sasama i cde doa dederat e ederent dede CER este RR e TIZAST SUDTOULING 0 a eR Rc OR Pt Go TIXTN and TIXTNW Subroutines ssssssee RR an Chapter6 File Transfer Subroutines 6 1 OVerVie W lrimii ke Ra e9zrfE EGG eerBiEea E I a EONRPETRK eECRERERRIREFa Gag euer Partial Memory Irarisfers cecus ss a ER PIRA QURE aa Ea Ra Rob x RS Transfers Between Different Types of Devices Generic Upload Download sssssssssssss e nnn Specific Segment Transfers inea eieaa aia a men 6 2 Subroutine Descriptions 0c cece enne UlEOr APTE DNEOAD usura perte Ebert rte doter ve E d re b Odes Well UMTATMPITT Down ad iii aaa a 6 3 Transfer File Descriplions ooccccccccccc nemen nnn Transfer File Name Specification oooocccocccccccccorn m Transfer File Constuction scierie a Nac Tratister File Formats acea cete ER RAE E Re CREE E e bow era e enc e Loa ac ed Chapter7 Interactive Operator Ullities 7 1 Using TIUSER and TIPROG 0ococcccccc n nsnm 72 MUGEN E m AG TIVAIE COMMANG roroi 2 aea aco oc OE REED acer aaa CHANG ESAIEEO0MMand orte arae t uate ebbe e s ae dere EE dra t DEACATIVATE Command uranio o o Oe o e CT e a ea cs DOWNLIOAD Comnmarnd iie emet dele DIEI CE ie ac a acc cC s FILESIATUS Command 12 ssnizebrteserirCceRieduacrke
221. ovide a mechanism to convert a status code into a message and print it on the operator s terminal GETMSG subroutine can be used to retrieve this error message while the PUTMSG subroutine displays it See Chapter 5 for GETMSG and PUTMSG details The error codes and their meanings are given in Appendix E In addition TIUSER and TI PROG display these messages if an error occurs during execution of a utility command The status represents either success or the first fatal error detected If an error is detected processing ceases and the status is returned with the value representing the error If the subroutine call is successful then the returned status is zero All errors are considered fatal errors and when they occur the subroutine will stop running and return the error code without completing the rest of the subroutine s functionality A single TI WAY call can have as many as nine independent sources of errors each with several possibilities for error each with overlapping sets of error numbers To aid the TI WAY programmer in identifying and correcting errors error reporting for the TIWAY Subroutine Library occurs as a detailed set of status reporting cases Nine facilities are provided as shown in Table 3 6 3 28 TIWAY Subroutine Calling Arguments TIWAY Host Software for PC User Manual Enor Type entyp Argument CIM Status cstat Argument TIWAY Host Software for PC User Manual Facility Table 3 6 Facility Er
222. processing and execute a native Task Code directly Primitives are high level commands that are not specific to any controller model instead NIMs usethe Task Code commands that are native to the attached controller to perform the function requested by the primitive TheNATIVE subroutine accepts a Task Code command buffer appends it to the Host Adapter Command Code and TI WAY Primitive length and Primitive 01 and passes it to the Secondary The response without H ost Adapter and TIWAY primitive overhead is returned in the response buffer This is similar tothe XPAR subroutine with this exception in addition to the NITP protocol Host Adapter Command Code 01 and TI WAY Primitive 01 are added to the command and stripped from the response Seethe documentation for the individual controllers for information concerning the Task Codes they support NOTE NATIVE is recommended for use only by the experienced programmer RDSTS TheRDSTS subroutine reads the status of the specified Secondary and attached device RDSTS is the implementation of Primitive 02 TIGET TheTIGET subroutine is used to read consecutive memory locations from a specified NI M based attached device and to convert the data from the 500 505 format to a format compatible with the host TIGET is an implementation of Primitive 20 TIPUT The TIPUT subroutine is used to convert data from the host format to the 500 505 format and to write to consecutive memory locations in a specifi
223. r ss Argument ssassn Tag List tag lst Argument i ni ea eee a RIDERE CIT RR Ga na Rae Diagnoslics iii A anaes deem Network ACCESS 22 rir anke RES EREREERESREEEEARUA aa deta gens Status Detennination 52 css rv pk a aaa Composite Error Reporting istat Argument Emor Type ertyp Argument occccccccccccnr eene eee CIM Status cstat Argument cece cee hn Secondary Status stat Argument srianan aa i eee Contents Chapter4 TIVAY Interface Subroutines Topical 4 1 OVerVieW c cli 13k xg arado 4 2 Session Control Subroutines snnm nara rara aan 4 3 Computer Port Setup Initialization 0cocococcooc mmm INIT Subioutine Inttia liza tion ci na ee Rex EY ex Y Ecc e Call RONG b c oos trito gusten ave ai De niet heer we enh devel ae otc a A Sapa teet Notesotn Call Format 2 5 e eb ED eHCED ead A E RI DRE deb d RI d 4 4 Host Adapter Command Code Subroutines eese nnn nnn n nnn 4 5 TIVAY Primitive Subroutines c ccc cece cece naar rara rara rana 4 6 CIM Functional Command SubrouUtineS ccccccccccccccc ra Contents v Chapter5 TIMAY Support Routines 5 1 OVCIVICW narices 5 2 Descriptions of Support Subroutines 0 cc cece eee eee eee eee n nnn nnn nn nnn BLDMSK SUDTOUUNE 3 2 edticbEERPPE ER adu b deinen EXG EE vade po NE CX d ER ends GETIMSG S brOUllie serpes vario bacc e e e Ro Ce e Rache ac Ear D y HSTZT Subroutine x iioi eec eere E dece dedo a deh P
224. r to back up the software you must prepare a diskette Use the MS DOS FORMAT command Refer to your MS DOS operating instructions and proceed as directed NOTE MS DOS manuals list instructions for installing the computer operating system formatting diskettes and making back up copies of your software Usethe DISKCOPY command to copy the software from the distributi on diskette Again the working copy should be the copy you create 1 8 Insta lla tion TIWAY Host Software for PC User Manual Software Installation and Operation continued Installation Theinstallation procedure which follows assumes that a hard disk drive is being used as the system drive A hard drive is recommended because it greatly reduces the time required to access information and provides for much greater storage capacity than using a floppy disk only based system NOTE Before installing TI WAY software read the file called readme on disk 1 It contains pertinent information that may not be covered in this manual Installing TIWAY Software The following three steps are required to install the TI WAY Host Software into your computer A special directory should be created for the TI WAY software 1 Create a working directory on the hard disk in your system This can be done using the MS DOS Make Directory MD command 2 Transfer control to the working directory This can be done using the MS DOS Change Directory CD command 3 Copy the files from
225. record length of 128 characters There are two types of transfer files a conventional transfer file and a generic transfer file Conventional Transfer File Format Conventional transfer files are produced by requesting either full or partial uploads from a Secondary Generic Transfer File Format The generic transfer file created when a generic upload is requested has a a file format very similar tothe conventional transfer file Some differences do exist however e Thememory types are repositioned to adhere to the order in which the Series 500 505 NIM expects to find data for the generic download operation M emory types are organized for program and data memory e Records within each data type are defined to include additional data to promote faster downloads Task codes and associated parameters are included in addition to data Figure 6 1 through Figure 6 18 show the formats and examples of conventional and generic transfer files for each of the various Secondaries supported by this package 6 8 File Transfer Subroutines TIWAY Host Software for PC User Manual Specific Segment Transfer File Format The specific segment transfer file created when a specific segment upload from a Unilink Secondary Adapter is requested has a format similar to the generic transfer file format for the Unilink The following differences should be noted e TheSecondary device memory program name has its own record NOTE Some devices do not supp
226. ric Upload File Example TIWAY Host Software for PC User Manual File Transfer Subroutines 631 Transfer File Descriptions continued TAG NAME HWY STA TIMI MODI CONE aaaa nn nn dd mmm yyyy hh mm ss ss 100 1111 vvvv 0000 0000 0000 tttttttt where EETLECTE size of total memory PROGRAM Ss AAA AAA program name mmmm specific segment mask where Le DIA N O P non extended mask extended mask AAA AAA yyyy ww zz dd dd dd Set to select Specific segment segment name dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd dd yyyy ww zz dd dd dd dd dd dd dd dd dd abov xampl depicts the binary format pz segment name aaaaa aaaaa aaaaa aaaaa AAA YYYY YYYY AAA WW ZZ WW ZZ AAA YYYY YYYY segment name aaaaa aaaaa aaaaa aaaaa Th xample above depicts the ASCII format Figure 6 17 Unilink Specific Segment Upload File Format 6 32 File Transfer Subroutines TIWAY Host Software for PC User Manual TAG NAME 0101 HWY STA 01 01 TIME 4 NOV 1995 10 08 05 99 MODEL 100 0000 09p7 0000 0000 0000 000009D7 PROGRAM SS 4001 Spindle Map 0000 01 00 SMAP CM RWL TD RWL TR RWL TH RWL TL RWL TP RWL TO RWL 0001 01 00 SMAP TPK R JT RWL AH RWL AL RWL AC RWL AO RWL APK R 0002 01 00 SMAP S
227. rned data is the TIGET subroutine the CIMRD GATHER NATIVE RNDRD2 RNDRD3 RNDRD4 TIREAD WRGAT and XPAR subroutines return data in the 500 505 format TI 2H ST can convert from one buffer into another or the same buffer can be specified for source and destination The GATHER WRGAT and RNDRDx subroutines return buffers that may have to be converted in several segments BASIC and CALL TIWAY TI2HST istat xtn tt nnnn tibuf hstbuf FORTRAN CALL TI2HST istat xtn tt nnnn tibuf hstbuf Pascal TIWAY TI2HST istat xtn tt nnnn tibuf hstbuf TI2HST istat xtn tt nnnn tibuf hstbuf C tiway ti2hst amp istat amp xtn amp tt amp nnnn tibuf amp hstbuf ti2hst amp istat amp xtn amp tt amp nnnn tibuf amp hstbuf Explanations of the terms used in the call format follow itat Error codes is returned in the status field Declaration integer xn Thetransaction number must be zero Declaration integer tt The read only tt argument is the data element type only low byte significant Declaration integer nnnn Theread write nnnn argument is the number of data elements to convert Declaration integer tibuf The read only 500 505 buffer argument is the source buffer 500 505 format Declaration byte array FORTRAN packed array 1 275 of byte Pascal hstbuf The write only host buffer argument is the destination buffer host format Declaration byte array FORTRAN pa
228. s 2 212 3 dipswitches host adapter UPLOAD W wreur ia 16581037 Write blocks with mask 10 58 10 59 buffered 10 56 Write and gather WRTGAT 7 32 Write buffer WRBUF 7 31 10 564 10 57 WRONG INI Ted STATE 7 20 WRTGAT 4 14 10 58 XPAR 4 10 7 25 10 60 10 61 Customer Response We would like to know what you think about our user manuals so that we can serve you better How would you rate the quality of our manuals Excellent Good Fair Poor Accuracy Organization Clarity Completeness Graphics Examples Overall design Size Index Would you be interested in giving us more detailed comments about our manuals Yes Please send me a questionnaire No Thanks anyway Your Name Title Telephone Number Company Name Company Address Manual Name SIMATIC TIWAY Host Software for PC User Manual Edition Third Manual Assembly Number 2804790 0001 Date 05 96 Order Number PPX TIWAY 8108 3 FOLD NO POSIAGE NEC ESSARY IF MAILED IN THE UNITED STATES BUSINESS REPLY MAIL FIRST C LASS PERMITNO 3 JOHNSON CMY TN POSTAGE WILL BE PAID BY ADDRESSEE ATTN Technical Communications M S 519 SIEMENS ENERGY amp AUTOMATION INC 3000 BILL GARLAND RD P O BOX 1255 JOHNSON CITY TN 37605 1255 FOLD SIMATIC is a registered trademark of Siemens AG 5TI UNILINK TIWAY PM550 Series 500 and Series 505 are trademarks of Siemens Energy amp Automa
229. s utility requires a configured network since this utility does not support UHA configuration commands Table 7 2 Alphabetized List of USER Commands TIUSER Command Function e ACTIVATE Connects an attached devicetothe highway CHANGESTATE Changes attached device state DEACTIVATE Disconnects an attached device from the highway ES Downloads file to attached device memory UPLOAD U ploads attached device memory to file VERIFY Describes how to compare two uploaded files QUIT Terminates utility All TIUSER commands operate on either a CIM or NIM based attached devices and HIUs or Secondary adapters All addresses are specified in the standard addressing format see Section 3 5 either by tag name direct ASCII specification or direct binary specification Many of the commands require only the specification of the highway or the highway and Secondary address NOTE You must type at least the first four letters of each command at the utility prompt TIUSER to receive the command prompts TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 3 TIUSER Utlity continued 7 4 When running TIUSER and you are trying to decide which command to use type in HELP and the screen shown in Figure 7 1 appears Interactive Operator Utilities Commands ACTIVATE DEACTIVATE LIST STATISTICS UPLOAD DOWNLOAD VERIFY FILESTATUS CHANGESTATE QUIT Connect Secondaries to highway Disconn
230. s 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the statethat is returned is the state that existed before the subroutine call was issued Table 3 7 shows the seven possible values a WARNNG O Before transferring a new program by calling WRBUF clear L memory in its entirety use FILL with pattern 0000 see Chapter 4 If this is not done parts of residue programs execute which could cause unpredictable operation in the controller that could result in death or serious injury to personnel and or equipment damage Use FILL with pattern 0000 to clear L memory See Chapter 4 TIWAY Host Software for PC User Manual Subroutine Library 10 57 10 44 WRIGAT Call Format Notes on Call Format 10 58 Subroutine Library The WRTGAT subroutine combines the functions of the TIWRIT Chapter 4 and GATHER Chapter 4 subroutines It writes consecutive memory locations in a specific NIM based attached device and then gathers data The data are sent and returned in the 500 505 format WRTGAT isthe implementation of Primitive 52 BASIC and CALL TIWAY WRTGAT istat xtn tag nnnn wb275 mask rsplen rsp275 sstat FORTRAN CALL WRTGAT istat xtn tag nnnn wb275 mask rsplen rsp275 sstat Pascal TIWAY WRTGAT istat xtn tag nnnn wb275 mask rsplen rsp275 sstat WRTGAT istat xtn tag nnnn wb275 mask rsplen rsp275 sstat C tiway wrtgat amp istat amp xtn amp tag amp nnnn wb27
231. s Reference List Reference List of Arguments 00c0ccccccc List of Data Elements Types occccoccccccccccr rr nn Addressing cccccccccccc eee eee naa aaa a aaa ar aaa ar a a rn Address Elements in rcc a Rc cie edad Highway Selection esee cate ede merde cepa ee nia la ee a e ed ted Secondary Selection iria aa cioe cioe wai kae ebraica ed Data Element Type Selection 0 ccc em Data Element Location Selection cc cece nae Addressing Arguments ssssssssssssse ees Address Specification ice ci tea Deer een Eb eek A eed e ta A Tag Name Specification erri ereraa eeann a eee ees ASC IFSPCCIICAUON scada dees take tito i bis wha ea iad AAA a ae se ARAE e eae Binary Spec IfICatlOli ss oeste eerte rra dan Rd ac oan ances ia a ER ots Buffer Specification ooooooccccocccc inira A Eirini eani Enr iia Command Buffers Response Bufe rraian ee REDUCE Fue dO b EROR RR n AEEA eo ath at Rea d BUS ii bes A RO CE RECENTE RARE aS White B ffers suiti asia ad bac rb he Rhe RR Ree aed eb Pre a ave bbe sind ae Data Block Manipulation 0 ocoococococcc enn nmm UCLInstruction Code cc Argument 6 ccc ee Block List ccls Argument oooccccccccc mme Number of Blocks nblk Argument ssssssssseeeeee e m Number of Data Element Locations nnnn Argument aasa Number of Data Elements List nnnnlst Argument assasi Pattem pattem Argument i riisti 0 0 cece eee CIM Command Code Specifie
232. s of the commands TIWAY Host Software for PC User Manual Installation 1 15 1 16 Insta lla tion Entering Link Information This format assumes that the program to be linked has been compiled using the MS DOS BASIC compiler The following command uses a single line to call the Link program to link YOURPROG OBJ TIWYBCM OBJ TIMSGBCM OBJ ALIGN OBJ and MSG OBJ together The linker automatically searches for the BASIC run time library BASRUNG LIB LINK ALIGN4MSG 4TIMSGBCM 4TI WAY BCM Y OURPROG YOURPROG return The switch P will cause the following message to be output to the user About to Generate E XE file Change Disks return NOTE More information about switches is contained in the Link Options section of this chapter One additional observation about this particular command because no disk drives were specified in this command all of the above files are assumed by the linker to be on the default subdirectory on the hard disk Entering Link Information Froma File This format assumes that the application program to be linked has been compiled using the MS FORTRAN compiler For this format an ASCII file must be created using an ASCII editor The information entered intothis fileis the same information that you enter as commands in the other two Link formats TIWAY Host Software for PC User Manual Program Linking continued The following commands illustrate how the information file may be created using the E
233. s particular Host Adapter through an I O request native to the operating system the xtn argument 6 Theresponseis checked for the following errors e A directive error reported when the I O request is issued e A device driver error representing a link level error e Any error in one of the three sets of Host Adapter error codes e A Primitive error code 7 Any detected errors are reported in istat 8 If no errors were detected the data portion is returned to the caller s buffer rsp275 and the length of the response is returned to rsplen 9 TheSecondary status argument contains the code for the current state of a specific NIM based attached device Current state means the state the device is in when the response to the subroutine call is returned Current state is returned for all attached devices except Series 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the state 4 4 TIWAY Interface Subroutines Topic al TIWAY Host Software for PC User Manual that is returned is the state that existed before the subroutine call was issued Table 3 7 shows the seven possible values TIWAY Host Software for PC User Manual TIWAY Interface Subroutines Topical 4 5 4 2 4 6 Session Control Subroutines The subroutines in the TIWAY Subroutine Library and the TI WAY Support Subroutine Library require some initialization before you can use them This includes some data structure initialization and access to the site speci
234. scal with messages Link ALIGN MSG TIMSGPF Y OURPROG TIWAY PF YOURPROG Pascal MS BASIC without messages Link TIWAYBCM YOURPROG YOURPROG MS BASIC with messages Link ALIGN MSG 4TIMSGBCM 4TI WAY BCM 2 Y OURPROG YOURPROG Lattice C Special batch files are provided to link Lattice C programs to the MS DOS operating system if the MAKELC BAT fileis invoked to load the Lattice C compiler into your computer see Lattice C Compiler These batch files may be used without modification to link the TI WAY subroutine library to the operating system if no message facilities are to be invoked If however you plan to usethe error message routines provided in the TIWAY subroutine library you must first modify the link batch files as follows Modify LINKL BAT From Link 1c 1 c 1 962 963 4 5 6 967 968 9 961 1c 1 c To Link 1 962 963 1c 1 c 4 5 6 967 968 9 4 1c 1 c Toinvokethe above file for TI WAY type LINKL ALIGN MSG TIMSGC YOURPROG 1 20 Insta lla tion TIWAY Host Software for PC User Manual Program Linking continued Compiling with Lattice C Modify LINKML BAT From Link 1c 1 c 1 962 963 4 5 6 967 8 969 1 1c 1 1cu 1c 1 Ic To Link 1 962 963 1c 1 c 4 5 6 7 968 9 4 1c 1 1cu 1c 1 c Toinvokethe above file for TI WAY type LINKML ALIGN MSG TIMSGC YOURPROG If MAKELC BAT has not been used to install your Lattice C compiler the link order is as follows Lattic
235. ser Manual 10 28 RDLOOP Call Format Notes on Call Format Related Calls The RDLOOP subroutine reads loop parameters from a PM 550 BASIC and CALL TIWAY RDLOOP istat xtn tag rtype rsplen rsp275 FORTRAN CALL RDLOOP istat xtn tag rtype rsplen rsp275 Pascal TIWAY RDLOOP istat xtn tag rtype rsplen rsp275 RDLOOP istat xtn tag rtype rsplen rsp275 C tiway rdloop amp istat amp xtn amp tag amp rtype amp rsplen amp rsp275 rdloop amp istat amp xtn amp tag amp rtype amp rsplen amp rsp275 Explanations of the terms used in the call format follow itat The status argument is the composite status returned previously by a TIWAY Subroutine Dedaration integer xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used rtype The rtype argument specifies the type of data to be returned Valid values are rtype function 01 display only 02 tuning only 03 display and tuning Notice that the combination of all loops display and tuning are not allowed rsplen Thersplen argument must specify the maximum length of the response buffer response buffer size when the POLL subroutine is called It contains the actual length of the response on return The response buffer for POLL contains the entire response to the Host Adapter Command Code induding the command code identifier rsp27
236. ser Manual Table C 1 CIM Functional Command Codes continued Meaning commi Response Read loop data 6AD1 D79 PM550 500 501 and 502 only O read all loops 1 8 read loops specified by number 1 display 2 tuning 3 display and tuning loop number error status process variable D12 D19 setpoint D20 D23 alarm status and loop status D24 D31 output D32 D39 process variable high range D40 D47 process variable low range D48 D55 bias D56 D63 gain D64 D71 rate D72 D79 reset Read random data 6BNNMAAAMAAA 6BDDDD hex number words to read 00 80 V memory C memory A memory hex address data read Read CIM self test status no failures RAM failure ROM failure TMS9903 failure CI M PM 550 communication failure TIWAY Host Software for PC User Manual CIM Functional Command Codes C 3 Table C 1 CIM Functional Command Codes continued Meaning commi Response Read loop data PM 550 503 O read loops 1 8 1 8 read loop specified by number 00 read loops 1 8 01 10 read loop specified by number FF read loops 9 16 display tuning display and tuning DO 1st digit loop number old format D4 D11 process variable D12 D19 setpoint D20 D23 alarm status and loop status D24 D31 output D32 D39 process variable D40 D47 process variable low range D2 D3 error status D48 D55 bias D56 D63 i D64 D71 D72 D79 Read random block Download block table R
237. shed 28 Broadcast transactions are not supported 5 2A Address value exceeds structure format not extended 28 Writerefused devicein upload or download mode 2C Command field CC not supported 2D Deviceisalreadyin progress with upload or download aa Segment s requested not supported or defined 30 Conflict with another device in write operation 5 z 5 DD FF E 10 Error Listings TIWAY Host Software for PC User Manual E 6 Facility 6 Operating System Status Exceptions These are no facility 6 operating system errors in the PC version of the TIWAY Host Package TIWAY Host Software for PC User Manual Error Listings E 11 E 7 Facility 7 I O Status Exceptions These input output 1 0 errors reported by the device driver are detected in setup or execution of I O to the Host Adapter See Table E 6 Table E 6 Facility 7 I O Status Enor Listings O Status Invalid function O Status Invalid port setup string O Status 1 O not finished yet O Status User buffer too small O Status Fatal error retry count exceeded E 12 Eror Listings TIWAY Host Software for PC User Manual E 8 Facility 8 CIM Exceptions These are errors reported by CI M based attached devices while processing a CIM Functional Command See Table E 7 Table E 7 Facility 8 CIM EXCEPT CIM Functional Command Enors Message Number Description Hex 50 mwaidmemoyspedfied 5 m 53 Loop no
238. simply by omitting the data element type and the data element location For instance 0101 would bea sufficient address specification for highway 1 Secondary 1 if you were issuing a Secondary diagnostic command If you wanted to read data however you would have to specify both the data element type and data element location Specifying the address directly in binary is useful for applications in which the program steps through a set of consecutive address items under program control For instance for a program to poll all Secondaries a loop could be used with the sec word of the binary specification as the index variable Binary specification however is not appropriate for interactive use For non extended addressing in binary the four address elements highway Secondary data element type and data element location are specified as an array of integers of the form 0 integer zero for non extended binary specifications HWY integer containing highway number hh SEC integer containing Secondary address ss TYP integer containing data element type tt ADDR integer containing data element location aaaa For extended addressing in binary the four address elements are specified as an array of integers of the form 1 integer one for extended binary specifications HWY integer containing highway number hh SEC integer containing Secondary address ss TYP integer containing data element type
239. sp275 argument contains a valid response to the Task Code with Task Code arguments TIWAY Host Software for PC User Manual 10 26 POLL Call Format Notes on Call Format Related Calls The POLL subroutine polls the specified Secondary for the response to the broadcast it received most recently POLL solicits a response only from the single specified Secondary POLL is the implementation of command code 03 NOTE The POLL routine is intended to immediately follow the BRDCAST routine Calling another TI WAY routine after BRDCAST and before POLL causes an invalid response i e the Secondary attempts to answer the new routine as if it were responding to the POLL request When using BRDCAST and POLL through a UHA refer tothe SIMATIC Unilink Host Adapter User Manual PPX TIWAY 8121 x for the implementation of these commands for your specific UH A mode BASIC and CALL TIWAY POLL istat xtn tag rsplen rsp275 FORTRAN CALL POLL istat xtn tag rsplen rsp275 Pascal TIWAY POLL istat xtn tag rsplen rsp275 POLL istat xtn tag rsplen rsp275 C tiway poll amp istat amp xtn amp tag amp rsplen amp rsp275 poll amp istat amp xtn amp tag amp rsplen amp rsp275 Explanations of the terms used in the call format follow istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn
240. ss of tag 20 010502004A 15 highway Secondary address tt 02 C memory starting address 74 decimal 0105130002 ane i r highway Secondary address tt 13 timer counter reset starting address The actual subroutine call would be as follows defblk Sistat amp xtn 0105 amp nblk cclst taglst nnnnist amp sstat TIWAY Host Software for PC User Manual TIWAY Subroutine Calling Arguments 3 23 Data Block Manipulation continued Number of Bloc ks nblk Argument Number of Data Element Locations nnnn Argument Number of Data Elements List nnnnlst Argument Pattem patiem Argument CIM Command Code Specifier ss Argument Tag List taglst Argument 3 24 TIWAY Subroutine Calling Arguments The number of blocks nblk argument specifies how many data acquisition blocks are to be defined The argument is also used in RDRAND and WRRAND to specify the number of data groups to be transferred The nnnn argument is used to specify how many data element locations to write read or transfer The nnnnist argument specifies the number of data elements to return for a defined block It is an array of numbers specifying the number of elements for each of a series of blocks to betransferred The pattem argument used only in theFILL subroutine is an integer field that fills a consecutive block of memory on a specified NIM based atta
241. ssful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used ss The ss argument is a code used to describe the operation Valid values in hex are SS function 00 initial block 01 continue 02 terminate 08 request download On return ss contains the code describing the operation that was performed It contains an 02 if the operation was automatically terminated wblen Thelength of the write buffer Note that wblen must equal zero when download ss 208 is requested wb275 The wb275 argument contains the instructions or data to be downloaded 10 12 Subroutine Library TIWAY Host Software for PC User Manual csat Contains the CCU status code on return Possible values in hex are cstat status 01 CCU not in start up 02 C and L memory in ROM 04 extended C memory present 08 extended L memory present mm The data element type argument defines the type of PM550 memory mm memory type 01 L memory 02 V memory 04 C memory Note that mm is cumulative i e mm 3 defines L and V memory mm 7 defines L V and C memory Related Calls TheTIUSER DOWNLOAD function Chapter 6 can be used instead of writing programs to download Secondary memory NOTE The PM 550 must be in Startup or Remote mode in order f
242. st of the files you will find in this software package A brief description of each file and its contents follows the table Table 1 1 PC Software Package Files File Title Extension Description This file enables the GETM SG subroutine in the TI WAY Host Software Package to find the messages used during system operation and ensures that those messages are formatted correctly This is a file which MS DOS looks for when it boots and it may be placed in the system root directory or incorporated into an existing CONFIG SYS file CVUTA This file contains the device driver software for an BM compatible computer using the internal TI WAY adapter card This is essentially an Include file for use with Interpreted BASIC It defines DEF BAS the entry points into the subroutines and sets up variables so your program will know where to call them CONFIG FULLSAMP C This file contains a sample C program to be used as an example when programming in that language It has calls to all library functions This file contains the device driver software for an IBM Personal Computer with MADRVAT a 80286 or higher processor using an RS 232 port This file contains the device driver software for an IBM XT personal computer HABRA using an RS 232 port HADRVTI DEV This file contains the device driver software for the Texas nstruments Professional Computer TIPC using an RS 232 port MAKEC E A DOS batch fileto compile and link any Microsoft C pro
243. st significant word of the 32 bit mask TIWAY Host Software for PC User Manual 3 10 Network Access By default the TI WAY Interface subroutines provide synchronous completion the subroutines issue I O to the Host Adapter and wait for the response before returning to the application program However the TI WAY Subroutine Library also supports overlapping processing between the task and the I O or issuing the I O request manually The type of network access is specified in the xin argument Any subroutine that issues I O to the Host Adapter actually has two parts first the subroutine formats a buffer and issues the I O request and second the subroutine completes the I O request and returns status and data n some cases synchronous completion is not desirable The xtn argument therefore allows for asynchronous completion In asynchronous completion the buffer is formatted and the I O request is sent but the status and data are not returned until you call for them using the TIXTN or TIXTNW subroutine Thetransaction number determines whether the second half of the subroutine is executed whether the status and data is returned automatically as soon as they are available Two transaction numbers are available O and 1 If the xtn argument is O synchronous I O both the first and second half of the subroutine is executed If the xtn argument is 1 asynchronous I O only the first half of the subroutine is executed before co
244. statistics diagnostics collected by the Host Adapter about the Host Adapter s network usage and network activity statistics ADIAG is the implementation of command code 08 Call Format BASIC and CALL TIWAY ADIAG istat xtn hwy rilen ri32 FORTRAN CALL ADIAG istat xtn hwy rilen ri32 Pascal TIWAY ADIAG istat xtn hwy rilen ri32 ADIAG istat xtn hwy rilen ri32 C tiway adiag amp istat amp xtn amp hwy amp rilen ri32 adiag amp istat amp xtn amp hwy amp rilen ri32 Notes on Call Explanations of the terms used in the call format follow Format itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion hwy Specifies the logical highway number which is used to communicate to the device setup for communications For the PC version of the TIWAY package hwy is always set to 1 rilen The number of elements returned within ri32 TIWAY Host Software for PC User Manual Subroutine Library 10 5 10 6 Subroutine Library i32 This integer array is used to return the Host Adapter diagnostics list in host format Response values follow aaaa 2 number of invalid commands from host bbbb 2 number of send information commands processed cccc number of broadcast commands processed dddd 2number of poll Secondary commands e
245. t the composite status as returned from a previous call to a TIWAY subroutine It prints a message containing the facility code and message code and a text if one exists for that status on the operator s console TheTI2HST subroutine converts a list of data of a singletype from 500 505 format to host format The only subroutine that converts a list of returned data is the TI GET subroutine the CIMRD GATHER NATIVE RNDRD2 RNDRD3 RNDRD4 TIREAD WRGAT and XPAR subroutines return data in the 500 505 format TI 2HST can convert from one buffer into another or the same buffer can be specified for source and destination The TI2HST subroutine is the complement of the HST2TI subroutine Notethat the GATHER WRGAT and RNDRDx subroutines return buffers that may have to be converted in several segments 5 4 TIWAY Support Routines TIWAY Host Software for PC User Manual TIXIN and TIXTNW Subroutines Each subroutine that does I O is divided into two parts the first half uses the argument list to build the command buffer and to issue the I O request the second half takes the results of the I O i e the response buffer and returns pertinent parts of it to the application using the argument list The TIXTN and TIXTNW subroutines are used to call the second half of a subroutine that does I O and are not valid for any others If a subroutine is called with a transaction number of O it is synchronous that is after the first half the routi
246. t CCU mode 0 not program 1 program TIWAY Host Software for PC User Manual 10 6 CHNGST Call Format Notes on Call Format The CHNGST subroutine is used to change the operational state of a specified NIM based attached device CHNGST is the implementation of Primitive 10 This changes the operational state of a controller either from STOP to RUN or vice versa and must be selected carefully See warning below BASIC and CALL TIWAY CHNGST istat xtn tag state sstat FORTRAN CALL CHNGST istat xtn tag state sstat Pascal TIWAY CHNGST istat xtn tag state sstat CHNGST istat xtn tag state sstat C tiway chngst amp istat amp xtn amp tag amp state amp sstat chngst amp istat amp xtn amp tag amp state amp sstat Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used state The sate argument an integer argument in which the high byte of the integer is ignored is the code for the desired state Each NIM allows a specific subset refer to the appropriate NIM user manuals Generally those states are 00 execute logic and loops 01 execute loops only 02 no execut
247. t Software for PC User Manual DEACTIVATE The DEACTIVATE command is used to disconnect a Secondary or Command Secondaries from the TI WAY network You are prompted for a Secondary address The utility attempts to disconnect the specified Secondary from the highway and prompts for another Secondary to disconnect This is repeated until all desired Secondaries are disconnected To terminate the command enter RETURN and the TIUSER gt prompt is returned The address specification requires only the highway and Secondary address e 9 40102 would specify the first highway and Secondary number Any further address specification is ignored The LIST command can be used to verify that the Secondary has been disconnected Prompt TIUSER gt DEAC Secondary deactivation Input tag for Secondaries to deactivate one per line lt RETURN gt toterminate Tag specifier Response Tag specifier 20102 o deactivate a Secondary Tag specifier lt RETURN gt o terminate the command TIUSER gt TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 7 TIUSER Utlity continued DOWNLOAD The DOWNLOAD command is used to download a file to an attached device Command Thefilethat is downloaded is onethat was previously uploaded from a Secondary Before you download to the Secondary you should put the Secondary into the proper state for downloading This command supports e Full memory download e Partial memory download e Gener
248. t defined Invalid command code or illegal CCU Task Code 5 56 57 5 5 d 5B s 5 E SF c ei 65 L or C in ROM attempt to download to ROM s 68 MM is incorrect for downloading Non ASCII character in input buffer sa Download active other commands invalid 6C Upload active other commands invalid 6D Invalid upload sequence GE MM is incorrect for upload 6F CCU put non ASCII characters in output buffer TIWAY Host Software for PC User Manual Eror Listings E13 E 9 Facility 9 Native Task Codes Because these error messages are specific to the type of attached device being used Facility 9 errors are returned with a message number but no text You can determine the error by referring to the documentation on the attached device you are using Facility 9 includes more than just native task code errors These are machine specific and for information regarding their meaning please refer to the appropriate user manual for the machine in question i amp SIMATIC 530 PM550 etc E 14 Error Listings TIWAY Host Software for PC User Manual F1 General Information enn nn F 2 Pascal ecos rs F 3 BASIC io copo ie nr ta aden TENE ea FA pop E5 Foran is essaie ick a F 6 Linking Programs with the TIWAY Subroutine Library Appendix F Programmer s Notesfor PC F7 Using Upload and Download from an Applications Program eeeeeee TIWAY Host Software for PC User Manual Programmer s Not
249. t either by searching the tag table by converting the specification directly or by a combination of the two See Declaration for tag typein Figure 3 1 nnnn The nnnn argument defines the number of data element locations to read rsplen The response buffer length argument defines the maximum length of the response buffer in bytes when it is returned it contains the actual length of the response The response buffer length is the product of the number of bytes of converted data per element times the number of data element locations Example tag specifies V memory each element is two bytes long nnnn 16 sixteen elements requested rsplen 32 thirty two bytes are returned 11135 The read buffer contains the data returned by the Secondary Allocate the buffer in the same variable type as either the converted data or be made equivalent to data of the variable type 10 48 Subroutine Library TIWAY Host Software for PC User Manual stat The Secondary status argument contains the code for the current state of a specific NI M based attached device Current state means the state the device is in when the response to the subroutine call is returned Current state is returned for all attached devices except Series 500 NIMs Release 1 1 and earlier For these Series 500 NIMs the state that is returned is the state that existed before the subroutine call was issued Table 3 7 shows the seven possible values Related Calls TheTI
250. t for model type 36 CCU not in startup or remote mode cannot continue 37 CCU not in startup or remote mode cannot continue download 38 Secondary must bein non execution state Inconsistent memory sizes Invalid memory type specified for 5TI Invalid primitive status from buffered write TIWAY Host Software for PC User Manual Error Listings E 3 Facility 1 TIWAY Subroutine Library Exceptions continued Table E 1 Facility 1 TIWAY Intemal to TIWAY Subroutine Library Errors continued Description Transfer between requested Secondaries not allowed Device does not support generic upload Device does not support generic download Error in initial generic upload request Error in initial generic download request Invalid upload request Invalid download request M emory type not configured for this device Requested record type not found in upload file Error in creating CIM permanent file Device does not support partial upload Device does not support partial download No segment specified for specific transfer WARNING Not all specified segments transferred 4E Error reading specific segment transfer file 4F Device does not support specific segment upload 50 Device does not support specific segment download 51 Device rejected specific segment download request 52 Device rejected generic download request 53 Data not ready for generic upload request 60 Invalidnumberofconfigoptions a 6
251. t names are unimportant You can always create your own variable names when dedaring arguments for the TI WAY Subroutine Library The length of the data buffers is also unimportant as long as the buffers are large enough to hold the data received from or sent to the TIWAY subroutines For example you can use either the ri4 argument or the 11135 argument depending on how much data is expected To preserve storage you may want to have two large buffers allocated for all TI WAY subroutine calls rather than having several arrays of different lengths The TIWAY Subroutine Library is written in assembly language so there is no problem with types The TIWAY Subroutine Library does not know the difference between integer and character arrays and so passes the data in the same manner regardless of how the buffer is declared in the program The S BARY 275 was introduced for strongl y typed languages so that you could use the same array for storing real integer and byte data The S BARY 275 type can be used to replace any type that requires 275 bytes You can also declare your own similar types of varying lengths Remember when any type is used in an external subroutine declaration you must usea variable declared of this type in all calls to that subroutine TIWAY Host Software for PC User Manual Programmer s Notes for PC F3 General Information continued F4 Usersplen and rilen arguments for response buffer lengths These arguments must be in
252. ta acquisition block Tag specifier 40102020001 Number of data elements decimal 10 Defining the third data acquisition block Tag specifier 40102010064 Number of data elements decimal 2 MSB is block 16 LSB is block 1 Mask of data acquisition blocks hex four digits 0007 01 02 03 04 05 06 07 08 09 0A 00 00 00 00 00 00 00 00 00 00 E 0 C8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 TIWAY Host Software for PC User Manual Interactive Operator Utilities 7 35 TIPROG Utility continued 7 36 R4 Command TheR4 command the equivalent of the RNDRD4 subroutine performs two functions it writes to a set of sequential memory locations and also gathers data from one or more data acquisition blocks specified by a mask valid for PM550s only TIPROG gt R4 Tag specifier 40102010001 Number of data elements decimal Data element 1 hex 1 Data element 2 s2 Data element 3 3 Data element 4 4 Data element 5 5 Data element 6 6 Data element 7 27 Data element 8 8 Data element 9 hex 9 Data element 10 hex 1 Data element 11 hex 1 Data element 12 l Data element 13 El Data element 14 1 Data element 15 sl Data element 16 1 Data element 17 tI Data element 18 e Data element 19 Data element 20 hex e MSB is block 16 LSB is block 1 10 Mask of data acquisition blocks hex four digits 0007 01 00 02 00
253. ta lla tion The following paragraphs supply the information necessary to enable you to link your application programs tothe TIWAY subroutine libraries and to usethe features provided by the TI WAY utility packages This information should enable you to link your application with the TI WAY Host Software package to run under the MS DOS operating system Each of the computer languages listed earlier with the exception of Interpreted BASIC has a compiler program which must be executed and provided an ASCII source code file to produce an object code file This object code file can then be combined with other object code files to produce an executable machine code file The process of combining object files from one computer language with object files and or subroutines from subroutine libraries in another computer language is called linking However two languages are not necessarily involved object files and subroutines in the same language can also be linked Linking on the PC is accomplished with the MS DOS LINK command or thelinker supplied with your compiler There are three different formats of theLink command e Thefirst format is the easiest to use if you are a beginning programmer Simply type LINK into the computer and respond to the four prompts The first prompt asks for the object files The second prompt asks for the run files Thethird prompt asks for the list file The fourth prompt asks for the library files
254. te status 00 Secondary in remote mode 01 Secondary in local mode NOTE Not available for all Secondaries TIWAY Host Software for PC User Manual Subroutine Library 10 39 10 30 RNDRD1 The RNDRDI1 subroutine defines a data acquisition block in a PM550 The data acquisition block can then be activated to gather the specified data using an RNDRD2 RNDRD3 or RNDRD4 subroutine NOTE Unlikethe NIM DEFBLK subroutine any new definition starts with the first block and all blocks defined after the first are numbered sequentially from that number Call Format BASIC and CALL TIWAY RNDRD istat xtn tag nblk taglst nnlst FORTRAN CALL RNDRD istat xtn tag nblk taglst nnlst Pascal TIWAY RNDRD1 istat xtn tag nblk taglst nnlst RNDRD istat xtn tag nblk taglst nnlst C tiway rndrd1 amp istat amp xtn amp tag amp nblk amp taglst amp nnlst rndrd1 amp istat amp xtn amp tag amp nblk amp taglst amp nnlst Notes on Call Explanations of the terms used in the call format follow Format istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion tag Theshort form of the address highway and Secondary can be used nblk The number of blocks nblk argument specifies how many data acquisition blocks are to be defined The
255. th BASIC Rather than give only the name of the array as in FORTRAN in BASIC the first data location in the array must also be provided This has the advantage of allowing you to begin passing data from anywhere in the array but care must be taken to prevent overrunning the dimension of the array The following statement is an example of how arrays are passed to the TI WAY subroutines CALL TIPUT ISTAT XTN TAGS NNNN WI135 0 SSTAT NOTE BASIC does not allow the passing of data constants or expressions to a subroutine Only named variables and arrays can be passed If a constant is to be passed a variable with the constant s value must be created Since BASIC uses dynamic memory allocation for variables all variables must be defined by initialization including those that are used for the subroutine calls such as SSTAT before the subroutine call is made It is sufficient to define these variables by setting them to 0 Character type variables such as tags and the naming of subroutines within a call to TI WAY are also handled somewhat differently These must be declared as STRING variables Their length is also important for when using a string variable as an ASCII tag thelength of the variable must be 11 characters If it is a short tag spaces must be added to fill it out Thisis also true for variables used to name subroutines when calling TI WAY the length must be 6 characters TIWAY Host Software for PC User Manual Install
256. ties 7 23 TIPROG Utility continued PO Command The poll command solicits a response from a single specified Secondary to the most recent broadcast command that Secondary has received The TH command is useful in processing the results of the poll command The PO command is the implementation of command code 03 Prompt TIPROG gt PO Tag specifier 0102 Response Response buffer 38 bytes received 03 02 00 22 20 00 AA BB BC DE CD EF 07 08 09 0A OB OC OD OE OF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 TIPROG gt SD Command The Secondary diagnostics command the equivalent of the RSDIAG subroutine returns a Secondary diagnostics list collected by the Host Adapter that contains data about the Secondary s network usage and errors The SD command is the implementation of command code 07 Prompt TIPROG gt SD Tag specifier 0102 Secondary diagnostics decimal Number of polls 25 frames transmitted Timeouts frames received frames re transmitted Received errors Transmit errors A O OOMOO Secondary initialization TIPROG gt 7 24 Interactive Operator Utilities TIWAY Host Software for PC User Manual SL Command The Secondary log command the equivalent of the SECLOG subroutine returns a list of the Secondaries logically connected to the specified highway when the request is issued The SL command is the implementation of command code 06 Prompt TIPROG gt SL Response List of connected Secondaries 1
257. tion Inc MS DOS MS FORTRAN and Microsoft C are trademarks of Microsoft Corporation IBM IBM PC AT and IBM PC XT are registered trademarks of International Business Machines Tl Texas Instruments and TIPC are trademarks of Texas Instruments Incorporated
258. tions programmer with a natural interface to each primitive The arguments correspond directly either to information required to build the request buffer or to data returned in the response to the request All TI WAY primitive subroutines except for GETLEN and GETCON subroutines include the status of the destination Secondary in the response sstat argument The TI WAY primitive subroutines are shown in Table 4 2 Values in the Primitive column are given in hex Table 4 2 TIWAY Primitive Subroutines Changes operational state of a Secondary Reads memory configuration of the specified Secondary DEFBLK 50 Defi nes data to be returned from one or more data acquisition blocks 32 Fills consecutive section of memory in attached device 51 Gathers data from previously defined data acquisition blocks EM Gets the maximum primitive length and the maximum 02 20 30 20 number of data acquisition blocks supported by the specified attached device NATIVE 01 Bypasses the normal primitive processing and sends a native Task Code directly to the attached device 00 Reads status of a specified NIM based attached device Reads consecutive memory locations from an attached device and converts data from 500 505 to host format Writes consecutive memory locations to an attached device and converts data from host to 500 505 format Reads consecutive memory locations from an attached TIREAD device 500 505 format Writes consecutive
259. tions of the TIWRIT and GATHER subroutines It writes consecutive memory locations in a specific NIM based attached device and then gathers data The data are sent and returned in the 500 505 format WRTGAT is the implementation of Primitive 52 TIWAY Host Software for PC User Manual TIWAY Interface Subroutines Topical 415 4 6 CIM Functional Command Subroutines Each CIM Functional Command Subroutine corresponds to a CI M Functional Command The intent is to provide the applications programmer with a natural interface to the Functional Command The arguments correspond either to information required to build the request buffer or to data returned in the response These subroutines can only be used on PM550 controllers using the CIM network interface Table 4 3 shows the CIM Functional Command subroutines All CIM Functional Command subroutines use Host Adapter Command Code 01 Before attempting to use these subroutines become familiar with the F unctional Commands used Refer tothe CIM User Guide for more information The CIM Functional Command subroutines are only supported when the Unilink Host Adapter is in the EHA mode NOTE All CIM functional command subroutines use host adapter command code 01 Before attempting to use these subroutines you should be familiar with the functional commands you intend to use Refer to the CIM User Guidefor more information ThelNIT subroutine must be called before any other subroutine can be executed
260. to the Unilink Host Adapter you must follow these steps 1 Issue a dummy command such as command code 21 to the Unilink Host Adapter using the BDLC host protocol because the first response following a UHA reset returns 2 Reconfigure the Unilink Host Adapter 3 Reconnect all Secondary devices 4 Reallocate all Source Ds 5 Redefine all macros 10 60 Subroutine Library TIWAY Host Software for PC User Manual Call Format BASIC and CALL TIWAY XPAR istat xtn hwy cmdlen cmd275 rsplen rsp275 errtyp FORTRAN CALL XPAR istat xtn hwy cmdlen cmd275 rsplen rsp275 errtyp Pascal TIWAY xpar istat xtn hwy cmdlen cmd275 rsplen rsp275 errtyp XPAR istat xtn hwy cmdlen cmd275 rsplen rsp275 errtyp C TIWAY xpar amp istat amp xtn amp hwy amp cmdlen cmd275 amp rsplen amp rsp275 amp errtyp xpar amp istat amp xtn amp hwy amp cmdlen cmd275 amp rsplen amp rsp275 amp errtyp Notes on Call Explanations of the terms used in the call format follow Format istat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion hwy Thehwy argument specifies the highway to use for processing the command cmdlen The cmdlen argument specifies the length of the command buffer cmd275 Thecmd275 argument contains a
261. transaction number must be zero portstr Portstr is used to select and initialize the appropriate communications port This must be an ASCII string specifying the port number baud rate number of data bits number of stop bits parity number of retries and length of time out in hex The following is an example of a port set up string P1 19200 7 1 E 3 A This string specifies port 1 19200 baud 7 data bits and 1 stop bit standard for the host adapter even parity 3 retries and a time out of 10 hex A seconds per try The maximum time out period is 15 seconds The port set up string must be fully specified in order for the TI WAY host package to communicate with the network TIWAY Host Software for PC User Manual TIWAY Interface Subroutines Topical 4 7 4 4 Host Adapter Command Code Subroutines Each Host Adapter Command Code subroutine corresponds to a Host Adapter Command Code The intent is to provide the application programmer with a natural interface to the command codes The arguments correspond directly to information required to build the request buffer or data returned by the host adapter in the response to the request F or additional information on Host Adapter Command Codes seethe SIMATIC TIWAY Unilink Host Adapter User Manual PPX TIWAY 8121 x Five Host Adapter Command Codes are not represented by these subroutines commands 01 FC FD FE and FF Response code 00 is returned with error responses and
262. ts the syntax and argument detail for each subroutine availablein the TIWAY Host Software Package The subroutines are listed in alphabetical order The overview information on using these subroutines is presented in Chapters 4 and 5 NOTE Chapter 3 describes all calling arguments used in the TI WAY Interface Subroutines the subroutines contained in Chapter 4 However the TIWAY Support Routines described in Chapter 5 use arguments that do not occur in the Interface Subroutines Therefore the arguments used in the Support Subroutines are defined in the Notes on Call Format section in this Chapter TIWAY Host Software for PC User Manual Subroutine Library 10 3 10 1 ACTVAT Call Format Notes on Call Format Related Calls 10 4 Subroutine Library Before any communication is allowed with a Secondary the Secondary must be logically connected to the network which is done using the ACT VAT subroutine After the Secondary has been connected the host computer can communicate freely with it If a Secondary is connected to the highway when the call is issued it can be included in wi4 and is listed as successfully connected ACTVAT is theimplementation of command code 04 BASIC and CALL TIWAY ACTVAT istat xtn hwy wilen wi4 rilen ri4 FORTRAN CALL ACTVAT istat xtn hwy wilen wi4 rilen ri4 Pascal C TIWAY ACTVAT istat xtn hwy wilen wi4 rilen ri4 ACTVAT istat xtn hwy wilen wi4 rilen ri4
263. tt aaaa aaaa comments where nn nn is the symbolic tag name hh isthe highway ss is the Secondary address tt is the data type to be accessed optional aa is the data address to be accessed optional H ex Either the short form or the long form of the tag may be configured Either extended or non extended addressing may be used The tag name may be up to 12 characters in length Either upper or lower case hexadecimal characters may be used in specifying the remaining fields The tag name may be separated from the hh field by an alphanumeric character The remaining fields may be delimited by any character other than lower case a f f extended addressing is chosen the extra two bytes in the address field aa must be used 8 2 Tag Table TIWAY Host Software for PC User Manual 82 Building the Tag Table Once constructed the tag table must be converted from the editable text file version to a binary version that can be used by the TI WAY library or TIPROG and TIUSER interactive utilities This is done by executing the tag table builder This procedure can either be automatically run upon system startup by inserting the line cA TIWY6911 tag into your AUTOEXEC BAT file or by executing the DOS command CA TIWY 69111 tag Figure 8 1 shows a sample tag table Tag table definitions NOTE Fields in the tag table must be separated by tabs not spaces 000C Length of a tag name FILENAME T
264. twork management functions and can be used to simplify procedures such as connecting or disconnecting Secondaries from the network e TIPROG Section 7 3 provides an interactive programmer interface to all TIWAY library subroutines Its primary use is as a learning tool that allows you to become familiar with the software package It is also useful in testing your applications before coding them e You can type HELP within TIUSER or HE within TIPROG at the utility prompt to receive a listing of all options in that utility e The lt RETURN gt key is used to carry out the command or display the next command prompt e CTRLZZ exits the command and returns you to the utility prompt e InTIPROG you must issue the initialize command IN before any other subroutine can be used NOTE In TIUSER you are prompted to Enter Port Setup String when you request the TIUSER utility Enter a port baud rate data bits stop bit even or odd parity retry count and timeout for example P1 19200 7 1 E 3 A In TIPROG you must issue the initialize command IN before any other subroutine can be used For more information on any of these commands refer to the detailed corresponding subroutine descriptions given in Chapter 10 and tothe appropriate manuals listed in the Preface 7 2 Interactive Operator Utilities TIWAY Host Software for PC User Manual 7 2 TIUSER Utility Table 7 2 shows the ten functions that the TIUSER utility provides Thi
265. ual Number PPX TIWAY 8108 3 Refer to this history in all correspondence and or discussion about this manual Event Date Description Original Issue 08 85 Original Issue 2494061 0001 Second Edition 04 86 Second Edition 2494061 0002 Third Edition 05 96 Third Edition 2804790 0001 combined 2494061 and 2601431 texts into one manual LIST OF EFFECTIVE PAGES Pages Description Cover Copyright Third History Effective Pages Third iii xvi Third 1 1 1 26 Third 2 1 2 5 Third 3 1 3 30 Third 4 1 4 17 Third 5 1 5 5 Third 6 1 6 33 Third 7 1 7 39 Third 8 1 8 3 Third 9 1 9 8 Third 10 1 10 61 Third A 1 A 2 Third B 1 Third C 1 C 4 Third D 1 D 16 Third E 1 E 14 Third F 1 F 10 Third G 1 G 5 Third H 1 H 2 Third Index 1 Index4 Third Registration Third Pages Description Contents Preface Chapter1 Installation 1 1 12 13 1 4 1 5 1 6 1 7 1 8 OVEIVICW PEEE cn Background Requirements 0c cect eese Hardware Requirements sssssssssssee eee een Software Requirements sisas setanina iaiia RR ARA cet aa a UR eed Rea doe dos CustorierSuppolt sees te needing eed dd eO De CERO e doa Peter ed alaska aes PC Software Package Files 0coooccccccccc nnne Operation a oni edat den son et oe RU va B Da e a ee ia Software Installation and Operation ccc cece cece eee eee nnne B
266. ure is intended as a backup function for Secondary programs DNLOAD The DNLOAD subroutine is used to download a previously uploaded file to a Secondary Upload When using the upload function keep the following guidelines in mind e Uploads are made from many Secondaries regardless of state or mode However because the upload function utilizes native task codes Series 500 505 NIMs must bein the remote mode prior to the upload request in order for the upload to be performed properly e TheUPLOAD routine terminates on any network error except 8003 which means a particular memory type does not exist in the Secondary For example if an upload is requested and no K memory is programmed the network returns an error tothe UPLOAD routine signifying such however the routine ignores this particular error and continue uploading e TheUPLOAD routine is designed to support future products but that support is limited to generic uploads That is UPLOAD permits an upload attempt from an unrecognized device type However only a generic upload is attempted If the device does not support generic uploads then an error condition occurs e lfaspedfic segment upload has been requested through the TIUSER UPLOAD command an attempt is made to upload all requested segments If an error occurs while uploading a segment an error message appears and an attempt is made to upload the next segment e lfaspedfic segment upload has been requested through the
267. urn the actual string length is passed back in rsplen Declaration integer in bytes str128 GETMSG is called with an 128 character string initialized to blanks This string is returned with the error message text Declaration string128 TIWAY Host Software for PC User Manual 10 20 HSTZT Call Format Notes on Call Format Related Calls The HST2TI subroutine converts data from host format to 500 505 format The subroutine can convert from one buffer into another or the same buffer can be specified for both source and destination BASIC and CALL TIWAY HST2T istat xtn tt nnnn hstbuf tibuf FORTRAN CALL HST2TI istat xtn tt nnnn hstbuf tibuf Pascal TIWAY HST2TP istat xtn tt nnnn hstbuf tibuf HST2TI istat xtn tt nnnn hstbuf tibuf G tiway hst2ti amp istat amp xtn amp tt amp nnnn amp hstbuf tibuf hst2ti amp istat amp xtn amp tt amp nnnn amp hstbuf tibuf Explanations of the terms used in the call format follow istat Error codes arereturned in the status field Declaration integer xn Thetransaction number must be zero Declaration integer tt The read only tt argument is the data element type only low byte significant Declaration integer nnnn The read write nnnn argument is the number of data elements to convert Declaration integer hstbuf The read only host buffer argument is the source buffer host format Declaration byte array F
268. use this routine without thoroughly understanding how it might impact operations directed by the controller The CONFIG subroutine returns the configuration memory sizes of the specified NIM based attached device CONFIG is the implementation of Primitive 03 The DEFBLK subroutine is used to define controller memory locations See the applicable NIM user manuals for a complete description of the data acquisition primitives DEFBLK istheimplementation of Primitive 50 TheFILL subroutine is used to fill a number of contiguous data elements starting at a specified address FILL is the implementation of Primitive 32 The GATHER subroutine is used to gather data from previously defined data acquisition blocks see the DEFBLK subroutine The GATHER subroutine returns the data in the 500 505 data format Notice that data from multiple blocks can be returned in the same call so multiple data formats may be returned in the same buffer GATHER isthe implementation of Primitive 51 TIWAY Host Software for PC User Manual TIWAY Interface Subroutines Topical 413 GETLEN The GETLEN subroutine obtains and displays the maxi mum primitive length and the maximum number of data acquisition blocks supported by the specified Secondary GETLEN is the implementation of Primitive 04 NOTE GETLEN istheonly TIWAY Primitive routine that does not have a Secondary status sstat argument NATIVE TheNATIVE subroutine allows you to bypass the normal primitive
269. utine Library ROTOR AO o ADAG M T io o BRDC ST Ao o i2 sidonia A CHING ooo A EE CIMRD eee Cj A E A A A EEN js P E E E E O E E A A T E DEACT Ke A 10 13 Contents vii 10 14 10 15 10 16 10 17 10 18 10 19 10 20 10 21 10 22 10 23 10 24 10 25 10 26 10 27 10 28 10 29 10 30 10 31 10 32 10 33 10 34 10 35 10 36 10 37 10 38 10 39 10 40 viii o v MMC GAMER T cili pe nj T IIT A fonas barg ernir SEPERTI og Ra Rama EEE ERNE Tir RE n DW E PAPER RI REE A ne s dde FRENCH POU jj m AAA o gt so ooo II cron tuit tete DDR en Pone e ETC o ee PEREPERE ee LR eee l o PMNMUT aca TH eTETEM ECOG RC E E A on GEN y OOO e AP e ete 10 48 A PA READ P C Contents 10 41 10 42 10 43 10 44 10 45 Appendix A Host AdapterCommand Codes esee eee A 1 AppendixB TWAY Primitives cae wee A eae is Bal Appendix C CIM Functional Command Codes Appendix D PM550 CCU Task Codes seeeseeeseeeeeeesees e
270. utine is intended to be immediately followed by the POLL routine Calling another TI WAY routine after BRDCST and before POLL causes an invalid response i e the Secondary attempts to answer the new routine as if it were responding to the POLL request When using BRDCAST and POLL through a UHA refer tothe SIMATIC Unilink Host Adapter User Manual PPX TIWAY 8121 x for the implementation of these commands for your specific UH A mode BASIC and CALL TIWAY BRDCST istat xtn hwy cmdlen cmd275 FORTRAN CALL BRDCST istat xtn hwy cmdlen cmd275 Pascal TIWAY BRDCST istat xtn hwy cmdlen cmd275 BRDCST istat xtn hwy cmdlen cmd275 C tiway brdcst amp istat amp xtn amp hwy amp cmdlen cmd275 brdcst amp istat amp xtn amp hwy amp cmdlen cmd275 TIWAY Host Software for PC User Manual Notes on Call Explanations of the terms used in the call format follow Format itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asynchronous xtn 1 completion hwy Specifies the logical highway number which is used to communicate to the device setup for communications For the PC version of the TIWAY package hwy is always set to 1 cmdlen The cmdlen argument specifies the length of the command buffer cmd275 Thecmd275 argument contains a command consisting of
271. variable and can be specified with the constant zero in the argument list If a subroutine is called with a transaction number of 1 only the first half of the subroutine is executed before control returns to the programmer The transaction number is overwritten with a new number identifying that transaction and a copy of the first half argument list is kept by the TI WAY library To receive the results from the I O the second half the TI XTN or TIXTNW subroutine must be called Either of these subroutines is called with an istat and the transaction number that was returned from the first half The results from the I O in the second half are returned through the copy of the first half argument list that is no arguments to return data are required by the TI XTN or TIXTNW entry points The only difference between the TIXTN and TIXTNW subroutines occurs when the I O has not completed when they are called The TIXTN subroutine returns immediately with a status of FIRST HALF NOT FINISHED YET facility 1 message 10 hex and you should call it back later The TIXTNW subroutine waits for the I O to complete before returning i e never returns with the FIRST HALF NOTFINISHED YET error BASIC and CALL TIWAY TIXTN istat xtn CALL TIWAY TIXTNW P istat xtn FORTRAN CALL TIXTN istat xtn CALL TIXTNW istat xtn Pascal TIWAY TIXTN istat xtn TIWAY TIXTNW istat xtn TIXTN istat xtn TIXTNW istat xtn C tiway tixtn
272. was issued Table 3 7 shows the seven possible values Related Calls The DEFBLK subroutine is required to define the data acquisition blocks The data format subroutines HST2TI and TI 2HST see Chapter 5 can be called to perform data format conversions The BLDMSK subroutine can be used to build a mask in non Pascal applications The WRTGAT subroutine combines TIWRIT and GATHER intoa single call 10 26 Subroutine Library TIWAY Host Software for PC User Manual 10 18 GETLEN Call Format Notes on Call Format Related Calls The GETLEN subroutine obtains and displays the maxi mum Primitive length and the maximum number of data acquisition blocks supported by the specified Secondary Primitive 04 NOTE GETLEN and GETCON are the only TI WAY Primitive routines that do not have a Secondary status sstat argument BASIC and CALL TIWAY GETLEN istat xtn tag primlen nblks FORTRAN CALL GETLEN istat xtn tag primlen nblks Pascal TIWAY GETLEN istat xtn tag primlen nblks GETLEN istat xtn tag primlen nblks C tiway getlen amp istat amp xtn amp tag amp primlen amp nblks getlen amp istat amp xtn amp tag amp primlen amp nblks Explanations of the terms used in the call format follow itat Status which indicates successful completion of function or error message indicating what problem occurred See Section 3 11 Status Determination xn Specifies synchronous xtn 0 or asyn
Download Pdf Manuals
Related Search
Related Contents
照明器具 安全に関するご注意 照明器具 Singer 9980 Manuale Micro-Smart.indd 138 KB - ComBlock Karcher K 3.97M User's Manual User`s Manual - MikeBlaber.org V7 2GB DDR3 1333MHz PC3-10600 DIMM Desktop Memory Quick Start User Guide Whirlpool EC5100 User's Manual Téléchargez Loir-et-Cher info n° 82 en pdf Copyright © All rights reserved.
Failed to retrieve file