?? hpibstat.c
字號:
/* hpibstat.c
The following example retrieves and displays
HP-IB bus status information.
*/
#include <stdio.h>
#include <sicl.h>
main()
{
INST id; /* session id */
int rem; /* remote enable */
int srq; /* service request */
int ndac; /* not data accepted */
int sysctlr; /* system controller */
int actctlr; /* active controller */
int talker; /* talker */
int listener; /* listener */
int addr; /* bus address */
#if defined(__BORLANDC__) && !defined(__WIN32__)
_InitEasyWin(); // required for Borland EasyWin programs
#endif
/* exit process if SICL error detected */
ionerror(I_ERROR_EXIT);
/* open HP-IB interface session */
id = iopen("hpib7");
itimeout (id, 10000);
/* retrieve HP-IB bus status */
igpibbusstatus(id, I_GPIB_BUS_REM, &rem);
igpibbusstatus(id, I_GPIB_BUS_SRQ, &srq);
igpibbusstatus(id, I_GPIB_BUS_NDAC, &ndac);
igpibbusstatus(id, I_GPIB_BUS_SYSCTLR, &sysctlr);
igpibbusstatus(id, I_GPIB_BUS_ACTCTLR, &actctlr);
igpibbusstatus(id, I_GPIB_BUS_TALKER, &talker);
igpibbusstatus(id, I_GPIB_BUS_LISTENER, &listener);
igpibbusstatus(id, I_GPIB_BUS_ADDR, &addr);
/* display bus status */
printf("%-5s%-5s%-5s%-5s%-5s%-5s%-5s%-5s\n", "REM", "SRQ",
"NDC", "SYS", "ACT", "TLK", "LTN", "ADDR");
printf("%2d%5d%5d%5d%5d%5d%5d%6d\n", rem, srq, ndac,
sysctlr, actctlr, talker, listener, addr);
/* For WIN16 programs, call _siclcleanup before exiting to release
resources allocated by SICL for this application. This call
is a no-op for WIN32 programs. */
_siclcleanup();
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -