Keysight E4428C ESG RF Programming Manual page 141

Signal generators
Table of Contents

Advertisement

if (numDigits)
{
/* read numDigits bytes into result string. */
count = recv(sock, result, (int)numDigits, 0);
result[count] = 0;
numBytes = atol(result);
}
if (numBytes)
{
resultBytes = 0;
/* Loop until we get all the bytes we requested. */
/* Each call seems to return up to 1457 bytes, on HP-UX 9.05 */
do {
int rcount;
rcount = recv(sock, result, (int)numBytes, 0);
resultBytes += rcount;
result
} while ( resultBytes < numBytes );
/************************************************************
* For LAN dumps, there is always an extra trailing newline
* Since there is no EOI line.
* great but for binary dumps, it is not needed.
***********************************************************/
if (resultBytes == numBytes)
{
char junk;
count = recv(sock, &junk, 1, 0);
}
}
else
{
/* indefinite block ... dump til we can an extra line feed */
do
{
if (recv_line(sock, result, maxLength) == NULL) break;
if (strlen(result)==1 && *result == '\n') break;
resultBytes += strlen(result);
result += strlen(result);
} while (1);
Keysight Signal Generators Programming Guide
/* null terminate */
+= rcount;
/* Advance pointer */
For ASCII dumps this is
Programming Examples
LAN Programming Interface Examples
133

Advertisement

Table of Contents
loading

Table of Contents