alphaone Posted January 9, 2006 Report Share Posted January 9, 2006 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 Quote Link to comment
didierj Posted January 9, 2006 Report Share Posted January 9, 2006 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 Quote Link to comment
alphaone Posted January 9, 2006 Author Report Share Posted January 9, 2006 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? Quote Link to comment
Phillip Brooks Posted January 9, 2006 Report Share Posted January 9, 2006 Using GPIB instruments? If you're working with GPIB based equipment, you can use the event registers if your instrument impliments it correctly. Using Service Requests in your GPIB application Quote Link to comment
WMassey Posted January 9, 2006 Report Share Posted January 9, 2006 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. Quote Link to comment
alphaone Posted January 9, 2006 Author Report Share Posted January 9, 2006 Using GPIB instruments?If you're working with GPIB based equipment, you can use the event registers if your instrument impliments it correctly. Using Service Requests in your GPIB application Alright, thank you, it's what i need:) Quote Link to comment
alphaone Posted January 10, 2006 Author Report Share Posted January 10, 2006 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.