Home > Software engineering >  Read the waveform file co-exist memory to the instrument
Read the waveform file co-exist memory to the instrument

Time:10-09

Beginner to seek expert help
Do a instrument control procedures, implementation on PC to generate a wave table (save the. TXT or. In the raf), and then downloaded to memory, instrument of the SCPI command is: DATA: VOLETILE & lt; FLAG> , & lt; Data length & gt;

CodePudding user response:

Can come up with a usable. TXT wave table file open and screenshots WinHex software?

CodePudding user response:

Wave form data column is more than a single line

CodePudding user response:

Fyi:
 # include & lt; Stdio. H> 
# include & lt; String. H>
Void HexDump) (char * buf, int len, int addr) {
Int I, j, k;
Char binstr [80].

For (I=0; iIf (0==16) (I %) {
Sprintf (binstr, "% x - 08", I + addr);
Sprintf (binstr, "% s % 02 x", binstr, buf (unsigned char) [I]);
} else if (15==16) (I %) {
Sprintf (binstr, "% s % 02 x", binstr, buf (unsigned char) [I]);
Sprintf (binstr, "% s", binstr);
For (j=I - 15; j<=I; J++) {
Sprintf (binstr, "% s % c," binstr, ('! '& lt; Buf [j] & amp; & Buf [j] <='~')? Buf [j] : '. ');
}
Printf (" % s \ n ", binstr);
} else {
Sprintf (binstr, "% s % 02 x", binstr, buf (unsigned char) [I]);
}
}
If (0! 16)=(I %) {
16 k=16 - (I %);
For (j=0; jSprintf (binstr, "% s", binstr);
}
Sprintf (binstr, "% s", binstr);
K=16 - k;
For (j=I - k; jSprintf (binstr, "% s % c," binstr, ('! '& lt; Buf [j] & amp; & Buf [j] <='~')? Buf [j] : '. ');
}
Printf (" % s \ n ", binstr);
}
}
Int main () {
Char STR [1024].
Int flag=1;
Int datalen=3;
The int data [3]={1, 2, 3};
Int I, L;
L=sprintf (STR, "DATA: VOLETILE % d, % d", flag, datalen);
For (I=0; iHexDump) (STR, L + 3 * sizeof (int), (int) STR);
return 0;
}
//0012 fb70-44 41 54 56 4 f 4 c 3 a 41 45 to 54 49 4 c and 2 c 45 33 DATA: VOLETILE1, 3
//fb80 0012-01 00 00 00 00 00 00 02 03 00 00 00...
//

CodePudding user response:

Using VC how to implement, to EDIT or RICHEDIT control in the dialog box? Code, thank you

CodePudding user response:

Printf to sprintf
  • Related