10-01-2013 10:16 AM
Hello, I've written a labview program to do automated testing on devices in our lab. Recently we've had a problem where the scan times for the HP 4155 time changed by about 5 seconds for no apparent reason. This made the program unusable and I was forced to change the hard coded delay times to make the program work again. Has anyone experienced this problem where the equipment seemingly all of a sudden takes longer to do a scan than it did the previous 4+ months? Also is there a way to wait for a response from the HP4155 to finish the scan instead of hardcoding in delay times for the program? If anyone knows a way to wait for the HP4155 to finish the scan, it would be greatly appreciated.
Thanks,
Konrad
Solved! Go to Solution.
10-01-2013 03:07 PM
Hi,
You need to read the status register after you start your measurement.
Serial Poll the status register in a loop until the data ready bit (bit 1) reads 1.
Curt
10-03-2013 10:17 AM
Ok, so basically I would just send an SCPI command to the 4155 of "*OPC?" then wait for the read command to return a 1 instead of a 0?
Thanks,
Konrad
10-03-2013 10:25 AM
Hi Konrad,
No. Checking the operation complete bit will tell you that it received the start measurement command and initiated the reading.
Serial poll the device in a do loop until your scan/sweep is complete and the data is ready to transfer
Curt
10-03-2013 12:14 PM
Curt,
I built a test program using the attached code and it seems to be working. Can you forsee any problems with doing it this way? It seems to be changing the status bit to 1 after the scan completes itself?
Konrad
10-08-2013 12:04 PM
So to continue this thread, I finished coding my subvi and have implemented it in most of our programs. I noticed a bug in one of the programs where we get a -420 or -410 error when the program tries to pull the MES file information from the 4155. I'm guessing there's something in my subvi causing this glitch, it seems like the 4155 has either finished it's action or hasn't started it before the subvi can be called in.
I've attached the subvi, if anyone can help it would be greatly appreciated,
Konrad
10-09-2013 11:12 AM
The error -420 is thrown when a command is sent to read data, but there was no data to be read.
What I'm suspecting is happening is that the call to read from the device is happening before the device has a chance to set that status bit you are attempting to read. Try setting a breakpoint and hold off a few seconds before continuing through to that Read VI.
10-21-2013 02:23 PM
Nathan,
It's as you suspeted I think, I didn not end up using breakpoints but simply editted my subvi to include changing the VISA timeout period as well as adding a short delay before the Read command is sent to the 4155. I've attached my subvi code as well.
Thanks,
Konrad