Network operation and remote control
R&S
®
SMA100B
446User Manual 1178.3834.02 ─ 09
Command Function
#EXTENSION_START
#EXTENSION_END
Defines the output file extension.
#INIT_CODE_START
#INIT_CODE_END
Contains initial entries, such as included files and
libraries, buffer size, commands for synchronization,
or creating a VISA session.
All entries between start and end are written once at
the beginning of the output file.
#COMMAND_CODE_START
#COMMAND_CODE_END
Frame for a SCPI command. A command is
accessed with %COMMAND.
#NO_COMMAND_CODE_START
#NO_COMMAND_CODE_END
Frame for a parameter with no SCPI command
available. A parameter is accessed with
%PARAMETER.
#EXIT_CODE_START
#EXIT_CODE_END
Closes the visa session.
All entries between start and end are written once at
the end of the output file.
Templates are created in ASCII format with file extension *.expcodetempl.
Example:
Example to the code generator template NICVI.expcodetmpl:
#EXTENSION_START
.c
#EXTENSION_END
#INIT_CODE_START
#include <ansi_c.h>
#include <visa.h>
#include <cvirte.h>
#define MAX_BUFFER_SIZE 200
static ViStatus status;
static ViSession defaultRM, handle;
static void write_command(char *command)
{
char writeBuffer[MAX_BUFFER_SIZE];
char readBuffer[MAX_BUFFER_SIZE];
int length;
int readCount;
strcpy(writeBuffer, command);
//append "*OPC?" to sync
strcat(writeBuffer, ";*OPC?");
length = strlen (writeBuffer);
writeBuffer[length]='\n';
References