LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

physical boolean transferred to mechanical boolean that latches

Solved!
Go to solution

Hey,

 

I have a few questions.  So I have a physical box with a yes and no button.  I have connected it up to my DAQPad 6015 to be read as a digital input.  I have used the Read Dig Chan.VI and have reduced the physical channel to read Dev1/port0/line1:2.  So, when I press yes, the hex data read says '1' and when I press no it says '2'.  What I am struggling with is having that number stay once yes or no are pressed.  I have tried using an event structure but for some reason it muddles up the program and niether the booleans light up or the event I specify happens.  So, to clearly state my objective, I want to have a program which ramps up until I press yes or no, at which point the ramp will plateau (yes) or completely shut off (no).

 

Hope that makes sense.  Thanks

Katie

0 Kudos
Message 1 of 15
(3,820 Views)

Maybe something like this (LV8.5.1)?

Message Edited by altenbach on 01-14-2009 01:42 PM
Download All
Message 2 of 15
(3,803 Views)

Of course in your case you would replace the two buttons with the output from "=1" or "=2" comparisons of the DAQ value., etc. 🙂

 

What is the output of the box if nothing is pressed (zero?). Since you have a single input, things could be simplified even much more.

0 Kudos
Message 3 of 15
(3,793 Views)
Solution
Accepted by topic author remotecntrl

OK, here's a solution with the 0,1,2 integer ouput.

 

Use a case structure with three cases as follows:

 

0: keep value from shift register/feedback node

1: output TRUE from the case structure

2: output FALSE from the case structure

 

 

 

Message Edited by altenbach on 01-14-2009 02:12 PM
Download All
Message 4 of 15
(3,791 Views)

Yes, if no button was pressed then you would get zero.  How do I find those green arrows?  I have version 8.2.1.

 

 

0 Kudos
Message 5 of 15
(3,775 Views)
Thanks so much!   Smiley Happy
0 Kudos
Message 6 of 15
(3,772 Views)

Here's the 8.2 version.

 

(8.5 does not support globlly initialized feedback nodes, so I had to do a few minor changes).

 

You can replace the feedback node with a shift register if you want.

Message 7 of 15
(3,770 Views)
Thanks so much! That solutions works well.
0 Kudos
Message 8 of 15
(3,738 Views)

I've been searching the forums, and this vi is very close to what the solution I need is, but not quite... perhaps you can help me adjust it please?

 

I have an instrument whose output shares a byte between two signals: a gps, and a signal (gain).  Every 512 seconds the gps turns on to deliver a time-stamp to the instrument, and it trumps the gain signal that shares the byte.  At all other times, the gps is dormant, and the byte is devoted to the gain signal (either high, low, or unknown when the gps is time-stamping).  Once the gps is finished time-stamping, the gain signal is once again carried by the byte.  At this point, I would like to read the gain byte from the instrument to verify the setting is still the same, and while the gps is activated, I would like to have some indication on the screen that this is so.  Mind you, the signal *should* be the same, but I would like to construct my vi without any doubt.  My guess is that this will require an additional input to the feedback loop that is a direct read from the gps/gain byte, but I do not know the simple step to convert the string byte (known location, 'CC') to something compatible with your example.

 

So... 

(1) Does LabView have a three-way switch option (high, disengaged, low), or can it be cleverly engineered?

(2) Is it possible to have multiple text indicators transmit to the same location on the front panel depending on the case?

(3) Should I just change my string byte to a boolean and place it somewhere in the feedback loop? (if case 'CC' then True, connect to the Build Array maybe?)

 

I hope this isn't too convoluted.  I mean- I hope my predicament is clearly explained.  Let me know if I should provide more details. 

Thanks for your help!

 

 

0 Kudos
Message 9 of 15
(3,701 Views)

(1) Does LabVIEW have a three-way switch option (high, disengaged, low), or can it be cleverly engineered?

 

All of the switches we provide are booleans, there are no tri-state switches.  Of course they can be cleverly engineered - an enum with 3 items may work, two booleans together can represent 4 cases which can be converted with 'byte array to integer' and then fed into a case structure, I am sure there are many ways to do this, some simple, some Rube-Goldbergish

 

(2) Is it possible to have multiple text indicators transmit to the same location on the front panel depending on the case?

Local Variables or References to front panel elements/

 

(3) Should I just change my string byte to a boolean and place it somewhere in the feedback loop? (if case 'CC' then True, connect to the Build Array maybe?)

 You could parse the string for 'CC' and if it exists, then pass a true value to ignore it or whatever you want to do with it

Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 10 of 15
(3,688 Views)