Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

trying to use status byte in LabView

I am learning how to write programs for the Kinetic Systems 3988 GPIB crate controller in Labview 5.1. I am using the KS3988 VIs that can be found on the NI web site.

Almost everything is checking out OK, but I can not get the status byte to work. Everything works fine when status byte is disabled, but it always times out when it is enabled. How can I read the status byte?

After some hacking about inside the 3988 VIs I found that it does return the correct status of the crate controller, but the VISA Read VI, which one of hte 3988 VIs uses, manages to timeout.

What do I do?

Thanks.

-Kazem
0 Kudos
Message 1 of 9
(5,494 Views)
Hi,

You should beable to send the *STB? command then perform a read to get the status byte. If you want to trap for Service Request then you need to enable various bits in the Service Request Enable Register (SRE) and likewise the Event Status Enable Register (ESE).


Hope this helps
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 9
(5,494 Views)
Commands such as *STB? are for IEEE 488.2 devices. The KS3988 controller is a IEEE 488 device. So *IDN? and *STB? and the like do not work.

Thanks.

-Kazem
0 Kudos
Message 3 of 9
(5,494 Views)
You should be able to use the Serial Poll vi to return a serial poll byte / status byte from the instrument.
0 Kudos
Message 4 of 9
(5,494 Views)
What I failed to mention is that I am using the read status byte register VI that is included in the KS3988 VI package that is on the NI website.

I can get the status byte to return, but unless I alter the byte count that the Read VISA VI receives, it will not work without a time out, and even then it returns a warning. I guess that's better than an error.

-Kazem
0 Kudos
Message 5 of 9
(5,494 Views)
Hi,

Have you set the corresponding mask bit using the KS3988 SRQ Mask.vi.

I guess you have enabled the Status Byte with the FS3988 VISA Open.vi?


Ray
Regards
Ray Farmer
0 Kudos
Message 6 of 9
(5,494 Views)
Yes, I enable the STB with the KS3988 Open.vi.

Sorry for the late response.

It's been working great with the status byte enabled and altering the byte expectancy for the VISA Read.vi. However, I have begun creating block transfer programs for the same instruments, and block transfers work a lot better with a status byte. The byte expectancy for a block transfer is rather different, so I haven't been able to hack it this time. It continues to time out with the status byte enabled.

Thanks for the help.

-Kazem
0 Kudos
Message 8 of 9
(5,494 Views)
Hi,


Have you tried this LLB, its uses 488 functions. (this is from the NI web site)


Also with the VISA driver. Have you tried setting the data transfer to synchronous. Add the following line in labview.ini
syncVisa=True. You will need to re launch Labview. (see VISA Write help for more details).


Ray.
Regards
Ray Farmer
0 Kudos
Message 7 of 9
(5,494 Views)
I will try to use that LLB that you sent me. Thanks.

-Kazem
0 Kudos
Message 9 of 9
(5,494 Views)