SOFTWARE MANUALOPERATIONRPDP/S10V For WindowsProgrammable ControllerSVE-3-133(A)

First Edition, October 2003, SVE-3-133(A)All Rights Reserved, Copyright 2003, Hitachi, Ltd.The contents of this publication may be revised without prior notice.No part of this publication may be reproduced in any form or by any means without permissionin writing from the publisher.Printed in Japan.BI-NR-HS IC-NS (FL-MW20, AI8.0)

SAFETY PRECAUTIONS Read this manual thoroughly and follow all the safety precautions andinstructions given in this manual before operations such as systemconfiguration and program creation. Keep this manual handy so that you can refer to it any time you want. If you have any question concerning any part of this manual, contact yournearest Hitachi branch office or service engineer. Hitachi will not be responsible for any accident or failure resulting from youroperation in any manner not described in this manual. Hitachi will not be responsible for any accident or failure resulting frommodification of software provided by Hitachi. Hitachi will not be responsible for reliability of software not provided by Hitachi. Make it a rule to back up every file. Any trouble on the file unit, power failureduring file access or incorrect operation may destroy some of the files youhave stored. To prevent data destruction and loss, make file backup a routinetask. Furnish protective circuits externally and make a system design in a way thatensures safety in system operations and provides adequate safeguards toprevent personal injury and death and serious property damage even if theproduct should become faulty or malfunction or if an employed program isdefective. If an emergency stop circuit, interlock circuit, or similar circuit is to beformulated, it must be positioned external to the programmable controller. Ifyou do not observe this precaution, equipment damage or accident may occurwhen the programmable controller becomes defective. Before changing the program, generating a forced output, or performing theRUN, STOP, or like procedure during an operation, thoroughly verify the safetybecause the use of an incorrect procedure may cause equipment damage orother accident.


PREFACEThis manual describes the procedure for creating real-time programs, which run under the S10VCPMS, on an Microsoft Windows 2000 operating system and Microsoft Windows XPoperating system. The table below shows related software manuals.Manual numberSVE-3-201Manual nameCPMS GENERAL DESCRIPTION AND MACROSPECIFICATIONS Note that each of the following terms has a special meaning in this manual:TermMeaningDevelopment machine AZ/R, POC-TX55 or POC-W, HF-W, PADTPCs S10VAbbreviationsRPDP: Realtime Program Developing Package for S10VCPMS: Compact Process Monitor SystemPCs: An acronym for a Programmable Controllers. A generic name of PLCs such as theS10 and S10mini Series products.PLC: An acronym for a Programmable Logic Controller, which is an industrial electronicdevice that has a built-in program and provides sequence control.The S10 and S10mini Series products are also classified as PLCs. This manual consists of two parts: PART 1, “GENERAL DESCRIPTION,” and PART 2,“COMMAND REFERENCE.”PART 1 explains how real-time programs running on the S10V are developed, and alsoprovides general information on commands used in such development. PART 2 serves as areference on the commands used in developing real-time programs to be run on the S10V; itdescribes the functions and options of each command.Appendixes supply notes on the development of real-time programs that run on the S10V, andpresent error messages and formats in which results of command execution are displayed. Trademark Microsoft Windows 2000 operating system and Microsoft Windows XP operatingsystem are registered trademarks of Microsoft Corporation in the United States and/or othercountries.i

Note for storage capacity calculations: Memory capacities and requirements, file size and storage requirements, etc. must becalculated according to the formula 2n. The following examples show the results of suchcalculations by 2n (to the right of the equals signs):1 KB (kilobyte) 1024 bytes1 MB (megabyte) 1,048,576 bytes1 GB (gigabyte) 1,073,741,824 bytes As for disk capacities, they must be calculated using the formula 10n. Listed below are theresults of calculating the above example capacities using 10n in place of 2n:1 KB (kilobyte) 1000 bytes1 MB (megabyte) 10002 bytes1 GB (gigabyte) 10003 bytesii

