03-07-2012 11:58 AM
I have the LabVIEW drivers for an Agilent 33250a function generator, and have made a program to generate an arbitrary waveform, but I am unable to properly communicate with the device. After a careful look, it seems that the program is failing right at the original VISA *IDN command. (Using Labview 8.6 BTW)
The are a number of annoying problems I am experiencing: I originally made this program over a year ago, and was able to make it work then. I have since come back to it, and now it is not working. As far as I know, nothing in the program has changed. To add to my frustration, when I open the serial configuration in MAX, I am able to properly issue the VISA *IDN command and read back the response, yet when LabVIEW issues the same command it does not work.
The serial config I am using is: Baud - 57,600 Parity: None, Handshake: DTR/DSR (defaults for this function generator). I am using a null modem cable (believe this is required).
I have tried increasing the timeout and decreasing the number of bits read back, but it didn't help. I have also tried changing the VISA access mode to exclusive and load configured, but that also didn't help. I also tried updating DAQmx hoping it might eliminate some conflict between it and LabVIEW, but with no success. Is it possible that the MAX and LabVIEW create some sort of conflict on the comm port? I have noticed that I can only issue commands properly in MAX when LabVIEW is completely closed, even if my VI is open but not running, MAX reports the device is valid but busy.
Any advice would be greatly appreciated since I'm pretty much out of ideas.
If it helps, here is a typical NI I/O Trace when I run the program:
1. VISA Open ("COM3", False, 4, 0, "COM3")
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.330 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
2. VISA Set Attribute ("COM3", 0x3FFF001A, 30000)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.330 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
3. VISA Get Attribute ("COM3", 0x3FFF0171, 4)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.330 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
4. VISA Set Attribute ("COM3", 0x3FFF00B3, 0)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.330 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
5. VISA Set Attribute ("COM3", 0x3FFF00B4, 0)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.330 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
6. VISA Set Attribute ("COM3", 0x3FFF0018, 10)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.330 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
7. VISA Set Attribute ("COM3", 0x3FFF0021, 57600)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.330 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
8. VISA Set Attribute ("COM3", 0x3FFF0025, 4)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.330 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
9. VISA Set Attribute ("COM3", 0x3FFF0023, 0)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.330 Call Duration 00:00:00.001
Status: 0 (VI_SUCCESS)
10. VISA Set Attribute ("COM3", 0x3FFF0022, 😎
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.331 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
11. VISA Set Attribute ("COM3", 0x3FFF0024, 10)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.331 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
12. VISA Flush I/O Buffer ("COM3", 192)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.331 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
13. VISA Set I/O Buffer Size ("COM3", 48, 4096)
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.331 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
14. VISA Write ("COM3", "SYST:REM;")
Process ID: 0x00001460 Thread ID: 0x000017CC
Start Time: 10:47:08.331 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
15. VISA Write ("COM3", "*IDN?")
Process ID: 0x00001460 Thread ID: 0x0000036C
Start Time: 10:47:08.331 Call Duration 00:00:00.001
Status: 0 (VI_SUCCESS)
> 16. VISA Read ("COM3", 256, 0)
> Process ID: 0x00001460 Thread ID: 0x0000036C
> Start Time: 10:47:08.332 Call Duration 00:00:30.002
> Status: 0xBFFF0015 (VI_ERROR_TMO)
03-07-2012 12:47 PM
Found a solution - For some reason the termination characters for the serial data were improperly set.