The Commands to My GPIB Instruments Are Truncated When Sent through LabWindows/CVI (Measurement Studio) Primary Software: LabWindows/CVI Development Systems>>Full Development SystemPrimary Software Version: 7.0 Primary Software Fixed Version: N/A Secondary Software: N/A Hardware: GPIB
Problem: I downloaded the GPIB drivers for my instrument for LabWindows/CVI from ni.com. When I watch the GPIB bus with NI Spy, the commands sent from within Measurement & Automation Explorer (MAX) are correct, but the commands sent from within LabWindows/CVI are truncated. For example, within MAX, I sent a centering frequency command to my hp8566b to center with 9.876543210E9 Hz. The device centers to this exact frequency. When I try the same command in LabWindows/CVI, the device goes to 9.876540000E9 Hz, and the command has been truncated. How can I edit the driver to display a higher degree of precision? Solution: The drivers for GPIB in LabWindows/CVI are written in Standard C format. The problem you are experiencing is caused by the Fmt function of LabWindows/CVI. This function defaults to six digits of precision. To resolve this problem, alterations to the hp8566b_frequency_sweep function are necessary. Open the hp8566b.c driver file in either LabWindows/CVI or a text editor and change lines 239 and 241 to match the following lines:Notice that the Fmt command now has the specifier of p9. This expands the precision to 9 digits. If you need more digits, just change the values to suit your needs.Related Links: Attachments:
Report Date: 06/27/2002 Last Updated: 03/18/2008 Document ID: 2MQBPJMQ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