CONTENTSPART 1GENERAL DESCRIPTIONCHAPTER 11.11.2OVERVIEW.About RPDP.Commands .CHAPTER URE FOR PROGRAM DEVELOPMENT.Entire Flow.Site Environment .Area Management and Area Division in Main Memory.Area Allocation for Tasks .Area Allocation for IRSUBs .Loading Programs and Creating Tasks .Indirect Link Resident Programs.Global (GLB) .Value (VAL) .Indirect Link Global Data .Programming Guide for GLB, VAL and IRSUB .Constraints on CPMS Program Creation .Managing Names .CHAPTER 35.11 - 331 - 341 - 351 - 351 - 351 - 361 - 361 - 37COMPILER . 1 - 384.1 Details of C Compiler Options .4.2 Compiling Precautions .4.2.1 When compiling with shc commands .4.3 Differences between mcc68k and shc .4.3.1 Command line options .4.3.2 Language specification differences .4.3.3 Function call rules .CHAPTER 51-61-61-91 - 101 - 141 - 151 - 161 - 161 - 161 - 161 - 171 - 171 - 261 - 32INSTALLATION AND RPDP EXECUTIONENVIRONMENT . 1 - 333.1 Installation .3.2 RPDP Execution Environment .3.3 RPDP Command Storage Directory.3.3.1 Environment variable setup example .3.3.2 Setting an environment variable from the command prompt .3.4 Registering an RPDP User Account .3.4.1 Registering a new account .3.4.2 Adding the RPDPS10Vusers group as a group to whichan existing account belongs.CHAPTER 41-21-21-41 - 381 - 401 - 401 - 421 - 421 - 441 - 44PROGRAMMING COMMANDS . 1 - 45Notes on Programming Commands .iii1 - 45

CHAPTER 6GENERATION .6.1 Overview.6.1.1 Purpose of system generation.6.1.2 Features of system generation .6.1.3 Site management method for a plurality of PCs units.6.2 System Generation Commands and Flow of System Construction .6.3 PCs System Definition Information .6.3.1 User setting definition information .6.3.2 Contents of PCs system definition information .6.3.3 Contents of network definition information.6.3.4 Site definition information .6.4 PCs System Definition Information Display .6.5 PCs System Environment Duplication .6.5.1 Duplication unit .6.5.2 Duplication range .6.6 PCs System Environment Deletion.1 - 461 - 461 - 461 - 461 - 481 - 491 - 531 - 531 - 561 - 571 - 581 - 591 - 591 - 591 - 601 - 61CHAPTER 7ALLOCATOR . 1 - 627.1 Allocating and Deallocating Split Areas .7.1.1 Necessity for split areas .7.1.2 Allocating split areas .7.1.3 Deallocating split areas .7.1.4 Assigning names to GLB and VAL .7.2 Value (VAL) Registration and Deletion .CHAPTER . 1 - 68Linking and Loading .Loader Operating Environment .Search Path of Libraries .Notes on Linking and Loading .CHAPTER 91 - 621 - 621 - 631 - 661 - 661 - 671 - 681 - 691 - 731 - 73BUILDER . 1 - 749.1 Registering and Deleting a Task .9.1.1 About the task .9.1.2 Registering a task .9.1.3 Deleting a task .9.2 Registering and Deleting a Resident Subprogram .9.2.1 About the indirect link subprogram (IRSUB) .9.2.2 Registering an indirect link subprogram (IRSUB) .9.2.3 Deleting an indirect link subprogram (IRSUB) .9.3 Registering and Deleting a Built-in Subroutine .9.3.1 About the built-in routine.9.3.2 Registering a built-in subroutine .9.3.3 Deleting a built-in subroutine .CHAPTER 10MAP.10.1 Purpose of Displaying Allocator Management Table Information .10.2 svmap Command Options and Displayed Information .iv1 - 741 - 741 - 741 - 751 - 761 - 761 - 761 - 771 - 781 - 781 - 781 - 791 - 801 - 801 - 80

10.2.1 Map information targeted for output .10.2.2 Description of map information output .10.2.3 Map information output forms .10.3 Logical Address Specification and Information Displayby the svadm Command .STARTUP .11.1 Overview .11.2 CMU State Transitions .11.2.1 Startup procedure .11.2.2 CMU Control Procedure .1 - 801 - 801 - 801 - 82CHAPTER 111 - 831 - 831 - 831 - 831 - 85CHAPTER 12svdebug (ONLINE DEBUGGER) AND DEBUGSUPPORT FUNCTIONS . 1 - 8712.1 Overview .12.2 PCs Status and Subcommand Availability.12.3 Basic Functions .12.4 Other Functions .12.5 Debug Support Commands .12.5.1 svelog command .12.5.2 svdhp command.12.5.3 svcpunow command .12.5.4 svtimex command .PART 21 - 871 - 881 - 891 - 931 - 941 - 941 - 951 - 961 - 97COMMAND REFERENCECHAPTER 1SYSTEM GENERATION . 2 - 2CHAPTER 2ALLOCATOR . 2 - 7CHAPTER 3LOADER. 2 - 16CHAPTER 4BUILDER . 2 - 34CHAPTER 5MAP . 2 - 44CHAPTER 6STARTUP . 2 - 51CHAPTER 7svdebug (ONLINE DEBUGGER) ANDDEBUG SUPPORT COMMANDS . 2 - 53APPENDIXESAPPENDIX ANAMES USABLE IN PROGRAMS . A - 2APPENDIX BLIBRARIES . A - 5v


