
Programming Examples
U, I, P Measurement over RS-232 Interface without VISA Library
6
6-23
return 0; /* OK */
}
/****************************************************************************
**/
static int sio_close(sio_t *sio)
{
CloseHandle(sio->handle);
if ( sio->buf.base )
free(sio->buf.base);
sio->buf.base = NULL;
return 0; /* OK */
}
/****************************************************************************
**/
static int sio_read(sio_t *sio,byte *buf,int bufsize)
{
DWORD l;
if ( !ReadFile(sio->handle,buf,1,&l,NULL) )
{
sio_error("ReadFile");
return -1;
}
return l;
}
/****************************************************************************
**/
static int sio_write(sio_t *sio,byte *buf,int bufsize)
{
DWORD l, len;
for(len = 0; len < (DWORD)bufsize; len += l)
{
if ( !WriteFile(sio->handle,buf+len,bufsize-len,&l,NULL) )
{
sio_error("WriteFile");
return -1;
}
}
return len;
}
/****************************************************************************
**/
static int sio_fillbuf(sio_t *sio)
{
register int l;
l = sio_read(sio,sio->buf.base,sio->buf.size);
Содержание NORMA 4000 Operators
Страница 6: ...Remote Control Users Guide iv ...
Страница 8: ...Remote Control Users Guide vi ...
Страница 10: ...Remote Control Users Guide viii ...
Страница 12: ...Remote Control Users Guide 1 2 Output Unit 1 13 Command Sequence and Command Synchronization 1 14 ...
Страница 26: ...Remote Control Users Guide 2 2 ...
Страница 38: ...Remote Control Users Guide 3 2 ...
Страница 50: ...Remote Control Users Guide 4 2 ...
Страница 150: ...Remote Control Users Guide 4 102 ...
Страница 152: ...Remote Control Users Guide 5 2 ...
Страница 160: ...Remote Control Users Guide 6 2 ...
Страница 184: ...Remote Control Users Guide 6 26 ...