Neuron® Field Compiler User’s Guide 078-0454-01A
Echelon, LONWORKS, LONMARK, NodeBuilder, Neuron, 3120, 3150, ShortStack, LonMaker, and the Echelon logo are trademarks of Echelon Corporation registered in the United States and other countries. OpenLDV and 3170 are trademarks of Echelon Corporation. Other brand and product names are trademarks or registered trademarks of their respective holders.
Welcome Echelon’s Neuron® C programming language allows you to develop LONWORKS® applications for Neuron Chips and Smart Transceivers. The Neuron Field Compiler 4.0 software is a Neuron C compiler toolchain that you can use to develop a field programming tool that generates applications for Echelon Series 5000 and Series 3100 Smart Transceivers and Neuron Chips. The Neuron Field Compiler 4.0 software includes an application that accepts a Neuron C source file and generates a downloadable Neuron image.
• Mini FX User’s Guide (078-0398-01A). This manual describes how to use the Mini FX Evaluation Kit. You can use the Mini kit to develop a prototype or production control system that requires networking, or to evaluate the development of applications for such control networks using the LONWORKS platform. • Neuron C Programmer’s Guide (078-0002-02H). This manual describes the key concepts of programming using the Neuron C programming language and describes how to develop a LONWORKS application.
Table of Contents Welcome ......................................................................................................... iii Audience ........................................................................................................ iii Related Documentation ................................................................................ iii Chapter 1. Introduction................................................................................... 1 Introduction ...........................
1 Introduction This chapter introduces the Neuron Field Compiler, describes how to install it, and describes how to redistribute it.
Introduction You can use the Neuron Field Compiler to develop a field programming tool for LONWORKS devices based on Echelon Series 5000 or Series 3100 Smart Transceivers or Neuron Chips. A field programming tool typically provides a programming environment that is suitable for use by network integrators who create special-purpose applications for controllers at the time that the controller is installed and commissioned in a network.
dynamically generated Neuron C source code. The Neuron Field Compiler generates a downloadable application image and interface files for the Neuron Chip or Smart Transceiver. Thus, your application presents its own programming interface for LONWORKS device functionality and generates an internal representation of that functionality in the Neuron C language. However, your application users do not need to know the Neuron C language, or even that Neuron C code is generated.
Installing the Neuron Field Compiler To install and use the Neuron Field Compiler on a development computer, perform the following steps: 1. Download the ReadMe.htm, FieldCompiler400.exe, and LonMarkResourceFiles1300.exe files. After licensing the Neuron Field Compiler product, you will be provided with a download link for these files. 2. After reviewing the ReadMe document, double-click the FieldCompiler400.exe file to begin the Neuron Field Compiler installation.
Redistributing the Neuron Field Compiler To enable your products to use the Neuron Field Compiler, you can redistribute the Neuron Field Compiler with your products’ installation programs (for example, with the Flexera® InstallShield® installer). You can download the installer for the Neuron Field Compiler, FieldCompiler400.exe and its required component, the LONMARK Resource Files installer, LonMarkResourceFiles1300.exe.
recommends that you install the Neuron Field Compiler runtime as a visible installer. When you run it standalone, the Echelon Neuron Field Compiler installer also installs the LONMARK Resource Files installer as an embedded installation. When the Neuron Field Compiler installer runs as an embedded installation, it does not install the LONMARK resource files.
Your application might also require one or more user-defined sets of resource files. Your installer must install these resource files to a suitable location, and register them with the resource file catalog.
2 Using the Neuron Field Compiler This chapter describes how to use the Neuron Field Compiler.
Compiling a Neuron C Program To compile Neuron C application code, the Neuron Field Compiler includes several components. Figure 2 shows the basic compilation flow for how your Neuron C generator tool works with the Neuron Field Compiler. Figure 2. Basic Compilation Flow As shown in the figure: 1. Your Neuron C generator tool calls the Neuron Field Compiler, passing in generated Neuron C code and the hardware template file for the target device. 2.
Figure 3. Compiling a Neuron C Source File The components shown within the dashed line in Figure 3 are part of the Neuron Field Compiler. Your Neuron C generator tool generally calls the Neuron Field Compiler, LonNCA32, rather than calling any of the components directly.
However, any of the Neuron Field Compiler components could potentially produce an error message that your Neuron C generator tool must be able to handle. See the Neuron Tools Errors Guide for information about the various error codes from the Neuron Field Compiler components. See NCA Error Messages on page 18 for a description of error codes issued by the LonNCA32 command. Note: The Neuron Field Compiler Project Make Facility (LonPMK32c.
Examples: lonnca32 -–keep yes lonnca32 --keep • Commands can be read from the command line or from a command file (script file). A command file contains empty lines, lines starting with a semicolon (comment lines), or lines containing one command switch on each line (with value as applicable). The file extension can be any characters, but it is recommended that you use the “.nca” extension. For the command line, you must use quotation marks for strings that include spaces.
Command Switch Long Form Short Form Description --library -l Specify a library (.lib file) to link with the application. --mkscript Generate a command script in a specified location. --nodefaults Disable processing of default command files. --pid -p --silent Use the specified program ID (in compact ASCII format or in colon-separated format). Suppress banner message display. --target -t Specify the name of the folder that contains the generated image files.
To avoid target name conflicts with other Neuron C development tools, target names used with the Neuron Field Compiler must meet all of the following conditions: • The name must have at least one character, and no more than 26. • The first character must be in the ASCII range A-Z or a-z. Special characters are not supported.
} } // // Start the process // Process p = Process.Start(nca) { // // Read text from the process with StreamReader // StreamReader sr = p.StandardOutput { string compilerOutput = sr.ReadToEnd(); // parse the compiler output here // or display it: Console.Write(compilerOutput); } } Neuron Field Compiler Output When you build your application, the Neuron Field Compiler creates application image files and device interface files.
Processing Error Messages Any warning or error messages issued by the Neuron Field Compiler or its components have the following format: Message-type: Model_file_name Line_number(Column_number): Message Example: A model file named tester.nc includes the following single network variable declaration: network input SNVT_volt nviVolt Note the missing semicolon at the end of the line. When you use this file to build a project, the compiler issues the following message: Error: TESTER.
OnChip EEPROM (Pool) - AVAILABLE F0C7 F7FE 0738 OnChip EEPROM (Epilog) F7FF F7FF 0001 - NONE End of Memory Area List Link Memory Usage Statistics: EEPROM Usage: (not necessarily in order of physical layout) (includes application use of external NVRAM) System Data and Parameters 89 bytes Domain and Address Tables 105 bytes Network Variable Config Tables 6 bytes Application EEPROM Variables 0 bytes Library EEPROM Variables 0 bytes Application Code and Const Data 29 bytes Library Code and Const Data 0 bytes Se
Table 2. NCA Error Codes NCA# Description 1 The temporary folder cannot be removed: [NCA#1] This error could occur if the temporary folder had previously existed but is write-protected. Other errors are also likely to occur in this situation. To analyze this error further, check the access permissions granted to the temporary folder and its parent folder.
NCA# Description 6 Cannot detach from service : [NCA#6] Under normal conditions, this is an internal error, which should be reported to Echelon Support. During development and debugging of the Neuron Field Compiler client application, this error can occur as result of aborted debug sessions, especially when source code is edited and re-loaded during an active debugging session.
www.echelon.