FIGURESFigure 1-1Figure 1-2Figure 1-3Figure 1-4Figure 1-5Figure 1-6Figure 1-7Figure 1-8Figure 1-9Figure 1-10Figure 1-11Figure 1-12Figure 1-13Figure 1-14Figure 1-15Figure 1-16Figure 1-17Figure 1-18Figure 1-19Figure 1-20Figure 1-21Figure 1-22Figure 1-23Figure 1-24Figure 1-25Figure 2-1Figure 2-2Figure 2-3Figure 2-4Figure 2-5Figure 2-6Figure 2-7Configuration of a System in which the Development Tool is Used .Program Development Flowchart .PCs Site Directory Structure .Logical Space Managed by CPMS .PCs Physical Memory Map .Task Arrangement in Logical Space .Task Arrangement in Logical Space (Multitask) .IRSUB Arrangement in Logical Space .IRSUB Arrangement (Multi-entries) in Logical Space .Write Enable or Disable .Comparison of Data Sizes .Sample Declaration of a Structure with Alignment Considered .Example of Explicitly Declared Free Areas .Sample Declaration with Structure Size Considered .PCs System Overall Configuration .Site Directory Structure .Procedure for Newly Constructing a Controller System .Procedure for Modifying a PCs System.Procedure for copying a site within the same development machine .RPDP-Related Directory Structure and Site ConstructionEnvironment Definition File Configuration .Scope of Copying Provided by the Site Duplication Function .Sample Layout of Split Areas .Creating a Load Module and Backup File .Load Module Structure .Loading processing .Function Call and Stack Use Amount .Format of the Display Shown by svcomp for a Programor Subprogram .Format of the Display Shown by svcomp for GLB .Memory Access Range .Operation Procedure for Dynamic Display.Memory Access Range .ADT Setup Areas.vii1-21-71-91 - 101 - 121 - 141 - 141 - 151 - 151 - 271 - 301 - 311 - 311 - 311 - 471 - 481 - 501 - 501 - 511 - 561 - 601 - 631 - 681 - 701 - 712 - 222 - 322 - 332 - 702 - 702 - 792 - 98

TABLESTable 1-1Table 1-2Table 1-3Table 1-4Table 1-5Table 1-6Table 1-7Table 1-8Table 1-9Table 1-10Table 1-11Table 1-12Table 1-13Table 1-14Table 1-15Table 1-16Table 1-17Table 1-18Table 1-19Table 1-20Table 1-21Table 2-1Table 2-2Table 2-3Table 2-4Table 2-5Table 2-6Table 2-7Table 2-8Table 2-9Table 2-10Table 2-11Table 2-12Table 2-13Table B-1Table D-1Table D-2Table F-1RPDP Commands.Uses of Various Logical Spaces .Logical Space Addresses and Sizes.Assigning names to GLB and VAL.How to Use GLB and VAL .IRSUB Usage .List of RPDP Execution Environment Variables .Setup Environment Variables.Options for Floating-point Number Handling .Floating-point Number Handling and Corresponding Standard Libraries .Comparison between mcc68k and shc Command Line Options.List of shc Options .Language Specification Comparison.System Generation Commands .Contents of Site Definition Information.User-Defined Site Configuration Definition Information Setup Items .Site Construction Definition Information about Memory .Relationship between Split Area Use and GAREA Selection .Conditions for Load Module .External Reference Combinations.Combinations of Output Information and Selectable Output Forms .Combinations of svdfa Options .Relationship between the Value Specified for stype andthe Alignment Count .Combinations of svdfs Options .Stack Size Calculation Examples .Relationship between Option Combinations and Outputs .Functions of svdebug .Operation on Reception of a Signal .Task States .Status Bit Stings .Explanation of the id, t, and cyct Parameters .Relationships between Specifiable Values and Options .Display Formats Depending on the Combination of Options .Management States of Resources .Conditions for Specifying Library Names.Operation in Reception of a Signal .Error Messages .Real-Time Source Management Status .viii1-41 - 101 - 111 - 171 - 171 - 241 - 341 - 391 - 401 - 401 - 421 - 431 - 441 - 491 - 531 - 551 - 581 - 631 - 691 - 721 - 812-82 - 112 - 112 - 222 - 462 - 552 - 562 - 612 - 612 - 652 - 692 - 692 - 105A-5A - 22A - 22A - 50


