Jump to content

VISA READ


alphaone

Recommended Posts

Hi guys, I use VSA to measure the Channel Power, the average number is setting to 100. I write the ":READ:CHP?" and then execute the "VISA READ", but at this time, the measuring is not finished.

so, the ERROR "Time out" will appear.

How can i judge the measuring is done? I don't want to use "delay" :) .

Thanks

Link to comment
Set the timeout to a higher value. So your VISA-read will wait a longer time.

To set the timeout go in the palette to Instrument I/O -> VISA -> VISA Advanced. There select VISA Set Timeout.

Didier

yes, that was the way i tried, but i think some poll mechanism will be better~.

i don't find the SCPI command for this yet. Could you have some advice?

Link to comment
yes, that was the way i tried, but i think some poll mechanism will be better~.

i don't find the SCPI command for this yet. Could you have some advice?

Well if you don't want to wait and do want to poll try using the "VISA Bytes at Serial Port" function to see when there are enough bytes waiting to be input to attempt a read.

You could also setup another asynchronous process (or loop or state) whose job it would be to hang on the read until a complete response were available and then make that response (possibly with a timestamp) available (queue, global, LV2 global, ...) to the rest of your code before going back to wait again.

Link to comment
Well if you don't want to wait and do want to poll try using the "VISA Bytes at Serial Port" function to see when there are enough bytes waiting to be input to attempt a read.

You could also setup another asynchronous process (or loop or state) whose job it would be to hang on the read until a complete response were available and then make that response (possibly with a timestamp) available (queue, global, LV2 global, ...) to the rest of your code before going back to wait again.

Yes, this asynchronous process is quite necessary. The seperation of the WRITE and READ can clear and simlify the instruments controlling i think. Thank you for the inspiration. :)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.