LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Function of Error Query.vi?

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?

 

Download All
0 Kudos
Message 1 of 14
(4,117 Views)

what does *ESR?     STA HW?   STA OP?  these three command mean? I have not find the meaning of it.

0 Kudos
Message 2 of 14
(4,115 Views)

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

Regards,
Srikrishna


0 Kudos
Message 3 of 14
(4,105 Views)

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 ?

0 Kudos
Message 4 of 14
(4,096 Views)

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

Regards,
Srikrishna


0 Kudos
Message 5 of 14
(4,091 Views)

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?

0 Kudos
Message 6 of 14
(4,085 Views)

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?

0 Kudos
Message 7 of 14
(4,079 Views)

hi xyz102996,

  Yes ,logical and of the 80bits with 16,32 and 4 will give the bit postions of the 5,6 and 3 respectively in the ESR.

 

thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 8 of 14
(4,072 Views)

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?

0 Kudos
Message 9 of 14
(4,065 Views)

Hi xyz102296,

 Yes the counter part of 14 is 4 i.e 2^4..I am saying as a bit position including 0 the place..(I tool 0 th place as bit position 1).

 

 

thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 10 of 14
(4,060 Views)