Creating a New Project

Once the ASN1C program has been activated, a new project can be created to store all of the settings. To do this, select Project > New Project from the menu. The ASN1C Settings window is displayed.

The Output tab is displayed by default. In the Application Language Type section, select C. In the Encoding Rules section, select BER. Finally, in the Output Directory text box, enter or browse to the location where the generated files should be saved. When finished defining the project settings, click OK. These settings can be changed at any time by selecting Project > Project Settings from the menu.

Next, a new schema file is created for the project. Click New in the toolbar or navigate to File > New Schema File. A dialog box is displayed to define a name for the new file. Once entered, the file is added to the project window under the "Schema/ASN.1 files" heading and its empty contents are shown in the editor.

The schema is then written between the "DEFINITIONS ::= BEGIN" and "END" statements in the file. For this example, the following can be entered:

MySequence ::= SEQUENCE {
    ingredient PrintableString,
    count INTEGER,
    units PrintableString
}
  

Once the schema is created, click Validate to perform a check for errors.

Note

If the new schema file has not yet been saved, ACGUI asks if it should be. Once saved, ACGUI validates the file.

If the schema has errors, they are displayed in the log at the bottom of the ACGUI window.

Once the project has been configured, click Compile to generate code according to the project settings. If compliation is successful, a list of generated files, sorted according to the selected language, is displayed under the Generated Items heading in the Project pane. If compilation is not successful, any errors are displayed in the Error Log.

At this time, project settings can be changed and schema files can be edited as needed.