LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there this kind of switch?

I'm using LabVIEW 6i. In my program, I use a timer which compares the
current time with the set time to turn off the program automatically
when the time comes. The timer is in a Case, so I use a switch to make
the Case "True" to start timer.

I'm considering to set a time(which will be one hour ahead of current
time) when the Timer switch is pressed. The problem is that because the
switch is pressed to On position, it will continuously send the current
time to the set time. I don't know whether there is a way that the time
value will only be sent when the switch is pressed. Afterwards, even
though the switch is at On position, the time value will not be sent.

Any one can give a suggestion?

Thanks in advance,

Guangde Wang
0 Kudos
Message 1 of 6
(3,234 Views)
Guangde Wang wrote:

> I'm using LabVIEW 6i. In my program, I use a timer which compares the
> current time with the set time to turn off the program automatically
> when the time comes. The timer is in a Case, so I use a switch to make
> the Case "True" to start timer.
>
> I'm considering to set a time(which will be one hour ahead of current
> time) when the Timer switch is pressed. The problem is that because the
> switch is pressed to On position, it will continuously send the current
> time to the set time. I don't know whether there is a way that the time
> value will only be sent when the switch is pressed. Afterwards, even
> though the switch is at On position, the time value will not be sent.
>
> Any one can give a suggestion?
>
> Thanks in advance,
>
> Guang
de Wang

Check the mechanical action on the switch
It sounds like you have it on Latch when ....
It should be on Switch when ...
This way it will reset to the Off state after you press it.

Kevin Kent
0 Kudos
Message 2 of 6
(3,234 Views)
Kevin,

Thank you for responding to my message. I think I didn't express myself very
well. What I wanted is to respond only to the switch pressing. In the
beginning, when the switch is at "Off" position, I don't want it to do any
thing. When the press is pressed, I want it to trigger an action. After the
switch is turned to "On" position, I want the switch to stay at the "On"
position but without continuously sending the "On" signal. It's not about
latching becasue I want the switch to be at the "On" position after it's
pressed. I don't know whether we have some way to realize it.

Thank you again for help,

Guangde


"Kevin B. Kent" wrote:

> Guangde Wang wrote:
>
> > I'm using LabVIEW 6i. In my program, I use a timer which compares the
> > current time w
ith the set time to turn off the program automatically
> > when the time comes. The timer is in a Case, so I use a switch to make
> > the Case "True" to start timer.
> >
> > I'm considering to set a time(which will be one hour ahead of current
> > time) when the Timer switch is pressed. The problem is that because the
> > switch is pressed to On position, it will continuously send the current
> > time to the set time. I don't know whether there is a way that the time
> > value will only be sent when the switch is pressed. Afterwards, even
> > though the switch is at On position, the time value will not be sent.
> >
> > Any one can give a suggestion?
> >
> > Thanks in advance,
> >
> > Guangde Wang
>
> Check the mechanical action on the switch
> It sounds like you have it on Latch when ....
> It should be on Switch when ...
> This way it will reset to the Off state after you press it.
>
> Kevin Kent
0 Kudos
Message 3 of 6
(3,234 Views)
An easy way to do this is to run the output of the boolean into a shift register
and then compare the current state of the boolean to the shift register output.
If they're different, take some action and if they're the same, do nothing.

