VXWORKS DRIVER of INTERAY IP- PROFI and MANUAL for EPICS USERS

Cai Mingfu
DESY-MKS 2
September 1996

  • CONFIGURE YOUR PROFIBUS CLIENT STATION
  • EPICS CDI DEVICE SUPPORT FOR H1/PROFIBUS
  • CREATE EPICS RECORDS
  • Some Common Errors and Error Messages of Profibus
  • COMMUNICATION SPEED TEST REPORT
  • READ ME FIRST

    INTRODUCTION:

    This VxWorks PROFI Driver is a VxWorks version Profibus level 7 driver for accessing various objects of Profibus devices through the INTERAY IP-PROFI module, a PROFIBUS interface of IP module type. And this driver can be used by any VxWorks users or EPICS user through our CDI (Common Device Interface) [1]. The type of Profibus objects can be "simple variables" with data type integer 8/16/32 and float at this moment.

    This manual shortly introduces the INTERAY IP-PROFI controller and the VxWorks version driver for it. Describe the principle of the PROFI CDI Driver and hints for its VxWorks user and EPICS user.

    If you want add some new objects to an existing station, need only add more records to your EPICS database file.

    If you want add some new station to an existing Profibus system, modify the file crl.txt (section 6.2.2 Communication Relationship List).

    If you want change the baud rate of the physical layer or IP slot to install the IP-PROFI module, modify the start-up script file "startup_link" (section 6.3 Modify the Configuration of Your Client Station).

    If you need change local station address, you need modify the startup script file and crl.txt.

    IP-PROFI AND RAPI:

    The IP-PROFI is an intelligent Profibus controller based on the Industry Pack's concept. It uses the MC68302 Integrated Multi Processor from Motorola. It provides an EIA standards RS-485 physical link with opto isolation.

    This module is equipped with INTERAY RAPI (Registered Application Interface firmware). With the RAPI firmware the module functions as a buffered Profibus network controller, where there is direct access to the Profibus network with some special features such as on-module error handling and Profibus message receive and transmit fifo's.

    For Profibus Level 7 this IP module is only used as a transport layer (FDL and LLI), the Level 7 functions (FMS and FMA7) are implemented by the software package which runs on the host computer (see section 4.0). A software interface between the RAPI and level 7 functions is provided and has only three simple functions: init_profibus, profi_snd_req_res and profi_rcv_con_ind. (See next section)

    This RAPI of IP-PROFI builds up two virtual devices (register sets) in shared memory for Profibus bi-direction data communication, one is Transmit-device PROFI_L7_TDEV (tdev) and another is Receive-device PROFI_L7_RDEV (rdev). As described, they can work in a buffered ( RAPI_FIFO) and interrupt mode (RAPI_IRQ). Here the tdev is configured as NO-FIFO mode and NO-INTERRUPT mode and the rdev is FIFO mode and polling mode (NO-INTERRUPT. Interrupt mode is not available for the current version.).

    As rapi devices, they both use the shared memory (dual port memory) so that accessing any of the two virtual devices by user applications must be exclusive. For example, there are four logical Profibus communication links (CRL). Each link has a spawned task to send out read/write requests and to deal with confirmation back from Profibus partners. They will use the same RAPI device tdev/rdev for send/receive. To avoid conflict of using the tdev here using of a semaphore is a solution.

    The IP-PROFI is an IP class 1 module, which can be installed in one of the four IP slots on CPU board MVME162 or a VMEbus IP carrier board such as BVME61. To link with the Profibus you need a Profibus connector and a 5V power supply for opto isolated transceiver on the IP module. One solution is to make a customized VME board using the VMEbus power supply with a DC-DC converter. Our home made VME board is shown on APPENDIX A. And the Profibus SUBD-9 connector pinouts is shown on APPENDIX B.

    IP-PROFI APPLICATION-COMMUNICATION INTERFACE (ACI):

    The ACI is a software interface between the RAPI and level 7 functions is and has only three simple functions: init_profibus, profi_snd_req_res and profi_rcv_con_ind.

    The init_profibus function is used to reset the IP-PROFI Profibus controller board and to initialize the RAPI interface, search PROFI_L7_TDEV and PROFI_L7_RDEV and modify attributes of them (e.g. RAPI_TFIFO).

    The profi_snd_req_res function is for sending FMS requests and responses. The profi_rcv_con_ind function can be used for polling FMS confirmations and indications. Both of them use RAPI interface (tdev and rdev) to communicate with Profibus partners.

    Applications, which are waiting for confirmations to their requests, have to call the receive function to polling the RAPI receive buffer (rdev) periodically. Because of the polling mode of rdev they must suspend themselves for a while if no confirmation received yet.

    FMA7 and FMS SERVICE LIBRARY:

    The FMA7 and FMS service library in this package contains the most important functions of Profibus level7 protocol. And many Profibus devices support only some basic simple functions such Get-OD in short format, Get-OD/Variable Access by index, e.g. SINEC (CP 5431 FMS, CPLL 928). If you need some services which are not found here in this library you should create them by yourselves.

    Available FMS & FMA functions in this library are following:

    	fma7_event_ind();
    
         	fma7_profi_exit();
    
         	fms_initiate_req();
    
         	fms_initiate_cnf();
    
         	fms_initiate_ind();
    
         	fms_vfd_identify_req();
    
         	fms_vfd_identify_cnf();
    
         	fms_vfd_identify_ind();
    
         	fms_abort_ind();
    
         	fms_reject_ind();
    
         	fms_getov_req();
    
         	getovCnf();
    
         	fms_getov_ind();
    
         	fms_read_req();
    
         	readCnf();
    
         	fms_read_ind();
    
         	fms_write_req();
    
         	writeCnf();
    
         	fms_write_ind(); 
    
         	fms_status_req();
    
    
    fms_status_cnf ();

    PROFIBUS CDI SERVER:

    WHAT is CDI?:

    CDI (Common Driver Interface) is a DESY defined software interface between a number of hardware dependent device driver and different applications (users). Using CDI user will have a uniform software interface to access different device such as CANbus, SEDAC, H1 and Profibus devices.

    CDI contains two parts, CDI servers and CDI users.

    CDI server is a hardware dependent device driver, which waits for CDI commands from CDI users and executes these commands for data communication.

    CDI user can be EPICS or any vxWorks applications. The most basic commands sent to the CDI server are REGIST, READ and WRITE. The most basic CDI functions are CDI_OPEN, CDI_CLOSE, CDI_IO and CDI_FAST_IO.

    CDI supports multi-users and multi-cpus.

    For details about CDI please read document "CDI Common Driver Interface User Reference Manual".

    PROFIBUS CDI SERVER:

    Profibus CDI server is a Profibus device driver, which supports CDI protocols and Profibus level 7 protocol.

    Features:

    To access an profibus object (variable) the driver needs to know (1) over which logical connection (cr) (2) variable index and its descriptions (od/ov).

    To describe an Profibus object (variable) needs a number of parameters, such as variable name, variable index, communication reference number (cr) used, data type (e.g. integer 16/float.), obj_code (e.g. Simple-Variable/Array-Variable.), length and so on.

    The key of profi access is the cr (comm. ref.) and index (variable's index number), which are given in each EPICS database record. And all others can be got from its source station by function get_ov of profi level7 FMS service.

    To support these features there are three kinds of tasks: CDI server task, wait for Profibus confirmation task and send request to Profibus and confirmation handler task.

    CDI server task:

    It is waiting for CDI commands and other message from CDI users using vxWorks semaphore and VMEbus common memory. Here there are three CDI commands used in this server:

    PROFI_CC_REGIST, PROFI_CC_READ, PROFI_CC_WRITE

    Before read/write a Profibus object use PROFI_CC_REGIST command to register a variable during initialization time of EPICS database records or others. All these three commands will be distributed to its service task according to their CR (logical link used) by means of vxWorks message queue mechanism. Each CR has one service task and so one message queue to get command and other message from the main CDI server task. The write operation has a higher priority than the read operation. And all read operations have the same priority. They will be passed in the request-message queue in a FIFO type except the write command.

    Task of Sending Request to Profibus and Handle Confirmation:

    The Profibus level 7 read/write operation is a kind of handshake communication, that is client sends Request - server receives Indication - server answers with Response - and at last the client gets Confirmation. The client should suspend itself when waiting for confirmation from the server to let other tasks have chance to run. And after the Profibus layer 2 becomes active a number of events such as a bus- timeout or station out of ring may be signalled. Therefore any local request should not just await for the confirmation but also need to response to any other possible indications and confirmations.

    So that each profibus logical communication connection has one task to send request to Profibus partner and to handle the correlative confirmation from another end of this connection. It is waiting for CDI commands sent by CDI server task through the request-message queue and waiting for confirmation message sent by the task below through the confirmation-message queue after send out the request. All other in indications or confirmations are handled by the task bellow.

    Task of Wait for Profibus Confirmation and Indication:

    This task is pooling the RAPI receive buffer and checks FMS/FMA7 service.It invokes FMS/FMA7 service routines to handle various indications or confirmations. If the confirmation is to local profi-read or write or get_ov it will call a function sndToRequester to send them to their request task through their individual msgQ (cnfMsgQ).

    The message flow between tasks is as follows:

    CDI user ----> CDI server task ---> reqAndCnfTask   ---> Profibus
    

    CDI user <---- reqAndCnfTask <--- waitForCnfTask <---- Profibus

    CONFIGURE YOUR PROFIBUS CLIENT STATION:

    A Profibus station can be a client and also a data server. Our application for EPICS is only a client. There are no local objects can be read by remote stations or be written like CAN ai/bi. (???)

    The configuration of a Profibus client station, which uses an IP-PROFI module as the Profibus interface, consists of the following actions:

    1. Allocate memory space in system memory of MVME162 for IP-PROFI
    2. Configure MVME162 board's IPIC chip
    3. Initialize and start the Profibus communication interface (IP-PROFI)
    4. Configure the Profibus Client Station
      • Load the Profibus parameter
      • Load the Communication Relationship List (CRL)
      1. Establish all the communication connections defined in CRL
      2. Initialize CDI server and start it
      3. Initialize and start EPICS IOC
      4. Get Object Description Information of all variables over the connections

      Install the Profibus Interface IP-PROFI:

      The IP module can be installed in one of the four IP slots in an IP carrier or the MVME 162 cpu board. Its Local address map of mvme162 is as following:
      	0000,0000 - 007f,ffff	(8 Mb) inboard memory
      
              0080,0000 - efff,ffff   VMEbus Master   (A32/D32)
      
              f000,0000 - f0ff,ffff   F0 page (A24/D16) for BVME61 IP Carrier or IPIC
      
              f0c0, 0000 - f0c7,ffff	(512 Kb) IP_profi a
      
              f0d0, 0000 - f0d7,ffff	512 Kb) IP_profi b
      
              f0e0, 0000 - f0e7,ffff  (512 Kb) IP_profi c
      
      
      f0f0, 0000 - f0f7,ffff (512 Kb) IP_profi d You need check the startup file if the slot number is the same as you installed (see section 6.3).

      The software will initiate the interface and configure it as a Profibus partner.

      The software now is compiled for using 162 as an IP carrier. If you have to use a VME- bus IP carrier board, you need to change the macro CFLAGS to define BVME61 in the "Makefile" under directory ./interay/level7/engkit/ and re-make it.

      If the IP module installed in one of the four IP slots in 162 CPU board, the software will invoke routine IPIC_init_profi() to initialize the chip IPIC according to the slot number and invoke routine VMEchip2_init() to re-initialize the VMEchip2's registers, disable to use the F0 page for VMEbus, which will be used by IPIC for IP_PROFI's memory.

      Configuration of Profibus Client Station:

      Bus Parameters:

      There are a number of bus parameters to be loaded for a Profibus station and they must be set the same for all stations on the bus. The most important bus parameters are BAUDRATE and LOCAL STATION ADDRESS. User can change it in the startup script file for your VME station. And most parameters will choose their value according to the baudrate.

      The baudrate of all communication partners on the same bus must be the same. The available baudrate are 9.6/19.2/93.75/187.5/500 KBaud. And the address of local station must be unique on the same bus. The firmware will check it and you will get a error message if it is conflict with some others. For details please read the SECTION 1 "BUS PARAMETERS" of the manual "PROFIBUS CONFIGURATION PARAMETERS".

      All bus parameters used here* are shown in the table 1.

      TABLE 1. Bus Parameters

      BAUD Rate Slot Time Quiet Time Min. Station Delay Time Max. Station Delay Time Setup Time Target Rotatio n Time Gap Update Factor Max.Retry Limit
      9600 200 0 10 10 2 5000 2 2
      19,200 400 0 10 14 4 9000 2 2
      93,750 744 2 95 140 160 93750 1 2
      187,500 2000 0 10 132 40 2500 20 2
      500,000 4000 0 10 350 55 20000 20 2

      * Now we use baud rate 93750.

      Communication Relationship List (CRL):

      Before access any variable CRL must be loaded in profi initialization time. Local loading of the CRL is accomplished with the following sequence: an Initiate-Load-CRL- Loc, one or more Load-CRL-Loc services and finally a Terminate-Load-CRL-Loc. Note that the protocol software does not check the CRL for correctness or consistency. Loading an incorrect CRL can under certain circumstance lead to a situation where the connection can not be start or restart after the Terminate-Load-CRL call. For an example, you will get an abort indication LLI context check negative from remote station LLI layer if you define CI (Control Interval) with a value different from the one of remote station. Most CRL parameters are defined in a table, which will be read for loading the CRL. At this moment they are in the file ./DATABASE/crl.txt. Following is an example for connect with an Unigyr PLC:
      25	25	24	255	7	0	0	0	32	
      3	1	3	60000	0	220	220	220	220	
      0x58	0x30	0xd8	0	0	0	0	0	0
      

      The meaning of the values - in the same order - are:

      ;CR	LSAP	REMADDR	REMSEGM	DSAP	TYPE	LLI	CONNATT	SCC
      RCC	SAC	RAC	CI	MULT	PDUSH	PDUSL	PDURH	PDURL
      FMS0	FMS1	FMS2	FMS3	FMS4	FMS5	VFD-NO	SYMNAME	EXT
      
      Each connection needs a list like the up one. And all items need to be checked on both sides, local and remote station, carefully.

      Some profibus devices have special relationship between station-address, sap and cr. For example, the device Unigyr from Landis & Gyr Building Control AG uses following algorithm:

      	KR: 2..33; TS = Address of local station;
      
      	LSAP = KR;
      
      	DSAP = TS + 1;
      
      	Rem_ADD = KR -1;
      
      	e.g. Client station	Unigyr station
      
      	station_addr = 6	station_addr = 24
      
      	CR 25:	LSAP = 25	CR 7:	LSAP = 7
      
      	Rem_ADD = 24		Rem_ADD = 6
      
      
      DSAP = 7 DSAP = 25

      Object Dictionary:

      To describe an object needs a number of parameters such as:

      • Index (Logical address of the object)
      • Name of the object
      • Data Type, e.g INTEGER16
      • Object Code, e.g. 7 means Simple Variable Object
      • Length in bytes, e.g. 2

      Most of the object description information can get from its source station by the fms7 function `get_ov' over the bus.

      Get Remote Object Descriptions (OD):

      For a Profibus client, which has no local objects (data source), the remote OD can be got over established connection by the FMS function getov when register it. So normally the client does not need to load OD locally.

      Get OD here can only by index because some devices do not support access_by_name.

      Some Important Parameters of CRL:

      Almost all the parameters of a CRL entry of the client must be compatible with those of its corresponding communication partner.

      • Apparently the Station Address of local and remote ( stationAddr and rem_add), the Service Access Point of local and destination (loc_lsap and rem_lsap) must be set to the value used by the local and remote partner.
      • CI (Control Interval) must be identical for both station. e.g. 500
      • SCC /RCC/SAC/RAC should follow the rule:

      Own SCC <= partner's RCC Own SAC <= partner's RAC

      If partner's RCC=1 and RAC=0 e.g. SIEMENS SINEC (CP 5431 FMS, CPLL 928) means the maximum number of confirmed requests supported by partner is 1 and the partner does not support unconfirmed request. Then own station's SCC must be 1 and SAC=0. The own RCC must be greater than or equal to 1 if your station wants to support FMS/FMA7 indication. The own RAC can be 0 if your station does not support unconfirmed request/indication.

      • Supported FMS Features are described by six bytes FMS0..5. The first three are for client and the others for server.

      If the features supported are set higher than available, you will get Reject Indication, remote or local when you try to use it. For example, Remote station does not support Long Form Get-OD but you set FMS0=0X80. And if you want to be able to WRITE and READ the remote partner the FMS1 must be set to 0x30 and the remote one of course, should support the minimum service. [1]Page 3-11

      These will be checked at connection set-up time (fms INITIATE).

      If CI or SCC or SAC is not correct, you will get ABORT INDICATION, remote LLI context check negative.

      Modify the Configuration of Your Client Station:

      IP Slot Number, Baud Rate, Station Address In the startup file of VME station /applic/test/kryotest/load/startup.irm you can find a function profi_generic_driver("H1_0_B", 0, 1, 160, 2, 6) defined as follows:
      void profi_generic_driver(
      
      	char *name,		/* CDI device name */
      
              USIGN16 role, 		/* 0: client, 1: server */
      
              USIGN16 ip_slot,	/* ip slot number: 0..3 */
      
              USIGN16 Irq, 		/* intVector */
      
              INT16   rate,         	/* 0..4 */
      
      
      USIGN16 stationAddr) /* Profibus station address 0..HSA */ So this station is configured as:
      • CDI device name: "H1_0_B"
      • Client (need not to load OD and VFD)
      • Installed on IP slot 1 (b)
      • Interrupt Vector: 160
      • Baud Rate: 93.75 kB
      • Local Station Address: 6
      • If you want change it just edit this line of the startup file.

      EPICS CDI DEVICE SUPPORT FOR H1/PROFIBUS:

      To access Profibus objects by EPICS uses the same EPICS CDI device support routine for H1 devices. User needs only create a EPICS database file to contain all records he needs. Now it supports following record types:

      Analog In (ai), Analog Out (ao), Long In (li), Long Out (lo)

      The CDI device name for IP-PROFI module is " H1_0_B".

      CREATE EPICS RECORDS:

      For records in your EPICS database file use field bus protocol "Sinec H1", which also supports Profibus.

      The device support routine for H1supports four EPICS record types: ai, ao, longin and longout. The new database should never use again the wi/wo record type, which are DESY exclusive.

      The data type of a Profibus ai/ao object can be FLOAT too, but in this case no conversion will be done because the type of RVAL field is LONG integer and the type of VAL field is DOUBLE. In order to support FLOAT data transfer with PROFI/H1, the device support routine for ai copies return data directly to the VAL field and set NOCONVERT. For ao copies the output data in VAL field to output directly.

      Remarks: present Profibus devices do not support DOUBLE type.

      Following is an example when selected the "SINEC H1" as Device Type ( DTYP):

      Enter Field Bus Info:

      • Line#: 0 ;0/1
      • Channel name: var_sinec0 ;Variable name (v_name)
      • Block/Module #: 23 ;Comm. Ref. (cr/kr)
      • Index/Offset #: 9346 ;var_index
      • length #: 4
      In fact, the most important fields are Block number (comm_ref) and Index number, later on all these information will get from an Oracle database file of one profi station.

      Some Common Errors and Error Messages of Profibus:

      Abort with Initiate Connection:

      	remote station addr.:	1
      
      	remote LSAP:		5
      
      	local LSAP:            	6
      
      	local station addr.:   	6
      
      
      --- local CI (Control Interval) is not identical with remote CI ---
      INITIATE
      
      	0x7b5c40 (demo): Abort Indication	//6.1.2 (FMS context man.) Abort
      
      	0x7b5c40 (demo): local  : 0		// 0:remote
      
      	0x7b5c40 (demo): id      : 2		// LLI
      
      	0x7b5c40 (demo): reason  : 0		// LLI context check neg., remo
      	te context in AD
      
      	--- change rem_lsap of kbl to a not exist one (5->6) ---
      
      INITIATE
      
      	0x7b5c40 (demo): Abort Indication
      
      	0x7b5c40 (demo): local   : 255
      
      	0x7b5c40 (demo): id      : 3
      
      	0x7b5c40 (demo): reason  : 3		//service not activated at 
      	remote sap
      
      	on remote station there is no this sap service
      
      	--- change comm_ref from KR(2) -> 3 (not exist)
      
      INITIATE
      
      	0x7b5c40 (demo): Abort Indication
      
      	0x7b5c40 (demo): local   : 255
      
      	0x7b5c40 (demo): id      : 1	//FMS
      
      	0x7b5c40 (demo): reason  : 1	//user error 
      
      	FMS can not find the comm_ref table.
      
      	--- change rem_add of kbl to 4 (not exist) --
      
      INITIATE
      
      	0x7b5c40 (demo): Abort Indication	//p6-10
      
      	0x7b5c40 (demo): local   : 255		//Local
      
      	0x7b5c40 (demo): id      : 3		//FDL
      
      	0x7b5c40 (demo): reason  : 17		//no reaction from remote
      
      station FMS can not find this station.

      Negative Initiate Confirmation:

      	with wrong PDU size and Supported_features
      
      	---- set buffer size of rcv smaller than snd --- 
      
      	kbl_req.id.kbl_static.max_pdu_snd_low        = (USIGN8) 241;
      
      	kbl_req.id.kbl_static.max_pdu_rcv_low        = (USIGN8) 200; /*MAX_FMS_
      	PDU_SIZE;
      
      INITIATE
      
      	0x7ab9c0 (tShell): Negative initiate confirmation
      
      	0x7ab9c0 (tShell): error class code: 1
      
      The error is different from the error caused by not identical in CI.
      
      	--- set supported_features = 0 0 0
      
      READ VARIABLE 2 times...
      
      	0x79aaf0 (demo): Reject Indication
      
      	0x79aaf0 (demo): local     : 255	//local
      
      	0x79aaf0 (demo): invoke id : 0
      
      	0x79aaf0 (demo): pdu type  : 1	//confirmed request PDU
      
      	0x79aaf0 (demo): reason    : 3	//feature not supported connection 
      	oriented
      
      	--- set supported_features = 0 0x20 0 
      
      	kbl_req.id.kbl_static.max_scc	= (USIGN8)  0;     /*MAX_S
      	CC;*/
      
      	kbl_req.id.kbl_static.max_rcc   = (USIGN8)  1;     /*MAX_RCC;*/
      
      	READ VARIABLE 2 times...
      
      	0x7b5c40 (demo): Reject Indication
      
      	0x7b5c40 (demo): local     : 255
      
      	0x7b5c40 (demo): invoke id : 0
      
      	0x7b5c40 (demo): pdu type  : 1
      
      	0x7b5c40 (demo): reason    : 2		//maximum service overflow
      
      	max_scc = 0 means as a client the number of confirmed_request sent is 0!
      
      	change to 1. (OK!)
      
      	--- negative initiate confirmation when connect to the new profibus 
      
          	station (UNIGYR) ---
      
      INITIATE Communicate Connection (cr: 25)...
      
      	0x7aad88 (tShell):      Negative initiate confirmation. (comm_ref: 25)
      
      	0x7aad88 (tShell): error class code: 1
      
      use vxgdb to check the confirmation package:
      
      (vxgdb) print *init_err_cnf
      
      $5 = {
      
        	class_code = 1, 
      
        	snd_len_h = 220 `\334',
      
        	snd_len_l = 220 `\334', 
      
        	rcv_len_h = 220 `\334', 
      
        	rcv_len_l = 220 `\334',
      
      supported_features = {0,0,0,0x58,0x30,0xd8}
      
      }
      
      modify /applic/test/heravme50/DATABASE/crl.txt and then OK!
      

      The Cable is Disconnected:

      	---- disconnect the profi cable (will cause bus timeout)---
      
      	0x7b5c40 (demo): --- Initiate load kbl...
      
      	0x7b5c40 (demo): FMA7 Event Indication	//7.1.10 FMA7-Event
      
      	0x7b5c40 (demo): comm_ref: 0
      
      	0x7b5c40 (demo): id      : 3	//FDL (layer 2)
      
      	0x7b5c40 (demo): reason  : 3	//timeout on bus detected
      
      INITIATE
      
      	0x7b5c40 (demo): Abort Indication	//p6-10
      
      	0x7b5c40 (demo): local   : 255		//Local
      
      	0x7b5c40 (demo): id      : 3		//FDL
      
      	0x7b5c40 (demo): reason  : 17		//no reaction from remote 
      
      station

      COMMUNICATION SPEED TEST REPORT:

      Test principle:

      Create three EPICS database records: profi_sinec0_li (LongIn), profi_sinec0_calc (Calculation) and profi_sinec0_lo (LongOut).

      The li record reads a word from the profi partner SINEC module and adds one by the calc record and then sends it by the lo record. From the data value increased can find out the operation speed of the system.

      Connect with one more station or use one more CR connection to the same data server station can find out the influence to the speed.

      Use One CR connection with one Profibus partner (SINEC):

      SCAN period: 0.01 sec.
      
      		Test time: 120 sec.
      
                  	li readings: 1160
      
                  	lo writings:  1160		
      
                  	I/O rate: 2*9.65/sec (19.30 /sec)
      
      SCAN period:  0.1 sec. 			
      
      
      I/O rate: 2*9.3 /sec (18.6 /sec)

      Connect with Two stations SINEC1 and tstServer (another IP-PROFI):

      		CR2: profi_sinec0 li+calc+lo
      
      		CR3: svTestint16_ai
      
      Test1: Scan period = 0.1 sec
      
                	CR2 I/O rate: 2 * 8.59 /sec (17.18 /sec)
      
                	CR3 I/O rate: 		10 /sec
      
                	Total:  27.18 /sec
      
      Test 2: CR2: Scan period = 0.01 sec
      
                	CR2 I/O rate: 				2 * 8.92 /sec (17.84 /sec)
      
                	CR3 I/O rate: 		17.87 /sec
      
                	Total:  35.71 /sec
      
      Test 3: Add one variable reading to the cr2
      
      		CR2: + profi_sinec2_ai (0.1 sec)
      
               	CR2 I/O rate: (profi_sinec0 li+calc+lo) 2 * 5.86 /sec (11.72, slower)
      
               	CR3 I/O rate: 				17.58 /sec    (no big change)
      
      Impression: the speed limit of one connection is 20/sec, which is decided by the request--confirmation time. The bottle-neck perhaps is that the RAPI interface uses scan-mode (interrupt mode is not available). The tick length of vxWorks is 1/60 second (16.66 ms).

      READ ME FIRST:

      INFORMATION ON THIS SOFTWARE:

      DRIVER AND SOURCE FILES:

      • PROFI_IP Control Driver /u/mks/cai/interay/level7/engkit/ipcontrol.o
      • RAPI driver, PROFIBUS Application-Communication Interface and FMS / FMA- Functions Library /u/mks/cai/interay/level7/engkit/client7.o
      • PROFI CDI DRIVER and DIAGNOSTIC ROUTINES /u/mks/cai/interay/level7/cdi/profi_cdi_driver.o /u/mks/cai/interay/level7/cdi/profiDiag.o
      • EPICS DEVICE SUPPORT ROUTINE /u/mks/cai/epicsR3.12.2.D/base/src/dev/devH1Sinec.c
      • PROFI DEVICES' CRL CONFIGURE FILE /applic/test/heraVME50/DATABASE/crl.txt
      • CDI LIBRARY /applic/bin/cdi/V4.1/mv162-lc/

      IOC STARTUP SCRIPT FILE:

      	/applic/test/heraVME50/load/startup.profi
      

      EPICS DATABASE FILE:

      	/applic/test/heraVME50/DATABASE/unigyr.database
      

      MODIFICATIONS:

      	CMF 12-09-96
      
      Do not read file "od_entries.txt" to get comm_ref and index information any more.

      These information must be in your EPICS database files or short report files.

      e.g.1 (unigyr.database)

      
      (Field Bus Info)
      
      	Line#            :			0 
      
      	Channel name     :			KL:P1:Frost_Wass 
      
      	Module name/Type :  			P1
      
      	Block/Module #   :			23
      
      	Index/Offset #   :			9346
      
      	length #         :			4 
      
      	e.g.2 (unigyr.report)
      
      	INP  #C0 V"KL:P1:Frost_Wass" M" " N23 I9346 W4 L0 H0
      

      PROBLEMS TO BE FIXED:

      • The maximum number of variables in one PROFIBUS station is limited to 128 because the invoke_id is used as an array pointer of profiDsc[comm_ref] .var_msg[] and memory has been allocated 128 message elements for each profibus station. One reason of limited to 128 is the speed limit of each connection (some stations may have more comm_ref but some not, such as UNIGYR). From the speed section of this paper you will find that if there are 100 channels in one station the average period to read/write a data is about 5 seconds. That means more channels more slower. The variable invoke_id indicates the coming confirmation package is to the channel which has sent the request. Its value is in the range from 0 to 127, defined in the PROFIBUS level7 protocol. And the station, which has requested for data, will find information about this channel from the table profiDsc using comm_ref number and the invoke_id. In principle the invoke_id should be assigned dynamically and 128 is big enough for parallel requests to one data server station. And the request-table profiDsc should be a linked LIST data structure (see lstLib) like the list for EPICS scan task. Be careful if you want to modify it because invoke_id and profiDsc is used in many place and may cause unexpected side effect if any related routine not be modified correctly.
      • The maximum station address is limited to 32 (HSA), which is defined in file interay/level7/engkit/h/profiDrvCons.h. If you need bigger one have to change it and re-build all profi Drivers: ./engkit/client7.o and ./cdi/profi_cdi_ driver.o

      Last update: December 1996
      Barbara Eichhorn