Quick viewing(Text Mode)

IPI, C Programmer's Toolkit for PCM, GFK-0783C

IPI, C Programmer's Toolkit for PCM, GFK-0783C

November 29, 1993 GFK–0783C

IMPORTANT PRODUCT INFORMATION

READ THIS INFORMATION FIRST

Product: Programmer’s Toolkit for PCM IC641SWP710B

This is release 1.04 of the C Programmer’s Toolkit for the Programmable Coprocessor Module (PCM). The toolkit supports development of PCM applications in the C . This release adds new VTOS function calls to the PCM runtime libraries, to support the Standalone PCM, IC697PCM712. In addition, there are several minor corrections that eliminate warning messages. There are no changes to the C Programmer’s Toolkit for PCM User’s Manual or the PCM C Function Reference Manual for this release. See “Changes and Additions to User Manuals” for information that will be added to a future revision of these manuals.

Special Operational Notes

1. Operation with Microsoftr Visual C++: PCM C Toolkit version 1.04 has been used successfully with Microsoft Visual C++ Professional Edition. However, comprehensive compatibility testing of all the standard C library functions, as listed in appendix A of the C Programmer’s Toolkit for PCM User’s Manual has not been completed at this time. There may be undiscovered incompatibilities with some Microsoft library functions in Visual C++. Note that Microsoft Visual C++ Standard Edition does not produce MS-DOS (.EXE) files. Consequently, PCM C applications cannot be developed with the Standard Edition. 2. Differences between Microsoft Compiler Versions: . Runtime Libraries: The names of certain Microsoft runtime library functions in Version 6.00A are different from the names used for the same functions in later versions. Some of these functions are called by routines in the PCM libraries. E. Compiler Options: Beginning with Microsoft Visual C++ Version 1.00, the C compiler, CL.EXE, defaults to the /Gx option in Large model. This option causes the compiler to assume that all uninitialized (BSS) data and data declared as extern is in a single data segment that is limited to a total of 64K bytes. The assumption does not fit the PCM environment. Three new MS-DOS batch files, V6_BLD.BAT, V7_BLD.BAT, and VC1_BLD.BAT, are provided in this release to adjust for these differences. For details, see Installing Compiler Version-Specific Build Files in the section, Information Not in the Printed User’s Manual of the AAREADME file that is installed with the PCM C toolkit software.

r Microsoft is a registered trademark of Microsoft Corporation. 2 Important Product Information

GFK-0783C

3. PCM Compatibility: This release of the C Programmer’s Toolkit for PCM is fully compatible with PCM modules containing firmware version 3.00 or later. This PCM C toolkit release may also be used with PCM firmware versions 2.50 and 2.51, but certain restrictions apply: F. The total number of PCM tasks is limited to 8. G. Time-slice task scheduling is not available. H. Single pair, half duplex RS-422/RS-485 serial port operation is not supported. 4. PLC Compatibility: PCM application programs produced by this release of the PCM C toolkit may be used with any PLC CPU firmware version that is compatible with the firmware version of the PCM where it executes. (See the Important Product Information document that was furnished with your PCM module.) 5. PLC Programming Software Compatibility: PCM application programs produced by the PCM C toolkit have no dependency on the PLC programming software. However, example PLC ladder programs furnished with this version of the toolkit may be used with version 3.04 or later of the PLC programming software (IC641SWP7xx) and version 2.04 or later of the PLC programming software (IC641SWP3xx). 6. Other Software Required: PCM C applications must be compiled using Microsoft C 6.0, Microsoft C/C++ 7.0, or Microsoft Visual C++ Professional Edition. A text editor is required to produce C source files for compilation. The PCM Support Software (TERMF) product, IC641SWP063, is also required. 7. Installation: The PCM C toolkit distribution diskettes are copy protected; the INSTALL program will not run from a copy. You should install the toolkit from one of the distribution diskettes and then store them in a safe place.

New Features and Functionality

1. New VTOS Functions: New VTOS functions support the Standalone PCM, IC697PCM712. The PCM712 is a reduced-functionality PCM, providing the capability to operate in expansion racks that are not connected to a PLC CPU. The PCM712 does not function as part of a standard PLC system. The new functions, Send_vme_interrupt, Set_local_date, and Set_local_time, work correctly only in a PCM712. When called from a standard PCM, IC697PCM711, or an IC693 PCM with firmware version 4.00 or later, they have no effect. Attempting to use them with PCM firmware versions earlier than 4.00 will cause the PCM to reset itself.

