12-26-2016 06:25 AM
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
12-26-2016 11:17 AM
OPC is a query which asks instruments if OPeration is Complete or not. So I dont think it would help.
12-27-2016 02:37 AM
*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 ?
12-27-2016 06:45 AM
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.
12-27-2016 07:33 AM
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
12-27-2016 01:19 PM
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
12-27-2016 03:48 PM
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?
12-27-2016 11:25 PM
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? .
12-28-2016 03:14 AM
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.
12-28-2016 09:30 AM
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