CHANGE OF STATE

Dear all,
I want to write an application involve change of states of an indicator.
The indicator will by default will be green in colour and will only change to to either amber or red colour.
I need the program to output an message only when there are certain conditions arise. The conditions are:
 i) green to amber
 ii) green to red
 iii) amber to red
 iv) red to amber
The rest of the conditons there will be no message output.
What are the best ways to write this program? Is it more efficient to use state machine, event structure for this application?
Anyone can help out with this? Thanks so much!

Joven wrote:
That is indeed an elegant solution. So Short and sweet. Thanks so much for your kind help.
 The program stays about the same size, even with thousands of inputs. You simply use arrays instead of scalars for the data. Infinitely scalable!
Here is a quick draft for 10 inputs.
(Looking at your code, you still make unnecessary local variables.  Why do you possibly need the "array" local and indicator????)
Message Edited by altenbach on 04-19-2010 07:34 AM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
state changeMOD_Array.vi ‏12 KB
StateChangeArray.png ‏10 KB

Similar Messages

  • How can I change the state of a runtime menu item programati​cally?

    Using LabView 6.1, I would like to change the state of the runtime menu item "Operate/Print at completion".
    The goal here is to print the VI front panel according to the operator choice (OK ->print, Cancel ->don't print)
    In a first release, I put a Stop function at the dialog output (activated by the cancel button) but this function stop the complete application and my idea where to stop only the VI in which the dialog is running.
    In a second release, I've tried to use the "Application
    control/Menu" but I receive every time an error:
    Error 88 occured at Cannot modify application menu item in the printtest.vi.
    Possible reasons: LabView, Runtime menu error...
    Any suggestion is appreciated.
    Re
    gards,
    phidu

    Instead of using the print at completion option, print the VI programatically if the user selects to print...open a reference to the VI you want to print and use an invoke node to print vi to printer.
    Alternatively create another VI with a layout optimized for printout, set it to print at completion and run and load the data into that VI if and only if the user OKs the print...
    Mads
    MTO

  • How can I change a State name in iphoto map?

    A few months ago, changing a location of a group of photos, I really changed a state name.
    The image shows the name State "Casa David i Mireia" where should say "Catalunya" that is the real name.
    How can I change that name. I have opened a case in Apple Support, but the solution to reinstal the app have not worked for me.
    Thank you for your help
    Jordi

    Thanks for your help!
    The problem is that I think that I changed the "default" name for the state where the photos were taken. I have 50 differents locations, that are all correct, and photo per photo, I can modify the original location, but only at "local" level.
    How can I change the name displayed in State section as "Casa David i Mireia" for "Catalunya" that is the real name for the State where the photos where taken?
    I don't if this post is comprehensive. I'm not sure.
    Thanks for your time!
    Jordi

  • Is it possible to change application state from a component?

    I was wondering if it is possible to change application state from within a custom component and if so, what would the syntax be if I had an application named "zzz" and I wanted to change the app state from "state1" to "state2" from my component?
    Thanks!

    Hi,
    you always have a static class Application.
    Application.application will be the root component. After that you can change it state.
    Application.application.currentState = "state2";
    But it's not the best way to change states. It's better to dispatch events from components and change states in listeners.

  • What is the best practice for changing view states?

    I have a component with two Pie Charts that display
    percentages at two specific dates (think start and end values).
    But, I have three views: Start Value only, End Value only, or show
    Both. I am using a ToggleButtonBar to control the display. What is
    the best practice for changing this kind of view state? Right now
    (since this code was inherited), the view states are changed in an
    ActionScript function which sets the visible and includeInLayout
    properties on each Pie Chart based on the selectedIndex of the
    ToggleButtonBar, but, this just doesn't seem like the best way to
    do this - not very dynamic. I'd like to be able to change the state
    based on the name of the selectedItem, in case the order of the
    ToggleButtons changes, and since I am storing the name of the
    selectedItem for future reference.
    Would using States be better? If so, what would be the best
    way to implement this?
    Thanks.

    I would stick with non-states, as I have always heard that
    states are more for smaller components that need to change under
    certain conditions, like a login screen that changes if the user
    needs to register.
    That said, if the UI of what you are dealing with is not
    overly complex, and if it will not become overly complex, maybe
    states is the way to go.
    Looking at your code, I don't think you'll save much in terms
    of lines of code.

  • Change a state in main.mxml from a script in another mxml

    Hi,
    i'm having some trouble with my application, let's say i have the main application file called MAIN.MXML
    in wich i have set different States, and have different forms.
    now i have a form called loginForm which contains the textInput item for Login and Password, i also have a link Need to Register
    which onClick will change the state to show in the same panel a different form registerForm (with the relevant textInput items)
    now the MAIN.MXML includes a custom component called <comp: NetworkManager /> which includes all the logic scripts and MXML
    tags to create and manage an HTTPService request to a PHP Server.
    when the user click on the Login button, this will call a function included in the main.as script (imported in MAIN.MXML) which
    will call a function in the script within NetworkManager.MXML passing all the form data.
    in NetworkManager.MXML the script will create an XML message, will send to the PHP Server and wait the response... if this comes
    true the user is authenticated, otherwise is not.
    so far so good, i get the message sent, the correct response back. Now i want to hide the form in MAIN.MXML and put something like
    Welcome firstName lastName!! instead. But i don't know how to do it. If i try to access the states in MAIN.MXML from the NetworkManager.MXML
    i'll get all sort of errors which i don't have it here with me.
    I know this sounds like a newbie question, and it really is ... any taker?
    your help is much appreciated.
    thanks
    T.

    Hi,
    i've tried RemoveChild but i get an error like:
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/removeChild()
    at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$removeChild()[C:\autobuild\3.2.0\frameworks\p rojects\framework\src\mx\core\UIComponent.as:5096]
    at mx.core::Container/removeChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\ core\Container.as:2274]
    at components::NetworkManager/sendUserAuthHandler()[C:\Documents and Settings\Tom\My Documents\flex_prj\Shoppy\src\components\NetworkManager.mxml:182]
    at components::NetworkManager/serverHandler()[C:\Documents and Settings\Tom\My Documents\flex_prj\Shoppy\src\components\NetworkManager.mxml:98]
    at components::NetworkManager/__serverRPC_result()[C:\Documents and Settings\Tom\My Documents\flex_prj\Shoppy\src\components\NetworkManager.mxml:290]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.rpc.http.mxml::HTTPService/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[C:\autobuild\3.2.0\framewor ks\projects\rpc\src\mx\rpc\http\mxml\HTTPService.as:290]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[C:\autobuild\3.2.0\frameworks\ projects\rpc\src\mx\rpc\AbstractInvoker.as:193]
    at mx.rpc::Responder/result()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\Responde r.as:43]
    at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.2.0\frameworks\projects\rpc\src\mx\rpc\ AsyncRequest.as:74]
    at DirectHTTPMessageResponder/completeHandler()[C:\autobuild\3.2.0\frameworks\projects\rpc\s rc\mx\messaging\channels\DirectHTTPChannel.as:403]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    who is the caller of loginForm then? i've tried with Application.application.loginForm but i do get the same error though.
    loginForm is contained in a Canvas item, is it the caller? or who else?
    thanks
    T.

  • Code for capture digital data when change of state

    Dear Sir,
    I had written a program to capture the digital data when it change of state.
    It work well when I check the check box "Lock file for faster access".
    But error occur when it unchecked.
    Because I need to open the tdm file at the vi running, thus I need to uncheck it.
    Please kindly to advise any solution for it.
    The program is attached.
    Thank You.
    Attachments:
    datalogcos.vi ‏53 KB

    Hi Jayme,
    Sorry for late reply.
    The screen capture of error message is attached.
    Thanks for your helping.
    Poly-Alex
    Attachments:
    error.jpg ‏24 KB

  • How do I change the states of the "Submit"  button in adobe muse?

    How do I change the states of the "Submit"  button in adobe muse? Currently I can only change the color, text and stroke of the button, but I cannot customize it as I have the other buttons in the tool.

    I want to replace the button with an image, however it does not permit me to paste an image into the button, nor does it allow me to delete the box that is currently there. The best I can do is paste the image into the text box that is provided.

  • Can I change the state of an object by highlighting over text?

    That question probably doesn't make sense, but I didn't know how to word it with just a few words.
    I'm working on a site where I have a 'button' that has text in it. When someone hovers over the button, it changes colors (it's basically showing the user that the site is responding). When I put text inside the button, it causes the button to not change colors when I hover over it.
    I know that it's happening because the text is covering up the area that is supposed to respond to the user's mouse.
    So, I'm wondering if there is a way of either making the text and the 'button' all one object, or if it's possible to make the text 'invisible' to the mouse. What I mean by 'invisible' is that the computer wont acknowledge the text which will make the button responsive to the user's mouse.
    I am able to do this through photoshop but I was just wondering if it's possible to do this in only muse.

    Hi
    You can define states for the background layer such as rectangle and then insert text frame which will change the state on hover of mouse, but if the text frame covers the background then it wont active the state.
    The purpose that you are trying to achieve such as invisible text to mouse is not possible with native menu features , but yes as you have mentioned you can use an image for this , write up the text and use the image.
    The state button has same feature with rectangle in background and text within that.
    Thanks,
    Sanjit

  • Set up Signal Express to log when there is a change in state of the inputs (NI USB-6501 logger)

    Hello NI Forum, I have recently purchased digital I/O logger NI USB-6501.  This arrived with Signal Express, which I intend to use as a Lite version.  I just wondered if it was possible to set up Signal Express to only add a log entry when there is a change in state of the inputs?  I have this working on a 0.1sec sample period and can interrogate the logs after recording.  Most of the time nothing will be happenning, I just wondered if there was a way to reduce the ammount of data captured?  Cheers.

    Ah that unfortunate, and yes start/stop conditions for loging are part of the Full version of SignalExpress
    Here's the comparision: http://www.ni.com/labview/signalexpress/purchasing-options.htm
    Sorry about that

  • Change Boolean state when switching between cases

    I have a case structure with a true and false case.  In the false case
    I have two boolean I can turn on and off by clicking on them.  When
    changing to the true case I disabled the two booleans using a property
    node.  However when switching to the true case the booleans are
    disabled and remain in their last state, i.e. if they were true (on) in
    the false case, they remain true (on) in the grayed out disabled false
    case.   How do I change the state of the boolean in addition to
    disableing it.  i.e. if in the false case the boolean is in the true
    state (on) and I switch to another case the booleans are disabled using
    the property node and return to the false (off) state?  I have attached
    a example vi.
    Thank you for your help.
    Danny
    Attachments:
    Property node and select function.vi ‏14 KB

    Jorge already gave you some useful advice, but I would really recommend that you rethink your approach.
    Here are some points:
    I am not sure why you place the booleans inside the case structure.
    You song and dance is just an "invert" (see picture). Even better leave it all out and swap the contents of the two cases!
    There is no reason to constantly spin the loop writing the same properties over and over. It is sufficient to recalculate when one of the controls change. Use an event structure!
    You can eliminate the second switch by placing the diagram constants in the two cases.
    Attached is a quick draft using events to duplicate your existing functionality. See if it gives you some ideas.
    Message Edited by altenbach on 02-03-2008 02:23 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    invert.png ‏3 KB
    Property_node_and_select_functionMOD.vi ‏18 KB

  • Changing container State from a component

    Hi, I try to change the state of an application from a button
    inside a mxml component. I found a way for this by handling click
    event inside the component and dispatch event to the container (see
    the code below). But my problem is that any click is dispatched ! I
    would like that only one button dispatch this event, or better :
    calling a container's function from the button inside my component
    ! Is this possible ?
    Thanks for your help
    Here is a part of the container code :
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="570" height="360" xmlns:local="*">
    <mx:Script>
    <![CDATA[
    import flash.events.Event;
    public function handleCloseEvent(eventObj:Event):void {
    currentState='carte';
    ]]>
    </mx:Script>
    <mx:states>
    <mx:State name="liste">
    <mx:AddChild position="lastChild">
    <local:liste_vin_region click="handleCloseEvent(event);"
    id="fenetre">
    </mx:AddChild>
    </mx:State>
    <mx:State name="carte"/>
    </mx:states>
    </mx:Canvas>
    And the component code :
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="514" height="300" xmlns:local="*">
    <mx:Metadata>
    [Event(name="click", type="flash.events.Event")]
    </mx:Metadata>
    <mx:Script>
    <![CDATA[
    import flash.events.Event;
    // Redispatch event.
    private function
    handleCloseEventInternally(eventObj:Event):void {
    dispatchEvent(eventObj);
    ]]>
    </mx:Script>
    <mx:states>
    <mx:State name="liste"/>
    </mx:states>
    <mx:TitleWindow layout="absolute" left="10" top="10"
    bottom="10" right="10" id="titlewindow1"/>
    <mx:Button y="14" label="X" right="19" width="29"
    click="handleCloseEventInternally(event);" id="button1"/>
    </mx:Canvas>

    Yes ! That's exactly what I need !
    I've tried to do : this._parent like in Flash, but no
    result...
    Thanks for your help, parentApplication is right for me
    !

  • Nidaqmx and change of state interrupts on DIO

    Hi All;
    Does DAQmxbase support interrupt on change of state on a DIO port? I'm looking for a way to generate an interrupt ( sigusr2 or similar) whenever any bit changes on the dio port.
    Is it possible to split the dio port into 4 bits in/4 bits out?
    Pat

    Pat,
    What hardware are you using the DAQmxBase driver for? The ability to generate interrupts when DIO bits change are dependant on the hardware used rather than the driver. The hardware should be capabable to perform change detection operation in order to be able to generate interrupts based on changes to bits on the port. Also, some devices can be line (bit) configurable and some are only port configurable. In other words, your hardware might be one of those devices that support line configurability. Please look at the following knowledgebase entery to verify that your hardware is capable of performing individual line configuration. If your hardware supports individual line configurability, you could split the DIO port to half in and half out.
    Which Devices Can the DIO Lines Individually Configured?
    Can You Configure the Individual or Single Lines of the 8255 Digital Chip?
    If you still have further questions pertainent to this issue, please post them and I will address them.
    Ayman K
    Applications Engineer
    National Instruments

  • Does performing a DAQmx Clear Task on a PCI-4474 card change the state of the IEPE current?

    Does performing a DAQmx Clear Task on a PCI-4474
    card change the state
    of the IEPE current?  If the IEPE current was on, does it remain
    on even though the task as been cleared?  If the IEPE current
    remains on, then I assume I don't have to wait for the IEPE current to
    settle if I make a new Task and start a new measurement--is this
    correct?
    Thank you in advance for your help.
    Ken

    DAQmx Clear Task should not turn off IEPE current. You will have to explicity set IEPE current to On (for that channel) whenever you use any of the AI channels on your 4474 in order to keep the IEPE On because the IEPE for all channels in the AI subsystem will be set to the default state (Off) unless explicitly configured. That said, if you clear a task that had IEPE On, and then initialize a new task and set IEPE On, the IEPE will be uninterrupted and there should be no need to wait for the IEPE to settle. Other components of your measurement system might need time to settle if their state was changed between tasks (DUT, sensor, AC coupling, etc.)
    Doug
    NI Sound and Vibration

  • How can we change the state of records in view cache and entity cache

    Hi everybody,
    I am trying to achieve selective rollback, or selective commit. By this I mean that I am looking for a way to change the state of rows in view cache, so that the selective changed rows can be rolled back during comit.
    if anyone has tried anything in this please help me.

    I agree!
    I can't top this approach.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • I need some detail solutions and suggests about below these problems ?

    I need some detail solutions and suggests about below these problems: Problem 1: SAP Management Console cannot start successfully • Problem 1.1: Click on SAP Management Console, but yellow light continues for a long period of time. • Problem 1.2: In

  • Photoshop CC 2014 won't start while any other 2014 apps do

    After the 2014 update, I've used PS for a while, first in polish (as CC app updated it changed my language to polish. I'm used to english so I've uninstalled PL versions, and installed the proper EN ones), than in english. Point is it worked. I didn'

  • Print out of Gantt Chart

    While using the menubar path Project> Print> All/Gantt Chart in the Project Planning Board screen of a Project, the print preview showing the display area only. The table area is showing without the text and data. Please tell me what type of settings

  • FCPX cross-dissolve on only one end of a clip?

    How do you apply an effect (in this case, Cross-Dissolve) to only the beginning or end of a clip?  The program automatically applies the effect to both ends of a clip, and I have to delete the one I don't want (added step, added time, time is money,

  • Shared public IP with same tcp port (round robin/load balance)

    Hi all, I want to know if I can do that with my ASA5515-X, I have two servers that can do the same thing, there are SSO servers, What I want to do is to publish the 2 servers on Internet with the same public IP address and on TCP 443. Is it supported