Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

NI4882 equivalent command for the IVI formatted4​88IO ReadSTB command (AQ6317B instrument)

I cannot find in the AQ6317B optical spectrum analyzer manual the GPIB command that reads the status byte. The service command SRQ? only returns 0 or 1 meaning that the service is ON or OFF. Also SRMSK does not help. I need to read the status byte using (a) GPIB command(s) in order to find out when a longer operations such as sweep is done.

Can anyone help?

Thank you,

Cristian

0 Kudos
Message 1 of 4
(4,985 Views)

After researching this problem I have found that I should use NI4882.Device.SerialPoll and read the flag returned by this operation. However, in the latest version of NationalInstruments.NI4882.dll, v13.0.45.159, which I got a week ago from the NI website, this enum has the following values:

    [Flags]
    public enum SerialPollFlags
    {
        // Summary:
        //     Device that is requesting service has a message available.
        MessageAvailable = 16,
        //
        // Summary:
        //     At least one bit in the Event Status Register (ESR) is set.
        EventStatusRegister = 32,
        //
        // Summary:
        //     Device that asserted the service request is requesting service.
        RequestingService = 64,
    }

which as you can see, does not contain the values that I need: 1 !!!! It starts at 16, meaning b4 (the fourth least significant bit), and it's missing all the other values 1, 2, 4 and 8.

 

Anyone hit this problem? It seems very strange to miss these values. I need the value 1 because it is the bit that is set when an long operation like sweep finishes.

 

Thanks in advance,

Cristian

0 Kudos
Message 2 of 4
(4,979 Views)
To read the status byte, you use the STB? query. That's not the same thing as the ESR.
0 Kudos
Message 3 of 4
(4,971 Views)

Using STB? with my NI MAX, I get this answer to my sweep  '1250.00,1000.0,-30.0,  5.0, 2.0, 1,2501,NR_HLD,SGL,MEAS'. I was expecting a string representation of a byte, as the name of the command reads. My selected wavelenghts range is 1549 to 1551, 1000 measuring points. From this array of strings, I can only sassume that the 1 mans that the sweep is done and experiment from here on.

 

However, in the mean time I found another method. If anyone is interested: use NI4882.Device.SerialPoll() and read the result. The least significant bit (b0) of the result byte should be set.

Since I found the solution, I consider this matter closed.

 

Thank you anyway,

Cristian

0 Kudos
Message 4 of 4
(4,926 Views)