From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to know that a switch is really closed/open?

Hello,

i am controlling a switchbox by sending SCPI commands like ROUT:CLOSE (@1001) and ROUTE:OPEN

After sending the switch command i always send a *OPC? an wait for the returning 1.

Question: Is the 1 only that command finishes executing or also that the hardware physically is really closed?

Would i be better to add a "wait" behind each switch command?

Thx

 

 

0 Kudos
Message 1 of 4
(2,475 Views)

Most devices will respond to the OPC when all commands have been executed.  But if you want to be sure, see if you can query the device about the switch state.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(2,469 Views)

Yes there is a query-command.

But how can i be sure the query returns the real hardware-state and not that the instrument received a close command in the past? I dont think that switch hardware has an extra switch at each end position (open/close) that is switched if the main switch received the position.

0 Kudos
Message 3 of 4
(2,462 Views)

Usually it's enough to know you've sent the command or read the info, but if the system is uncertain e.g. if it can be obstructed, you'll need a sensor to make certain.

Of course your previous question can be used ad nauseum, how can you be sure the sensor gives the correct value? Well, in e.g. some fighter planes they have 3 systems, so that 1 failure can't fool you. But what if all 3 are broken? That chance is considered so small the plane is most probably shot down in that case ...

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 4
(2,445 Views)