Measurement-computing GPIB-488 Uživatelský manuál Strana 84

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 116
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 83
Chapter 4 GPIB 488.2 Library Reference
Programming Reference Manual 4-16 GPIB-488
ReceiveSetup
Address a GPIB Interface Board as a Listener and a GPIB device as a Talker, in preparation
for data transmission.
Syntax
C ReceiveSetup(int board, short address)
Parameters
board is an integer which identifies the GPIB board to be used for this operation. In most
applications, this value is 0.
address is an integer representing the GPIB address of the device to send the data.
Returns
ibsta will contain a 16-bit status word as described in Appendix B, IBSTA.
iberr will contain an error code, if an error occurred.
Usage Notes
In order to actually transfer any data, you must call a routine such as RcvRespMsg following
this routine.
This routine is useful in instances where you need to transfer multiple blocks of data between
devices. For example, you could initially address the devices using
ReceiveSetup, then
make multiple calls of
RcvRespMsg to transfer the data.
For typical cases,
Receive is simpler to use, since it takes care of both the setup and the data
transfer.
Example
This example instructs a GPIB device at address 5 to send data to GPIB Board 0. Up to 50
bytes of data is received and then stored in a string. The message is terminated with an EOI.
C char message[100];
ReceiveSetup(0, 5);
RcvRespMsg (0, message, 50, STOPend);
Zobrazit stránku 83
1 2 ... 79 80 81 82 83 84 85 86 87 88 89 ... 115 116

Komentáře k této Příručce

Žádné komentáře