How do I initialize a boolean control to a read value

I need to perform a "read from digital line.vi" which I will get a
boolean value x from a read port of a switch. I want to initialize a
control write line (write to digital line.vi) to this x value. This is
so the INITIAL boolean control button is showing the present state of
the switch before it is set to another value. New to labview (version
6.0i) , what is a good way to do this?
thanks
( PC-DIO-96 card )

Hi,
Right click on your control, select Create/local variable. Then wire the output x from "read from digital line.vi" to the local variable. This way the control will be set to the value x.
Hope this helps,
Dan

Similar Messages

  • Using an event structure to reset a boolean control with ring menu value change

    I am trying to get two boolean buttons to reset when the value of a ring menu changes.  For this I am using an event structure set to execute with a ring value change.  However I have other code that needs to be executing while the event structure waits for the value change.  I place my event structure inside the while loop the buttons reset as expected but my other code does not run (except at the moment of value change). If I place it outside the loop the rest of the code functions as expected but the buttons do not reset.  Any help you can offer is much appreciated.
    Solved!
    Go to Solution.
    Attachments:
    event structure reset.vi ‏11 KB

    try this
    Attachments:
    event structure reset_edit.vi ‏14 KB

  • How can you create a local variable from a boolean control?

    I want to create a local variable from a boolean control, but it says that boolean latch actions are incompatible with local variables, but I need a way to check this boolean control in two differents loops, how can I do it?

    "Graci" schrieb im Newsbeitrag
    news:[email protected]..
    > I want to create a local variable from a boolean control, but it says
    > that boolean latch actions are incompatible with local variables, but
    > I need a way to check this boolean control in two differents loops,
    > how can I do it?
    Use global variables.
    Compare them with a constant Boolean like F or T.
    The result is true or false and then you can use it in a Cae-Loop.
    Martin

  • How to implement a boolean control via network

    Hi,
    I am developing an application by using LabVIEW 8.2 and RealTime. There is a host PC connecting to a PXI
    through network cable. Application VIs are running at PXI and GUi is running at host PC. My problem is
    When I config a boolean control as "Latch when release" mechanism, pass it to a shared network variable
    and then to a boolean control at PXI. "Latch when release" mechanism seems not run very well. Most of the
    time, no action when I press the boolean control button in my GUI. It seems that shared network variable
    could not act as "Latch when release" mechanism. I checked some examples from NI. Most of examples set
    the boolean control button mechanism as "Switch when press" and manually switch it status later on. I have
    a bunch of such boolean control buttons in my GUI. It will be hard to handle every of them in this way.
    I'd like to know whether there is an easier solution for this.
    Thanks
    Jason

    Hi Jason,
    How are you passing the shared variable to the Boolean control in PXI VI?
    Here is something to try out.
    --Configure the Boolean controls on both systems to "latch until released".
    --Create the shared variable (network-published) on the host PC and wire the output of the Boolean control to it.
    --On the remote system, bind the Boolean control to the shared variable on the host PC. To bind to the shared variable, right click the Boolean control 
       and select properties. Then select the "Data Binding" tab in the property window. Set the "data Binding selection" option to "Shared Variable Engine
       (NI-PSP)" and browse for the path to the shared variable created on the host PC.
    --With this setting, whenever the Boolean control on the remote system (PXI) reads a true value, it stays true until the value is read by LabVIEW and
        goes back to the initial (false) state.
    Checkout the attached sample LabVIEW project.
    Tun
    Message Edited by Tunde A on 12-12-2006 05:27 PM
    Attachments:
    Boolean Shared Var.zip ‏18 KB

  • How to implement boolean control via network

    Hi,
    I am developing an application by using LabVIEW 8.2 and RealTime. There is a host PC connecting to a PXI
    through network cable. Application VIs are running at PXI and GUi is running at host PC. My problem is
    When I config a boolean control as "Latch when release" mechanism, pass it to a shared network variable
    and then to a boolean control at PXI. "Latch when release" mechanism seems not run very well. Most of the
    time, no action when I press the boolean control button in my GUI. It seems that shared network variable
    could not act as "Latch when release" mechanism. I checked some examples from NI. Most of examples set
    the boolean control button mechanism as "Switch when press" and manually switch it status later on. I have
    a bunch of such boolean control buttons in my GUI. It will be hard to handle every of them in this way.
    I'd like to know whether there is an easier solution for this.
    Thanks
    Jason

    Hi Jason,
    How are you passing the shared variable to the Boolean control in PXI VI?
    Here is something to try out.
    --Configure the Boolean controls on both systems to "latch until released".
    --Create the shared variable (network-published) on the host PC and wire the output of the Boolean control to it.
    --On the remote system, bind the Boolean control to the shared variable on the host PC. To bind to the shared variable, right click the Boolean control 
       and select properties. Then select the "Data Binding" tab in the property window. Set the "data Binding selection" option to "Shared Variable Engine
       (NI-PSP)" and browse for the path to the shared variable created on the host PC.
    --With this setting, whenever the Boolean control on the remote system (PXI) reads a true value, it stays true until the value is read by LabVIEW and
        goes back to the initial (false) state.
    Checkout the attached sample LabVIEW project.
    Tun
    Message Edited by Tunde A on 12-12-2006 05:27 PM
    Attachments:
    Boolean Shared Var.zip ‏18 KB

  • Import a column from an excel spreadshee​t, then enable/dis​able boolean controls in a cluster based on imported values

    Greetings all. I have an application I've been developing and refining for some time.  Part of it entails an interactive periodic table of elements where the user can select multiple elements to include in a multi-element chemical standard.  The part I'm having difficulty with now is disabling multiple elements within the periodic table.  Specifically, what the scientist wants is to be able to reference an excel inventory that they keep of available on-hand single-element standards.  I need to be able to read in column A of that spreadsheet, build a distinct array of those elements listed (some are listed more than once) and then disable the boolean controls in my periodic table for those elements not in the array (or enable those elements which are in the array, whichever makes themost sense).  This way, the analyst cannot select elements in the periodic table for which thay have no on-hand inventory.  I see how to enable or disable all controls in a boolean cluster, and I see how to enable/disable a single control, but I'm looking for an elegant way to import the excel column, build an array of thsoe values and then enable only those values.  Any help is always appreciated.  Thanks again.

    hi
    try this
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.
    Attachments:
    Excel column read.vi ‏29 KB

  • Event execution based on the changing direction of boolean control value

    Generally an even case is executed as long as the value of a boolean control changes, no matter the change is from true to false or false to true.
    However, if I want to event case1 to execute if false to true, and case2 to execute if true to false, how to implement this?
    Thanks in advance.

    Dejun wrote:
    NI forum support is much more efficient than tele support!
    And we don't play cheesy elevator music while you wait.
    LabVIEW Champion . Do more with less code and in less time .

  • Aligning Boolean Control to Plot Legend

    Any ideas on how best to align an array of tick boxes against a plot legend?
    I have a 1D array of Boolean controls and I want to use them to enable/disable the plots on a XY graph but I'm having problems getting the controls to line up with the legend text.
    I've tried using element gaps in the array but there seems to be little control of the gap that is used. I've also tried creating a custom control and modifying the control height but I still can't get an exact alignment of the control to the legend text. I've also tried using different fonts for the legend text but it doesn't help.
    I don't really want to use individual controls and would prefer to continue using an array if possible but I can't help thinking I'm missing something obvious!?
    I've attached and example of the problem and would welcome any suggestions....

    Sorry, apparently the resize operation does not survive a save operation. Weird! It looks just fine until closed and reopened.
    Here's an approach that actually works: Just use a plain boolean button and import the appropriate checkbox graphics into the true and false cases, again using the control editor.
    See if this suits your needs!
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    LegendExampleMOD2.vi ‏29 KB

  • Controlling the Boolean Controls and generating Numeric Output correspondingly

    Hello everyone,
    I am working on a project of electrode activation, here I was thinking that how could I control one electrode at a time and generate a numeric output of it correspondingly. I want to substitute each electrode with a an LED on Front Panel and generate numeric value of each LED on Block Diagram.
    So it can be divided into two parts
    1- Control the Boolean outputs
    Here, my target is that if I have 5 leds who are used as Boolean control, should be controlled in such a way that only one of them glows at a time and the remaining turns off.
    I mean that for instance if #3 was glowing and the user pressed #2 then #3 should be turned off and only #2 glows.
    2- Generating Numeric value correspondingly
    Then according to the position of LEDs I want to generate a numeric value correspondingly, like previously output 3 was coming and the output 2 comes when second LED glows.
    I request all the participants on this group to help me on it.
    Regards
    Solved!
    Go to Solution.

    Thanks very much Dennis, Its really what i need.
    But i have a bounding in the radio button to place all option together. 
    Since i am activating the appropiate electrode on the body, all the options could not come vertically or horizontally.
    So can you pls guide me how can i make my 5 electrode behave like a radio control.
    Thanks once again.

  • Boolean control for integer value

    I am writing wrapper VIs for a DLL, and demo programs to, well, demonstrate their use
    I have several functions which take the same structure as an input.  This structure has several integer fields (U16, if you must know) which are logically booleans (that is, only valid values are 0 and1, and in fact at some level they are converted into a single bit each).
    My VIs currently work, using a cluster that is laid out exactly like the structure.  However, I would like the interface to be prettier and easier to use.
    What I want to do is to show each of these fields as a pushbutton.  However, if I change them to pushbuttons, the cluster's internal representation is now different and I can not pass it into the DLL function.
    The only solution I have thought of is to have an input cluster with pushbuttons, then unbundle the whole thing, convert all the bools to ints, and then rebundle.  This is very cumbersome.
    Is there any way to have an integer field appear as a pushbutton (or other boolean-style) control, while remaining represented as an integer?  Or any other createive ideas?
    Thank you.
    B.

    Smercurio,
    Thank you.  I don't even know what an XControl is! 
    I was thinking of using unbundle by name -- but at least half of my cluster is this kind of field, so it will get a bit messy anyway.  Also, if I am taking apart one type of cluster and building a different one, with different types, is it actually possible to only unbundle part of it?  I haven't tried it, but somehow it doesn't make sense in my mind.
    The menu ring is an interesting idea and sounds like it might be a reasonable solution, though pushbuttons are nicer; I'll have to play around with it and see how it looks.
    Mark,
    In general, I agree with you about separating the UI and the implementation, and that is how I generally write applications.  You are 100% right that it is the correct approach to engineering an application.
    The difference here is that my applications are really just demos of the library we create, and thus I don't really have to worry about giving the GUI a new look and feel or such things -- there is very little chance that my company will invest engineering time in changing the look and feel of the demo programs!
    We control the DLL, and we have to stay backwards compatible for our customers, so we don't have to worry about it changing.  We certainly don't have to worry about switching DLLs -- the entire purpose of this VI library is to wrap the DLL for customers who use LabVIEW!
    If I were just doing this in the GUI, it would be one time and maybe I'd just do it.....but I wanted to make a custom control which would be at the interface to the VIs also (they can be run manually also).
    At this point I am thinking of either the menu ring or of making a subvi which takes the UI type of cluster with booleans and does all the bundling and unbundling and type changes.  I'd still have to do it, but once, and it would be basically hidden.
    Hmmmm....
    B.

  • How to make a valve in control editor?

    I want to make a control function in Labview5.0,but I don't know how to make it,for example I will make a valve that is a control funtion,how to make it properly

    If you were to go to Search Examples>Demonstrations>Process Control>Control Mixer Process, you'll find a VI with several custom controls including a valve. All it is is a boolean with custom images. To make your own, use a drawing program like Paint and make images of your valve in the open and closed state. Place a boolean control on a VI's front panel and choose Edit Control from the Edit menu. Once in the control editor go to customize mode. Choose Import Picture From File from the Edit menu. Right click the boolean control and choose Picture Item to Replace to determine which picture to replace with the one from file (a boolean actually uses 4 pictures but you only need to replace the first two which are the true and false states). Right click again and
    choose either Import Picture or Import at Same Size. Repeat for the other boolean state with a different picture. You should save your changes as a .ctl so that you can easily use it again.

  • Boolean Controls on a Hidden Page in a Tab Control

    Hello everyone. 
    I am having some issues with a tab control in a fairly complex program put together by another (more experienced) developer. The basic setup for this tab control features several tabs to control various aspects of a system (motor setup, video setup, general parameters, etc.). Going to a specific tab and pressing Ctrl-F8 brings up a password prompt, which then displays the "Advanced" menu. The advanced menu is a hidden page within the same tab control. The advanced menu contains several Boolean controls that allow access to the various advanced setup features (these pages are also hidden pages on the same tab control), however, none of the Boolean controls are functioning. Clicking on the controls does not cause the buttons to appear pressed, either when running the program as a compiled executable, or while on the front panel of the VI in LabView. The hidden pages also appear as dark grey. I have confirmed that the same is true for all of the hidden pages within the tab control. I believe that my issue is with the version of LabView that I am using. The program was designed in 8.0, whereas I am currently using 8.2. I have not been able to find any references to such an issue between the versions, and I am somewhat at a loss as to how to correct it. Version 8.2 is the only version I currently have access to, otherwise I would use version 8.0, to see if that corrects the issue.  Programs that were compiled previously by the original designer do function properly (hidden pages, when displayed, still appear dark grey), but even compiling the unmodified source code results in the same problems for me. 
    Any help that you could offer would be greatly appreciated. P.S. I would be addressing these problems with the original designer, but he is currently on vacation for a month and I wish to get this resolved.  
    Solved!
    Go to Solution.

    jack47 wrote:
    If a page in a tab control is hidden it will appear 'dark grey', and all of the controls on that page will behave as if they are disabled.  If you 'right-click' on the page name, and select 'Advanded->Show page' it will turn light grey.  Now you should be able to change the controls when the VI is not running.  If the page is shown during operation and the controls still do not function they are probably disabled.  You can check by 'right-clicking' on the control and going to 'Advanced -> Enabled State'.  Also it is possible that they are disabled programatically using a property node.
    I am leaning towards this as the issue, at the moment. I just find it very odd that the controls work in the 8.0 compiled program, but not my 8.2 compiled version.
    I will have to show/hide each page when it is accessed/left.

  • Why do my Boolean control get a different display when I the controls grayed out?

    I have some Boolean control in a cluster which I grayed out programmatically. If I do that this control's get grey as expected. But if I do that with Boolean which are grouped in a decoration field then the control become a blue style. How can I change the grayed out color?
    Solved!
    Go to Solution.

    Hi Gerd,
    attached a VI with this behavior. The Boolean are on page Battery Test and they are called Save Test and Load Test.
    Attachments:
    grayed out example.vi ‏34 KB

  • How to run VI using bolean control?

    How to run VI using bolean control? Do I need to use invoke node or something else?
    Thank you in advance.

    You cannot start running a vi using a boolean on the front panel of that same VI. Detecting the state of the control requires the VI to be running.
    Maybe you can clarify WHY you need to do this. The run button is for VI development. Once you have a final application, it should be set to "run when opened". The actual code could start out in a wait loop (or wait event) such that pressing a certain button will trigger execution of the main code as needed.
    LabVIEW Champion . Do more with less code and in less time .

  • Synchronization start/abort fetch by boolean control with postprocessing queue

    Hello dear colleagues!
    Thanks for your support, I ask you still to help to understand the following:
    How correctly to supervise on/off of Fetch function? (An example of that what I did already, please see the enclosed file).
    I.e. I explain conditions: it is necessary for me start/abort Fetch cycle on boolean control, i.e. then when it is necessary. 
    And one more condition I wish to adhere Fetch cycle at least approximately by 1st second (in my example and it turns out).
    Further, it agree my example, I consider quantity of second cycles and accordingly I understand, that Fetch have accepted so much that data for so much that seconds. Boolean control is in position true a certain interval, from 1st till 100 seconds.
    The postprocessing cycle (detecting of peaks) lags behind a fetch cycle for 1 second approximately.
    My example works, but it is not always correct (as it seems to me), i.e. sometimes fetch works once again than it is necessary, or on the contrary it is less.
    I consider, that where that in a code I have broken sequence Fetch and Abort. 
    I ask you to correct a code as consider it necessary (there it very little). 
    In other words, I need somehow programmatically to distinguish, that postprocessing of a current interval of gathering (from 1st till 100 seconds) stopped and to make by this criterion some actions. 
    I don't want to use any timers, there can be a turn/semaphores or new queue, etc. will help??
    Sorry for my English. Please, advise me.
    Message Edited by Current 93 on 11-17-2009 06:04 PM
    Attachments:
    8ch_I8_bool_control_reset_before_fetch.vi ‏43 KB

    There are numerous issues with this code.  Here are the things you can do to make it much better:
    The enqueue in the top loop needs to be inside the Waiting case.  It will feed empty packets to the analysis loop when waiting.  This is not good practice.
    You have not implemented a way to stop either loop.  The previous suggestion for the top loop would probably work for both, since closing the queue will cause the bottom loop to error and exit.
    Your code for "x+y" would be better handled with a shift register.  Better yet, simply wire it to the iteration terminal on one of the loops.  The bottom shift register on the top loop is a reimplementation of the iteration terminal output.
    You could use an event structure for handling changes in things like the channel.  However, this would complicate your code quite a bit, since it would require a state machine wrapper on your analysis code and another loop for the event structure.
    The implementation of "texp" makes the top while loop into a FOR loop.  If your LabVIEW version is new enough, consider using a FOR loop with a conditional terminal (abortable FOR loop).
    See what you can do and post your results.  If you get stuck, let us know.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

