Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Hp4155 delay/response

Solved!
Go to solution

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

0 Kudos
Message 1 of 8
(5,493 Views)

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

 

 

0 Kudos
Message 2 of 8
(5,483 Views)

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

0 Kudos
Message 3 of 8
(5,462 Views)

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

 

0 Kudos
Message 4 of 8
(5,459 Views)

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

0 Kudos
Message 5 of 8
(5,458 Views)

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

0 Kudos
Message 6 of 8
(5,421 Views)
Solution
Accepted by topic author niedk

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. 

Nathan Murphy
NI C Series Modules Product Manager with an expired CLA
Message 7 of 8
(5,403 Views)

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

0 Kudos
Message 8 of 8
(5,358 Views)