cscpi_exe()
NAME
cscpi_exe − Compiled SCPI Function
SYNOPSIS
cscpi_exe (id, cmd_string, cmd_length, result, result_length);
DESCRIPTION
This is a Compiled SCPI function. The compiled SCPI execute function allows you to use an interactive mode of operation with only REGISTER configurations. With this function you can enter your SCPI commands during run time.
PARAMETERS
id
The user variable name for the instrument. This is the variable name that you assign to the instrument in the INST_DECL or INST_EXTERN command. For example,
INST_DECL (vm, "E1411B", REGISTER);
assigns vm as an instrument data pointer to the E1411B. Now when you use vm as the id in cscpi_exe, the SCPI command is sent to the HP E1411B.
cmd_string
The string constant containing the SCPI commands. See the instrument’s VXI user’s manual for information on the SCPI commands.
cmd_length
The length of the cmd_string parameter. If you are using this interactively, you can use the C string length function (strlen).
result
The address location where the results of an instrument query will be stored. The address location must be a pointer of type char.
result_length
The maximum length of the returned string. If you are using this call interactively, you can use the C size of function (sizeof).
EXAMPLE
This example shows cscpi_exe being used in a loop prompting for input.
INST_DECL (vm, "E1411B", REGISTER);
main ()
{
char result [255];
char command [255];
.
.
INST_STARTUP ();
INST_OPEN (vm, "VXI,24");
for (;;)
{
printf("Enter Command");
gets(command);
cscpi_exe (vm, command, strlen(command), &result,sizeof(result));
.
if (result[0]!=0)
printf ("The result of the %s command is: %s", command, result);
}
}
— December 08, 1992