Download Compiled SCPI Functions

Transcript
Using Compiled SCPI
Running the C-SCPI Preprocessor
This section provides a guide to running the C-SCPI preprocessor.
Figure 2-2 displays the preprocessor process.
To run the C-SCPI preprocessor, type the following at the command prompt:
cscpipp
main ( ) {
.
INST_DECL(vm,”E1411B”,
REGISTER);
INST_STARTUP();
INST_OPEN(vm,”vxi,24”)
}
source1.cs > source1.c
C Code (ready for the compiler)
to create an object file
C-SCPI
Preprocessor
Language Tables
Figure 2-2. C-SCPI Preprocessor Process
C-SCPI commands are preprocessed and translated into ANSI C function
calls. Figure 2-3 displays a sample of the ANSI C source code
(source1.cs) with C-SCPI commands, and the translation of the C-SCPI
commands (source1.c) into ANSI C function calls after running the
preprocessor. The resulting ANSI C file contains code generated by the
C-SCPI preprocessor, and is not intended to be modified by the user.
However, line mapping information in the resulting ANSI C file will cause
the C compiler to reference the original source file (e.g., source1.cs) for
any errors or warnings that you may receive.
20
Chapter 2