Initialization is using 2 functions to initialize GPIB board and interface for destination device and itself.
Or set any slave device to remote mode.
It is easy to make program by using Equipment ID when it is unnecessary to communicate with plural destination devices at the same time.
Termination is using 1 function to release GPIB board.
Example:
Initialization ( When Equipment ID is used ) Retrieve Equipment ID by device ID and primary address, secondary address, delimiter value of slave device. |
long Ret; short DevId, EqpId, PrmAddr, ScrAddr, Delim;
Ret = GpibInit ( "Gpib000" , &DevId ); // Specifies device name, retrieves Device ID to use for using specified device in function.
PrmAddr = 1; // Sets [1] as primary address of slave device. ScrAddr = 0; // Sets [Not use] as secondary address of slave device. Delim = 1; // Sets [CR+LF] as delimiter of slave device. Ret = GpibSetEquipment ( DevId, &EqpId, PrmAddr, ScrAddr, Delim); // Retrieves Equipment ID. |
Initialization ( When Equipment ID is not used ) |
long Ret; short DevId; short IfcTime; short Enable;
Ret = GpibInit ( "Gpib000" , &DevId ); // Specifies device name, retrieves Device ID to use for using specified device in function.
IfcTime = 1; // Specifies time to transmit IFC (Usually 1 is OK.) Ret = GpibSendIFC ( DevId, IfcTime ); // Transmits IFC from specified device to initialize interface.
Enable = 1; // Specifies to remote mode. Ret = GpibChangeREN ( DevId, Enable ); // Performs setting for REN line from specified device. |
Termination |
Ret = GpibExit ( DevId ); // Performs release of specified device. |
Remarks:
Moreover, there are settings for delimiter/EOI (GpibSetDelim) and TimeOut (GpibSetTimeOut). For these settings, [CR+LF], [EOI valid] and [TimeOut 10 sec] are set as initial values. When the initial value is different from delimiter setting of destination device, please use GpibSetDelim function to correct it.