EasyManua.ls Logo

Anritsu ML2437A - Binary Output Message Decoding

Anritsu ML2437A
314 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Programming Examples GPIB Operation
8-136 PN: 10585-00001 Rev. P ML2437A/38A OM/PM
Binary Output Message Decoding
The following program example may be used to decode the three types of binary output
messages. The commands that reference this code example are OGBD, MXGDB and MNGDB
for the GRAPH_BINARY_DATA decoding; OFFTBR for the
OFFSET_TABLE_BINARY_DATA decoding; and CFURD for the
CAL_FACTOR_BINARY_DATA decoding.
/*****************************************************************
/* Decode binary outputs example*/
/* This function expects the binary response from the command to be
held in a global */
/* character array buffer. The passed parameter ‘decode type’ will
be one of the global */
/* definitions*/
/* GRAPH_BINARY_DATA*/
/* OFFSET_TABLE_BINARY_DATA, CAL_FACTOR_BINARY_DATA*/
/*****************************************************************
void buffer_decode(int decode_type)
{
int count;
long *bin_value;
char *cptr;
char ch_val[6];
int length;
if (decode_type == GRAPH_BINARY_DATA)
{
/* FOR OGBD, MXGDB and MNGDB */
/********************* Decode header ************************/
/* Find # character. */
cptr = strtok(&buffer[0],"#");
cptr = strtok(NULL,"#");
/* Get the number of characters for binary length */
ch_val[0] = *cptr++;
ch_val[1] = NULL;
count = atoi(&ch_val[0]);

Table of Contents

Related product manuals