Problems Resolved by this Upgrade

1. VTOS Functions with Void Parameter Lists: In previous toolkit versions, compiling programs that call VTOS functions with empty parameter lists, using Microsoft C 6.0 and level 4 warnings ( /W4 command line switch), caused this message:

warning C4071: no function prototype given

The function prototypes in VTOS.H for these functions (such as Get_task_id, Wait_ast, etc.) now declare their parameter lists as void, eliminating the warning. 2. Incorrect Parameter Declaration for Install_isr: In previous versions of VTOS.H, the type declaration for Install_isr parameter 2 was specified incorrectly as void (far *)( ). It is now declared as word (far *)( ). Important Product Information 3

GFK-0783C

Restrictions and Significant Open Problems

1. Formatted String Length Limit in printf: The PCM implementation of printf works correctly only when the formatted output string contains 198 characters or less. When there are 200 characters or more, an error message, “run-time error print queue full” is printed. With exactly 199 characters, the output is printed, but the PCM may lock up or reset itself. 2. Unnecessary Code Sometimes Linked from API Library: During the LINK operation for some PCM executable files that do not use PLC API service functions, code from the PLC API library is linked to the executable. This code is unnecessary, and wastes over 3K bytes of PCM RAM or ROM space. For detailed information on detecting and removing this code, see “Information Not in the Printed User’s Manual” in the AAREADME file that is installed with the PCM C toolkit software. 3. Large Model Executable Files: Large model executable (.EXE) files produced by this release must be unprotected when loaded to the PCM. If these files are not unprotected, they will be deleted from PCM RAM when the first power-on or reset occurs after they have been executed. For additional information, see “Information Not in the Printed User’s Manual” in the AAREADME file that is installed with the PCM C toolkit software. 4. Supported C : This release of the C Programmer’s Toolkit for Series 90 PCM is compatible with Microsoft C version 6.0, Microsoft C/C++ version 7.0, and Microsoft Visual C++ Professional Edition. Earlier versions of Microsoft C and C compilers from other vendors are not supported. Users of Microsoft Visual C++ Professional Edition should read “Operation with Microsoft Visual C++” in “Special Operational Notes” of this document.

Changes and Additions to User Manuals

1. Revisions of Manuals: The contents of “Information Not in the Printed User’s Manual,” in the AAREADME file installed with the PCM C toolkit software, will be incorporated into the C Programmer’s Toolkit for PCM User’s Manual at its next revision. Information in appendix C, PCM C Functions for Standalone PCMs, of the Standalone PCM Application Developer’s Guide will be incorporated into the PCM C Function Library Reference Manual at its next revision. 2. Sample Program for Special_dev: The sample program for Special_dev on page 199 of the PCM C Function Library Reference Manual is incorrect. Here is a corrected sample program: 4 Important Product Information

GFK-0783C

#include #include #include

msg_addr other_pcm_addr; special_dev_8_type new_plc_ref;

word hndl1, hndl2, hndl3, spec_value; word task = Get_task_id();

hndl1 = Open_dev( “COM1:”, WRITE_MODE, WAIT, task ); hndl2 = Open_dev( “CPU:%R1”, READ_MODE | WRITE_MODE, WAIT, task ): hndl3 = Open_dev( “CPU:#32”, WRITE_MODE, WAIT, task );

spec_value = Special_dev( hndl1, 5, “1200,E,7,1,S,485,2,,512”, 0, WAIT, task ); if (spec_value == SUCCESS) { /* The serial parameters were changed successfully. */ }

new_plc_ref.type = R_DATA; new_plc_ref.offset = 299;

spec_value = Special_dev( hndl3, 8, &new_plc_ref, 0, WAIT, task ); if (spec_value == SUCCESS) { /* The channel will now access %R300 */ }

other_pcm_addr.rack = 0; other_pcm_addr.slot = 5; other_pcm_addr.svc_point = 8;

spec_value = Special_dev( hndl2, 6, &other_pcm_addr, 0, WAIT, task ); if (spec_value == SUCCESS) { /* The channel will send messages to the PCM in rack 0, slot 5. */ /* The receiving PCM needs to call Open_dev, specifying device */ /* “CPU:#8” to receive the messages. Messages must be 32 bytes */ /* long and use structure type msg_hdr, defined in CPU_DATA.H, */ /* as the low order 16 bytes. */ }