Guangde Wang wrote:
>Kevin,>>Thank you for responding to my message. I think I didn't express
myself very>well. What I wanted is to respond only to the switch pressing.
In the>beginning, when the switch is at "Off" position, I don't want it to
do any>thing. When the press is pressed, I want it to trigger an action.
After the>switch is turned to "On" position, I want the switch to stay at
the "On">position but without continuously sending the "On" signal. It's
not about>latching becasue
I want the switch to be at the "On" position after
it's>pressed. I don't know whether we have some way to realize it.>>Thank
you again for help,>>Guangde>>>"Kevin B. Kent" wrote:>>> Guangde Wang wrote:>>>>
> I'm using LabVIEW 6i. In my program, I use a timer which compares the>>
> current time with the set time to turn off the program automatically>>
> when the time comes. The timer is in a Case, so I use a switch to make>>
> the Case "True" to start timer.>> >>> > I'm considering to set a time(which
will be one hour ahead of current>> > time) when the Timer switch is pressed.
The problem is that because the>> > switch is pressed to On position, it
will continuously send the current>> > time to the set time. I don't know
whether there is a way that the time>> > value will only be sent when the
switch is pressed. Afterwards, even>> > though the switch is at On position,
the time value will not be sent.>> >>> > Any one can give a suggestion?>>
>>> > Thanks in advance,>> >>> > Guangde Wan
g>>>> Check the mechanical action
on the switch>> It sounds like you have it on Latch when ....>> It should
be on Switch when ...>> This way it will reset to the Off state after you
press it.>>>> Kevin Kent>
0 Kudos
Message 5 of 6
(3,234 Views)
The method works. Thank you very much.

Guangde


Dennis Knutson wrote:

> An easy way to do this is to run the output of the boolean into a shift register
> and then compare the current state of the boolean to the shift register output.
> If they're different, take some action and if they're the same, do nothing.
>
> Guangde Wang wrote:
> >Kevin,>>Thank you for responding to my message. I think I didn't express
> myself very>well. What I wanted is to respond only to the switch pressing.
> In the>beginning, when the switch is at "Off" position, I don't want it to
> do any>thing. When the press is pressed, I want it to trigger an action.
> After the>switch is turned to "On" position, I want the switch to stay at
> the "On">position but without continuously sending the "On" signal. It's
> not about>latching becasue I want the switch to be at the "On" position after
> it's>pressed. I don't know whether we have some way to realize it.>>Thank
> you again for help,>>Guangde>>>"Kevin B. Kent" wrote:>>> Guangde Wang wrote:>>>>
> > I'm using LabVIEW 6i. In my program, I use a timer which compares the>>
> > current time with the set time to turn off the program automatically>>
> > when the time comes. The timer is in a Case, so I use a switch to make>>
> > the Case "True" to start timer.>> >>> > I'm considering to set a time(which
> will be one hour ahead of current>> > time) when the Timer switch is pressed.
> The problem is that because the>> > switch is pressed to On position, it
> will continuously send the current>> > time to the set time. I don't know
> whether there is a way that the time>> > value will only be sent when the
> switch is pressed. Afterwards, even>> > though the switch is at On position,
> the time value will not be sent.>> >>> > Any one can give a suggestion?>>
> >>> > Thanks in advance,>> >>> > Guangde Wang>>>> Check the mechanical action
> on the switch>> It sounds like you have it on Latch when ....>> It should
> be on Switch when ...>> This way it will reset to the Off state after you
> press it.>>>> Kevin Kent>
0 Kudos
Message 6 of 6
(3,234 Views)
There are probably several ways to do this .

In your true case you can have a sequence frame , you could use a local
variable to ensure it is still in the on state , then disable the control
with a attribute node (disable) if you don't want the user to fiddle with
the front panel switch after it's pressed. Then in the following sequence
frames do your timers or whatever . The starting timer value can be passed
to following frames with a sequence local. Sorry in advance if I haven't
understood your application .

"Guangde Wang" wrote in message
news:3A53A386.1BF76696@MSRIhome.com...
> I'm using LabVIEW 6i. In my program, I use a timer which compares the
> current time with the set time to turn off the program automatically
> when the time comes. The tim
er is in a Case, so I use a switch to make
> the Case "True" to start timer.
>
> I'm considering to set a time(which will be one hour ahead of current
> time) when the Timer switch is pressed. The problem is that because the
> switch is pressed to On position, it will continuously send the current
> time to the set time. I don't know whether there is a way that the time
> value will only be sent when the switch is pressed. Afterwards, even
> though the switch is at On position, the time value will not be sent.
>
> Any one can give a suggestion?
>
> Thanks in advance,
>
> Guangde Wang
>
0 Kudos
Message 4 of 6
(3,234 Views)