07-22-2010 03:01 AM
Hello , I am confused of the function of Error Query, since I am really new in this field ,I hope I can learn sth here.
From the Fig111, I have some questions, VISA write in "*ESR?" and then VISA read 10 bytes, then the 999block get the decimal number from it , compare the number to 3 different constant number 16, 32 and 4, what we need is get a False from it ,otherwise error comes up
so can anyone explain the idea or principle behind it?
07-22-2010 03:06 AM
what does *ESR? STA HW? STA OP? these three command mean? I have not find the meaning of it.
07-22-2010 03:53 AM
hi xyq102296,
I think those commands are queries to know about the status of hardware .
1)If *ESR?(some status register) is the query,then output will have the error put in the bit patterns,thats why they are checking if the 3,5 and 6th bit positions are 1's are not(and operation).if any bit position is 1,then corresponding error will be there.
2)Similarly STA HW?is the query to know the status of the hardware and the output of the visa read will give info about the error(checking the 2,4,and 6 th postions are 1's or not)
3)STA OP ?query to knwo the status of operation and output of the visa read will give info about the error...Now all the error are concatenated and the new string is compared with empty string..if empty string ,now error,if not error will be notfied as error cluster to the user.
Thanks and regards,
srikrishnaNF
07-22-2010 04:41 AM
you said, ESR bit 3,5,6 to check the error status whether it is 1 , so *ESR? is just to uesd to check the error condition , then we readout 10 bit of output? after 999 block to get out the decimal number , why do they compare to the 16, 32,and 4 ?
07-22-2010 04:54 AM
hi xyq102296,
actually visa read has byte input,i.e at a time visa read is giving you 10bytes/80 bits of data.Since whatever queries you have given ,they are status queries,so you need to check for the presence of error.They are comparing to the 16,32 and 4(5,6 and 3) bit positions of input data after visa read ,may be the bit pattern is like that.(for clear understanding ,please read the hardware manual).
Thanks and regards,
srikrishnaNF
07-22-2010 05:09 AM
what I cannot understand is that in VISA READ, 10 is the number of bytes to be read.Then you go through the 999 block which change decimal string to number , then compare to 16,32,4, two different decimal number compare to each other , then you know what's kind of error it is ? If I change 16 to 64, the original error in my program dismissed, do you know why?
07-22-2010 05:21 AM
do you mean that logical AND the decimal number come from the VISA READ and those constant number 16, 32, 4?
so ,the decimal number come from the 999 block or ,16 or 32 or 4 they all represent the 2^n bit in the ESR?
07-22-2010 05:38 AM
07-22-2010 06:12 AM
the counterpart of 16 is bit 4 or bit 5? 16=2^4
if the coming number is 64, then it reprenst bit 6 or bit 7?
07-22-2010 06:32 AM