Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
LabVIEW-Measurements.pdf
Скачиваний:
61
Добавлен:
29.05.2015
Размер:
3.37 Mб
Скачать

Chapter 20 VISA in LabVIEW

Types of Events

Handling GPIB SRQ Events Example

Figure 20-4 shows a block diagram for how to handle GPIB Service

Request (SRQ) events with VISA.

Figure 20-4. SRQ Events Block Diagram

The VI enables service request events and then writes a command string to the instrument. The instrument is expected to respond with an SRQ when it has processed the string. The Wait on Event Async VI waits for up to 10 seconds for the SRQ event to occur. After the SRQ occurs, the instrument status byte is read with the Read Status Byte VI. The status byte must be read after GPIB SRQ events occur, or later SRQ events may not be received properly. Finally the response is read from the instrument and displayed. The Wait on Event Async is different from the regular Wait on Event VI in that it continuously calls Wait on Event with a timeout of zero to poll for the event. This frees up time for other parallel segments of the program to run while waiting for the event.

Advanced VISA

Opening a VISA Session

As discussed previously, when you call VISA Read and/or VISA Write, LabVIEW checks to see if a reference has been opened for the instrument specified. If a reference is already open, the VISA call uses that reference. If there is not an open reference, VISA automatically opens one. You can choose to explicitly open references to your instruments using VISA Open. The VISA Open function is shown in Figure 20-5.

LabVIEW Measurements Manual

20-6

www.ni.com

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]