GRIP Reference Guide > Developing & Executing Programs
Developing and Executing Programs
Three ways to develop and run GRIP programs:
- Standard Program Development — manual create/compile/link/run cycle (see below).
- Automating with GRADE Batch — NX-provided tool (
GRADE Batch) automates compile, link, run. - Automating with Batch (Windows) / Script (UNIX) Files — scripted automation of the dev cycle.
Standard Program Development steps (Developing GRIP Programs)
- Creating a GRIP Program — write the
.grssource file (statements, labels, comments). GRIP has four statement kinds: statements, declarations, functions, symbols. IMPORTANT: file names/paths used by a GRIP program to create files must not contain spaces — no warning is given if creation silently fails.- Create the source with the NX text editor, system editor, or any ASCII editor.
- In GRADE, the
Editcommand opens the currently-configured OS editor (e.g.vi); shorthand ise <filespec>(no need to add.grs, GRADE appends it automatically). - Customize default editor via env var
UGII$EDITOR/UGII_EDITORset to the editor's executable name.
- Compiling a GRIP Program — converts the
.grssource into a special object-code format via the GRIP compiler. The compiler analyzes each source line, produces a listing (statements, labels, variables, errors), and — if no errors — writes an object file. Source lines are limited to 80 bytes/line (fewer characters if a multi-byte character set is in use). - Linking GRIP Object Files — links a main program's object file together with any subprogram object files into one executable module, arranging data flow between segments. The linker lists the main program and referenced subprograms in reference order; a clean link produces a filed executable module.
- Running a GRIP Program — the linked executable can be run interactively or in
batch, exactly like compile/link. You cannot run a GRIP program from within GRADE.
- Interactively in an NX session: File > Execute > GRIP.
- Via GRADE or the
gripbatchcommand — only if the program needs no interactive input.
- Debugging a GRIP Program — the compiler/linker always generate debuggable code. Start via File > Execute > Debug GRIP (prompts for the file to debug), which opens the Debug GRIP menu with options: Single Step, Single Step/Into, Set Breakpoints, Clear Breakpoints, Examine Variables/Entities, Set Variable, List Option, Continue, Program Abort. The menu header also shows program state info.
- Sharing GRIP Executables — GRIP executables (
.grx) and object files (.gri) are shareable across platforms if: (a) the code contains no platform-specific data (e.g. hard-coded pathnames must be valid on the target platform), and (b) the machines share the same byte order (endianness). Windows 32-bit, Windows 64-bit, and Linux share compatible byte order, so an executable built on one of these can run on another without recompiling.
Automating with GRADE Batch
GRADE Batch is an NX-supplied tool that automates the compile → link → run sequence, avoiding manual invocation of each step.
Automating with Batch/Script Files
On Windows, batch files can drive the same compile/link/run cycle; on UNIX, script and command files serve the equivalent role.
About GRADE
GRADE is NX's interactive development environment/tool used to create, compile, link, run, and debug GRIP programs (referenced throughout the steps above as the vehicle for edit/compile/link/run commands).
Source: https://docs.sw.siemens.com/documentation/external/PL20220512394070742/en-US/nx_api/nx/2212/nx_api/en-US/grip/dev_execution/dev_ov.html · retrieved Tue Jul 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)