Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I'd like to switch on an instrument and read the data every 60 seconds using serial VISA thru RS-232.

The time between the first and second readings fluctuates between 25 to 60 seconds. Beyond the 2nd reading, the time interval is exactly 60 seconds as programmed. I've tried to clear the buffer before and after each reading but did not succeed. Thanks. DNA VI is attached.
0 Kudos
Message 1 of 4
(3,517 Views)
The time between the first and second readings fluctuates between 25 to 60 seconds. Beyond the 2nd reading, the time interval is exactly 60 seconds as programmed. I've tried to clear the buffer before and after each reading but did not succeed. Thanks. DNI've looked at your vi, and have a couple of questions:

1. How are you turning on the machine? Is there a serial string that is sent, or are you simply turning on power at the instrument?
2. How do you aquire data - do you send a data request string first?
3. How is the 60 second wait programmed - at the instrument level or through your vi delays?
4. What is failing - do not see any data, see corrupted data, see too little data, etc.?
5. Is the expected data always the same amount - 10 bytes, 100 bytes, etc.?
6. Why are you using a lock function on a serial port? I've not seen that done before (more of a curiosity).
0 Kudos
Message 2 of 4
(3,517 Views)
The time between the first and second readings fluctuates between 25 to 60 seconds. Beyond the 2nd reading, the time interval is exactly 60 seconds as programmed. I've tried to clear the buffer before and after each reading but did not succeed. Thanks. DNAnswer:
1) The machine is turned on by sending the first request string at sequence #0 and the data is read by a string at sequence #1.
2) The 60 seconds is controlled through vi delays.
3) Perhaps my question was clear. The attached VI failed to switch on the machine exactly 60 seconds after it was turned on the first time. It performs flawlessly once it was turned on the second time.
4) The expected data are the same each time (10 bytes).
5) I thought I need a lock function for any serial communication.
0 Kudos
Message 3 of 4
(3,517 Views)
The time between the first and second readings fluctuates between 25 to 60 seconds. Beyond the 2nd reading, the time interval is exactly 60 seconds as programmed. I've tried to clear the buffer before and after each reading but did not succeed. Thanks. DNAh - I think I know the problem. The "wait until" timer needs to be initialized, otherwise it will be short on the first loop iteration. KB#2G27ANEW talks about this and how to initialize the timer. Also, instead of the "wait until" vi, you can use the "wait" vi which will give you a delay of exactly 60 seconds.

Does this help?
0 Kudos
Message 4 of 4
(3,517 Views)