This example shows that if an invalid GPIB string is sent to the VNA then the CHECKERR macro catches the error and displays the error message from the VNA. Here we send two valid strings: “*IDN?” and then “OID”. But the third string is not a valid GPIB command and the instrument reports this. The code snippet is below.
Example 3 – Service Request Status Register – VectorStar Status Register (1 of 2)
The Service Request Status Register. It is slightly changed from Lightning to VectorStar. If LANG LIGHT is set then the Lightning configuration of the Status Register is used. In this example we used “LANG NATIVE” so the VectorStar status register is used. The code checks b2 to see if the error queue is not empty and also b4 to see if a message is available.
Example 3 – Error Checking
We catch the command error after sending the bogus “ABC” command and report the message (Faulty program mnemonic syntax).