App-7
IM 703155-01E
Appendix
App
Note
•
The mapping of voltage values to raw data is as follows:
•
1.0 V: 0x3FFF
•
0.0 V: 0x2000
•
–1.0 V: 0x0001
•
You can load waveform data created for the VB8000 in the VB8300. However, note that
the voltage mapping is different.
Example of a program that converts endian
/*
* unsigned int Endian(unsigned int d);
*
* Input : unsigned int d; ... Data before conversion
* Output : None
* Return value : Input data with endian converted.
* In other words,
* BigEndian = Endian( LittleEndian );
* LittleEndian = Endian( BigEndian );
*
* Note:
The unsigned int type is assumed to be a 32-bit integer.
*
*/
unsigned int
Endian( unsigned int d ) {
unsigned char
c[sizeof(unsigned int)];
unsigned char*
t = (unsigned char*)&d;
int i;
for( i = 0; i < sizeof(c); i++ )
c[sizeof(c)-1-i] = t[i];
return *(unsigned int*)&c[0];
}
Extension
The extensions of various data formats are shown below.
• ASCII data: .csv
• Binary data: .bin
• Raw data: .raw
Appendix 2 Waveform Data Format