LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

comparing switch control and switch output and setting switch control accordingly

Hello,

        i am developing a GUI for a system which contains relays to control the motors. For the same purpose i am using switch control on my GUI to control these relays.when these relay  are turned ON by the switch control on my GUI, they give back status to the GUI, which i am displaying as a switch status .

Now the switch control and switch status on GUI must be same every time so that user can know the actual state of relay and control it.

Now i have a condition when i have already turned ON switch from my GUI but due to some reason (may be communication fault or anything else) rellay is not turned ON and i get status of relay as OFF on my switch indicator. So the situation is" the switch control is in ON state and switch indicator displays OFF state".  which is practically wrong.

I want that in this case the GUI should detect the status of the switch indicator and if the switch control is not the same , the switch control should be set as per the switch indicator so that user can use the switch again to turn the switch ON

0 Kudos
Message 1 of 5
(3,465 Views)
So if a switch is turned on and the led doesn't also turn on within some period of time you want the switch to turn back off? That is potentially a very confusing interface. But...

Assuming an event-driven interface, a value change event on the switch sends the commands to.open and close the relay. Have a timeout event that is reading the states of all the relays and set the led and switch to match using the value properties so as to not fire the value change event.

If you aren't using events, that's the first change you need to make.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(3,447 Views)

Hello Mike,

                    Thanks for the response!!

As i have described the situation above, in any case if switch control fails to send message to relay due to some hardware fault , in that case relays will be off and the switch on GUI will be ON , and user will think that the relay is ON.Which is false condition.

i tried to use property value(signl)   to give back the status of switch indicator to the switch control.

You can have a look at attached files which i have made as demo.

Now the problem is when i run my GUI for the first time all the switch on the front panel are off by default which creates a conflict to control the switches.

Besides i am unaware of the timing events and how to implement it in my application . It would be great if you could provide some more details about it.

 

Thanks & Regards,

Shivkant Paswan

 

 

0 Kudos
Message 3 of 5
(3,400 Views)

I usually just have another LED to show the current status of the switches.  Since you should have another loop or something constantly reading the status, the LEDs will always be up to date.



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 4 of 5
(3,378 Views)
This would actually be the solution that I would recommend as well. This is a very common type of interface that a user would likely recognize, even without training.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 5
(3,364 Views)