LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SCPI commands R&S

Hello everybody,

I send several SCPI commands to R&S instrument.

After a little time i found that there is a visa timeout error, when i send a command to the instrument using Visa R&S firmware , and error uccured

To contunue sending SCPI command i must close the FW of R&S instrument and open it

Does "*OPC" command and*CLS can restore the register and let me send again SCPI commands?

Please i need your help

Thanks 

0 Kudos
Message 1 of 24
(7,926 Views)

OPC is a query which asks instruments if OPeration is Complete or not. So I dont think it would help.

 

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 24
(7,899 Views)

*OPC? Is a query and what about *OPC 

I think one is a query and the second isn't 

Have you a solution for this problem ? 

0 Kudos
Message 3 of 24
(7,875 Views)

The timeout error is likely to happen either when you query for a result that the instrument is not ready to supply or when your command is not recognized and therefore not answered.

I don't know R&S instruments but if it is executing long internal calculations it may be not ready to answer and therefore the timeout. The manual should state it clearly when an operation takes very long to complete.

Are you sure your program and the instrument are synced? You could query for OPC after each command, and surely you must check for errors on each VISA instruction.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 24
(7,854 Views)

Thanks for the answer

The instrument and my program are sychronized well

When there is timeout error is there an scpi command that ignore timeout error and let me send commands again ?  Because each time to avoid timeout error I close R&S FW .

What about sending Esr and Opc when there is timeout error ? It could help ? 

Thanks 

0 Kudos
Message 5 of 24
(7,850 Views)

Please have a look at this solution :

When there is timeout error we can send command to the instrument but no reply because it's not available. 

If I send *CLS (clear all event register including the status byte , event status and error queue ) it cancels the wait operation set by *Opc command and no there is no wait and the instrument can response to scpi command again without timeout error ? 

 

Please answer me 

0 Kudos
Message 6 of 24
(7,822 Views)

I don't know if your solution can work but in my opinion you should investigate on the timeout error in order to avoid it. Is this error arising randomly or always on a specific command? In the last case you should check the command syntax and verify if it suits with instruments capabilities. That is, instead of patching a faulty condition, can you try avoiding the fault?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 7 of 24
(7,810 Views)

As Roberto suggested, CLS will not give you the response you need.

The reason for the timeout should be investiated. Maybe the instrument is not ready to give you the result, maybe your command was not understood at all?

Maybe you can query the error status with  SYSTem:ERRor[:NEXT]? command. It will return you 0 or and error/warning code which may be meaningful. The error code explanations would be in the user manual.
The "NEXT" part is a later addition to the standart. If it is an old instrument the error query command may be just  SYSTem:ERRor? .

S. Eren BALCI
IMESTEK
0 Kudos
Message 8 of 24
(7,806 Views)

Thanks for your answer. 

I run my thread in a while loop.

If I'm running one thread there is no error.

With 2 threads at time also no error. 

By running 3 threads here I loose connection. 

I'm sending the same commands in the threads.

While there is timeout error I debug manually I found that opening connection to the instrument Is ok, then by sending the first scpi command to fix frequency here I have the message error time out.

 

0 Kudos
Message 9 of 24
(7,802 Views)

Hello

I used the instrument driver of the instrument so now there are no scpi commands sent to the instrument and visa time out error still occurs.

Have you any explication to this ? 

I'm really blocked.

THANKS FOR YOUR ANSWER 


 

0 Kudos
Message 10 of 24
(7,784 Views)