LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keisight 34972 Relay Control execute time very long with LabVIEW in Teststand

Solved!
Go to solution
i use 34972 digital multi meter as relay switch, when I run the VI to control the relay to open or close, it take very long time at first run this VI in teststand every execution. I do not know why, is there anyone could give me some suggestion, thank you very much in advance.
0 Kudos
Message 1 of 7
(1,854 Views)

Posting the code you use would help solve the mystery.

0 Kudos
Message 2 of 7
(1,818 Views)
Hi cstorey thanks for reply. I ues 34972 relay, and the control command as: ":route:close@xxx" at the beginning, i will open VISA, think may be the time long here. but i do not know how to optimize, unfortunately, i could not attached any thing on this page, regards vikke
0 Kudos
Message 3 of 7
(1,787 Views)
Solution
Accepted by topic author vikkenie

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

0 Kudos
Message 4 of 7
(1,774 Views)

 You are right.

0 Kudos
Message 5 of 7
(1,762 Views)
Hi Craig did you tried 34972/34970 Open VISA time, how long it take?
0 Kudos
Message 6 of 7
(1,722 Views)

Sorry, I don't have one for testing at the moment. 

0 Kudos
Message 7 of 7
(1,701 Views)