02-17-2020 12:05 AM
Solved! Go to Solution.
02-17-2020 04:04 PM
Posting the code you use would help solve the mystery.
02-24-2020 01:56 AM
02-24-2020 01:41 PM - edited 02-24-2020 01:46 PM
You should initialize a VISA session only once, then open/close the relay probably in a loop, then close VISA session when program termnates. What will really slow you down is opening a VISA session (possibly resetting the instrument and querrying the instrument ID) then closing the relay all inside a loop. I'd guess that might take 2-5s, whereas just closing the relay should take 60ms.
Opening, reseting, ID querry should be done just once before the real measurement starts. Using a state machine design pattern, this would be done in the INIT state. Then in your code where things are time sensitive you send just the one command to OPEN/CLOSE the relay.
Craig
02-24-2020 06:11 PM
You are right.
03-13-2020 01:26 AM
03-17-2020 10:09 PM
Sorry, I don't have one for testing at the moment.