1. OVERVIEWCHAPTER 1 OVERVIEW1.1 About RPDPThe real-time program developing package (S10V RPDP) is a tool for developing programsto be run under the real-time operating system (CPMS) for the S10V. This tool runs on anWindows 2000 or Windows XP machine (hereafter collectively called developmentmachines). Figure 1-1 shows the configuration of a system in which the development toolis used. S10V RPDP: Realtime Program Developing Package for S10V CPMS: Compact Process Monitor SystemDevelopment machine (PC)(S10V RPDP)Windows 2000 orWindows XP PCLAN that provides TCP/IP support・・・PCsFigure 1-1S10VConfiguration of a System in which the Development Tool is UsedIn development of real-time programs that run under CPMS, use the dedicated developmentsystem S10V RPDP (simply called RPDP hereafter), enabling programs running underCPMS to use attributes and functions provided for high-speed real-time processing.1-2

1. OVERVIEWThe RPDP program development sequence and supported functions are described below:Site construction(system generation function)A site name is assigned to each PCs for managementpurposes. The system generation function is used toestablish a site environment corresponding to a site name.Programming(compilation and librarygeneration)A cross-compiler (*) or librarian (*) is used to generate aprogram object or library that runs on the PCs installed onthe development machine.Memory allocation (allocator)The RPDP allocator is used to allocate PCs memory areasfor storing tasks, subroutines (IRSUBs), and global data(GLB).Loading, registration, andregistration display(loader, builder, andmanagement tool (map))The loader is used to store tasks, subroutines (IRSUBs),and global data (GLB) in areas that are allocated by theallocator (loading). The builder registers loaded items asa task or subroutine (IRSUB). The contents of theregistration can be confirmed using a list that is generatedby the map function.Downloading to PCs (startup)The startup function is exercised to download backup filesin the site environment into the PCs memory for startuppurposes.Debugging (debugger)The debugger is used to check the tasks and IRSUBs forimproper operations. The debugger is capable ofcontrolling the operations of the tasks. Another functionis provided for individually loading the tasks, IRSUBs,and global data from backup files into the PCs memory.(*) Hitachi Microcomputer Development Environment System Super Engine C/C CompilerPackage Version 7 or later is used as the cross-compiler/librarian.1-3

1. OVERVIEW1.2 CommandsTable 1-1 lists all RPDP commands.Table RPDP Commands (1/2)FunctionSets up an environment to construct a site.Registers a set of information for a system definition.Specifies the IP address and memory size.Displays a system definition.Copies a site.Deletes a site.Cross compiler (part of the compiler package)Librarian (part of the compiler package)Linker (part of the compiler package)Provides split area allocation and backup file generation.Provides split area deletion and backup file deletion.Provides secondary partition area allocationProvide secondary partition area deletion.Registers a VAL.Registers or deletes a VAL.Stores a resource in a backup file and registers it as managementinformation.Deletes a resource from the management information.Provides comparison with a registered resource.Creates a task.Deletes a task.Creates an indirect link subprogram.Creates a built-in subroutine.Deletes an indirect link subprogram.Deletes a built-in subroutine.Registers or deletes an IRGLB.Online debuggerStart or stopquRequests start of a task.of a task.abInhibits task start.reCancels inhibition of task start.taDisplays the task status.suSuppresses or suspends task execution.rsCancels suppression of task execution.tmStarts a task cyclically.ctCancels cyclic task -102-132-142-152-162-292-302-342-362-37, 2-382-40, 2-412-422-532-572-582-592-602-622-632-642-66(*) Click [Start], point to [Programs], and start [Hitachi Embedded Workshop2 Online Manuals[SuperH] - Japanese (Ver-Rev)], and then see under “C/C Compiler O

Hitachi will not be responsible for any accident or failure resulting from your operation in any manner not described in this manual. Hitachi will not be responsible for any accident or failure resulting from modification of software provided by Hitachi. Hitachi will not be responsible for reliability of software not provided by Hitachi.