I am trying to control e4980a LCR meter using VEE. I have to send a series of commands (about 200) to the instrument. I used the OPC bit of the status byte and tried a serial poll before continuing,but it some how seems to still send more commands to the instrument in quick succession. Now, I also tried using another register which is specific to the operation Im trying to perform but the error is still there. I am effectively doing this:
:STAT:OPER:ENAB // earlier I used *ESE 1 i.e. the operation complete bit
*CLS *WAI :CORR:SPOTn:SHOR -- this is the command im trying to execute //earlier I had a *OPC also included here Serial poll 32 //earlier i masked 128
the loop execute about 50 times but only 10 cycles of operations have been performed and then the error pops up. The program stops but the instrument continues to make further measurements.
Yes, delay would solve the problem, but then choosing the right delay is always not possible. if you over do it, then the program becomes very slow especially since my program needs to make many iterations.
The OPeration Complete command is supposed to do just that and its common in most agilent instruments but it doesnt seem to be working in the one Im using And the command im trying to use does not have to return any data.
I guess in your for loop, there is a read value transaction, maybe getting inductance or capacitance reading which giving you timeout error? I have not deal with this instrument before but if that is the case, that probably could be the instrument still processing the value and no result is available, thus timeout error. To know further details, after the timeout error, send few *SYST:ERR? command to check if there is more details on the timeout error. Oh, be sure to clean the system error register before the program start.
*OPC and register is very instrument dependent. It is good to verify if those command works for your instrument for that particular operation or not.
Not sure if you have use IO Monitor before. Run it, start the transaction capturing, then run the program for one or two loops, to verify the actual command(s) need longer time to process, then put delay after that particular command(s). Or maybe lengthen the timeout duration before the loop could be an alternatives too.
Oops, I just read your command doesn't return any value. I'd encounter a situation before where I am sending command A and B. After sending command A, I need a delay of around 5s for the instrument to complete the operation, then only sending command B.
thanks..I would like to make the program with out any delay and preferably get some confirmation from the instrument itself since this might make it faster.
I am also getting error 410 - query interrupted. I could attach a small 4-5 element VEE program highlighting the place where I get this error. could any of you debug it then? I am trying to do a serial poll with a mask for one of the status bits.
the timeout problem has been solved. I was issuing commands to the LCR meter through a for loop that runs 201 times. The LCR meter was not able to catch up with VEE. So I used serial polling to check the operation complete bit in a specific status register and thus the error is now gone. I also tried to use a delay and that solved it too..
Now, Inorder to clear the status bits, some how, *CLS doesn't work ( though it is supposed to clear the relevant bits too). I am having to query the particular status register to clear it. any suggestions?