Maybe you are looking for

  • Pages will only allow me to add two pages at a time?

    I am sure this is an easy question. When I add a page Pages wants to keep pages in pairs. I can't delete just one page, I have to delete a pair. How do I stop this as I am wanting to compile a PDF in the end that does not have to be printed and this

  • Error 43 when trying to export movie to image sequence

    Hello, I'm trying to export a movie to image sequence. I did this successfully on our other xp machine but am getting an error 43 message with this one. I have searched online and on the forums and can't find a solution. Help would be appreciated. Th

  • HT2474 the 3 buttons on the left top corner went missing i.e delete(X), minimize(-), maximize(+)

    my computer macbook air version 10.7.5 recently have the 3 top left corner went missing as if the whole horizontal bar were lost and I cant close the file on safari. also  the remaining top remaining bar where the apple logo needs to be pull down eve

  • Can't get print cartridges back into slots.

    I just got the printer and removed the cartridges which was difficult.  I tried to reinstall them and cannot get them back into the slots.  What am I doing wrong?  I don't want to damage the slots.

  • Where is my plugins folder on a Suse 11.4 installation

    I am having a very difficult time getting java installed in a Suse 11.4 installation of Firefox 5. This is a 64 bit system. I have used or created a "plugins" folder in the following locations: ~/.mozilla/plugins ~/.mozilla/firefox/plugins /usr/lib64