Using "don't care" in digital state machine?

Hi:
I am trying to use the digital state machine component and received some advice from tech support about how to properly make a state.txt file.  However, the simulation of the state machine freezes when a "don't care" condition is encountered for any of the inputs.  Here is what my state.txt looks like: 
I'm assuming that an "x" represents a "don't care".
Any advice, comments, etc.  Would be greatly appreciated.
Attachments:
state-x.txt ‏1 KB

The digital state machine is a XSPICE model and the 'don't care' condition is not supported by the XSPICE model engine.
Tien P.
National Instruments

Similar Messages

  • Any penalty to using one big cluster in a state machine?

    I've been working on a lot of small/medium sized state machines lately, and I've gotten into a habit of putting most of my data (single values, arrays, strings, even LVOOP objects) in one cluster that I pass from state to state with a shift register.  I just unbundle the data I need in each state, work on it, and bundle it back in for the next state.  Part of me says that this is a bad idea - that I should separate the big cluster into a set of smaller clusters that group the data by logical categories.  Another part of me says that if I do it that way, I'm just creating needless clutter on my diagram.
    So my question is simply this - is there any significant performance penalty for using a single cluster rather than multiple clusters in this fashion?  I never run the whole cluster into subVIs, and I never split the main cluster wire, so it doesn't seem like there should be... but I've been wrong before!
    Thanks,
    Jason

    As Norbert mentioned, the answer to your Q is dependant on your data structure. Provided you can do all of your data manipulation "in-place" there should not be any issues. The more complex structures can still be handled "in-place" but you may have to use the in-place operations to achieve this effect. Depending how comfortable you are with those operators, they can complicate the appearence of our code.
    If you can'y do everything "in-plcae" and you have a Super-Cluster, then its time for me to Quote Rolf again when he wrote "Once all of you physical memory is filled up with a single cluster, your application is probably going to suck."
    So lest say you have cleared all of the above hurdles and still want to use a single SR that has all data for all states. I ask you to carefull examine where the app may go in the future and what type of animal it could turn into. if there is even a small chance that app may turn into something that non-computer users will use (requires robust app to prtect itself from dumb users) the single cluster approach is going to get in your way when the app gets big.
    1) If you have to add another field to the cluster, every function that uses that cluster should be re-tested. WE have an app in-house that was developed by our customer and we support. There is an 800+ step proceedure required to re-verify the app!
    2) AS more functionality is added you will add more states to your state machine. Personally, I cringe when I see the support developer have to choose from a list of 300 states when working with the Stae machine.
    3) You will have a hard time re-using code aside from cutting-n-pasting
    4) When you unbundle manipulate and replace, you are in danger of creating duplicate data which will impact performance.
    I never went through the formal IS training but my wife did and she has given me the short version to learn how to normalize a DB. There is actually a science to the process that results in only related items being grouped together and if you take to the full exdtreme of "fully Normalized DB", there absolutely no duplicates of data. For LV apps a Fully Normalized DB adds some overhead so I don't go that far.
    THe following will ignore using an Object Oriented approach and stick with old-school ideas.
    So after I analyze my data structures and group related items together and review who touches what when, THEN I try to wrap-up the data in Action Engines. More often than not, the action will replace some or most of the work done in some states. From your Q it sounds like your "read-mod-replace" constructs can be moved into AEs with little effort.
    Now for OOP
    I'm still learning OO system design but I have found myself "turning my apps inside out" with LVOOP. By this I mean rather than think that the data AND the function are inside the AE, the data is outside and acted on by what is inside the LVOOP methods. I have been amazed at the degree to which LVOOP can operate in-place, but I digress. There is some arguement/design pattern that says that if you have a function like a test that uses other classes, then you can create a class for the test and slam all of the required object into you need.
    Done rambling for now. As usual, if there is anyone out there that want to correct me any of the above, please do so!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to use a event structure with a state machine

    First, I would like to inform you that I only work on LabView part time, and have much to learn.  Anything I do learn, I usually forget until I need it again, because I only work on it part time.
    Using your StopWhileLoopMOD[1].vi, I am trying to put a state machine inside the event structure.  
    Related link: http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loop-in-Event-case/td-p/465564/page/2
    Here is my application:  on the front panel, the user can select any combination of 7 different tests.  I have created cases to perform each step of each test in the correct order, but if the user presses stop, the tests won't stop because some of the cases have a while loop inside the event structure (like you mentioned is a bad idea).  The user should be able to stop the test, reselect tests to perform, and re-start the tests. 
    When the start button is pressed for the event structure, I need all the cases to run in the proper order, unless stop is pressed.
    In the past I have indexed an array and used that to run the state machine, but it won't stop immediately.  
    I have sub VIs that are built in while loops because the outputs of the product needs time to stabilize.  The state machine stops and waits up to a certain number of iterations.  If it passes the test, the while loop stops and the next state starts.  If it takes too long, it exits and reports an error.  Maybe I need to just use the state machine and not an event structure?
    Is there a good example of an event structure?
    metzler CLAD
    Solved!
    Go to Solution.

    I'm not sure exactly what you are asking, but it sounds like you want to script a bunch of tests and if the user says stop, to immediately stop the current test and abandon the others?  I'm going to assume that you know how to clear the array so that it will abandon the others, so I'm guessing that you are having trouble abandoning the current test?  If this is indeed the case, then the problem is that you are not able to propagate the message from the main VI FP which is the GUI to the sub vi which is the test, where the test may or may not have a GUI (FP visible) of it's own.  Threading was the first thing to come to mind, but this may not be necessary using events.
    You can do this by passing a refnum of the stop button to the subVI, where you can then add that wait to the event case structure.
    I've attached 2 VIs, mainvi.vi which is just a loop displays the count*2 (number of seconds passed since running) that will call subvi.vi and then check to see if the stop button is pressed.  mainvi.vi is by no means a state engine, it is just a simple loop for demonstration purposes.  subvi.vi just waits 2 seconds and leaves, it is a better structured state engine with an init state to start a poll case to wait for events and an exit state to clean up.  You can modify this any way you wish to get it to do what you want.  You will note that even if subvi.vi is being executed, it will terminate immediately when the stop button is pressed.
    Hope this helps.
    A
    Attachments:
    mainvi.vi ‏17 KB
    subvi.vi ‏33 KB

  • Use state machine to fill cluster

    Hi,
    I am trying to create a state machine that runs two states, each state has two elements going to a Bundle function and into the cluster. I want the two elements from the first state to go through, then the second state should run and pass the final two elements. Currently I am only getting the data from the final state. I have an the vi attached.
    Thanks,
    Chris
    Solved!
    Go to Solution.
    Attachments:
    cluster state machine.vi ‏9 KB

    You don't actually have a state machine.  What you have is a basic loop, and nothing about what happens in earlier iterations of the loop gets passed to later iterations.
    You need to build the cluster within the loop itself and maintatin it in a shift register.  Use bundle by name to update the respective elements of the cluster in each frame of the case structure.
    Attachments:
    cluster%20state%20machine[1]_BD.png ‏16 KB

  • What is the disadvantage of state machine?

    Hi,all,
    Anybody can briefly introduce what the disadvantage of state machine? Is it make the LV program large and hard to read?
    Thanks.

    There are several programming architecture templates that are available in the "New..." dialog. They are under VI from Template -> Frameworks -> Design Patterns. There are six different design patterns. I would say that the State Machine would be a bad choice only when one of the others is better.
    That being said, state machines are not so good at parallelism, so if you had a need for that you might want to look at something else. Also, if you cannot see a good way to break your code into actual states, you should consider something else (and once you have don't it with something else, you will probably be able to see the states :-) ). Extremely simple, straight-forward algorithms usually don't need to be state machines unless there is a good probablility that it will grow in complexity as the software matures.
    Hope that this helps,
    Bob
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Queued State Machine, not a state machine?

    I've been reading up a bit on design patterns that seem popular among LabVIEW users, and I have a question with regards to the design pattern described in the following article:
    http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/
    I don't see how this is a state machine at all. To me it just looks like a producer/consumer pattern for queuing up actions (what is described in the article as states) to be executed in the consumer loop. I don't see where a state machine comes into play, determining state transitions based on current state and inputs, like shown in the following:
    http://zone.ni.com/devzone/cda/tut/p/id/3024
    Am I completely off?

    Yeah exactly.
    I was thinking a nice way to implement something QSM-like would be to produce instances of a message handler object that maintains its own state and a message queue. You could produce a new object for network I/O that inherits from the general message handler, one for managing the UI, data aquisition etc. They would communicate in a network by passing messages back and forth to their respective queues and each would be a true implementation of a state machine.
    Has to be right up LabVIEW's visual alley
    Edit:
    Now that I come to think of it, this would be almost exactly what could be done compactly with LabVIEW event handlers and user-generated events.

  • State machine with using event case

    Hallo everyone,
    i have a question about how to realize the "Timeout". In the flow diagram below we can see 2 different situation:
    1. in the 1st Situation i have used the state machine, it begins at state 1, which contains a event case. In there it will be at first determined, if the input value has changed within 10 second,  if it didn't, the state machine will go to state 2, if it 's  changed, will be furthermore determined, whether the input value equal to 3, if yes, the state mashine will jump to state 3, if no, jump back to state 1. (this VI i have done before, you can take a look at the Attachment).
    2. my question is in the 2nd situation. It begins also at state 1. In there the input value can also be changed (once or many times) or not. If the value has not been changed within 10 s, or even though it's been changed many times within 10s, but  it's never been equal to 3, the state machine will go to state 2; only when the input value within 10s equal to 3, it can jump to state 3.
    This problem i have no idea how to solve, does anybody have  idea or better methods?
    thanks a lot!!
    Solved!
    Go to Solution.
    Attachments:
    situation 1.vi ‏12 KB

    The statement in the OP is not covering all cases.
    mexaviesta wrote:
    2. my question is in the 2nd situation. It begins also at state 1. In there the input value can also be changed (once or many times) or not. If the value has not been changed within 10 s, or even though it's been changed many times within 10s, but  it's never been equal to 3, the state machine will go to state 2; only when the input value within 10s equal to 3, it can jump to state 3.
    This problem i have no idea how to solve, does anybody have  idea or better methods?
    thanks a lot!!
    Just check my implementation for Situation 2 and let us know, if it works for you.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    Situation 2.llb ‏40 KB

  • Using multiple events structure inside state machine to control the Tab

    Hi y'all,
    Anne here.I have a Tab indicator in my front panel and I want to be able to control the flow of my program based on what controls I clicked inside the tab. I am using a state machine architecture and inside every state, I use an event structure to check for user interaction  to determine the next state and what tab page is going to be displayed next. This means that I am actually using multiple event structures in my application and I use them in just one while loop, but just that they are not running in parallel since I am only using "one event structure per state" which means that only one event structure is running at one time. My questions is, programming technique wise, am I doing it correctly? So far, I am not facing any problem (I am still in the early stage of the project) but I want to check with you all first on your opinion regarding this architecture. Will there be any issue on using multiple event structures in a vi? Since I will be using a tab, and the controls available in the tab will be the controls that will control my event structure for that state, by right, there should be no issue. Am I correct to assume this? Is there any limit on the use of event structures? I have attached here a simple sample of the architecture that I am talking about for your reference. I have attached a 2010 version and a 8.6 version. Let me know what you think or any opinions that you may have.
    Hoping to hear from you soon! Thanks so much in advance!
    Cheers!
    Anne
    Attachments:
    State Machine-Event Structure Sample_2010.vi ‏19 KB
    State Machine-Event Structure Sample_8.5.vi ‏25 KB

    Hi jak888,
    I decided to use tabs cause I don't want to have subvi pop ups every time i need to perform the process in the state and show an update in the front panel. This is actually going to be more of an ATE where you will have to choose first whether the one using is the operator or the engineer. If the operator is logged in, she will proceed to choose what test to run (this state will have its own event structure). This part, I don't want a pop up, so what happens is that from Login page, if the user logs in as operator, the tab will automatically switch to the Test Selection page. After selecting the test, it will proceed to Start Test state and the tab will show the Result Summary page. If the user logs in as engineer, then a totally different tab will be automatically shown next and so on. By doing this, I will be able to show an update on the front panel objects without having the subvis pop up. I will also just need to use the call reference functions to call my subvis, making my Main VI more generic. The tab Page header will be hidden so the operator will actually not see that there is a tab and that there are a lot of controls and indicators cause they are hidden in the tabs and that page will only be shown based on what they selected from the main tab. 
    I appreciate your thoughts! thanks so much!

  • Recipe Management Using State Machines and DAQ Assistants

    I am writing LabVIEW code to control a conversion process for up to 4 devices on one apparatus.
    The operator will select from these 4 devices which ones will go through a conversion process. Therefore - they can select some or all of the devices to go through the process.  The process is the same for all 4 devices. The difference between the 4 are the digital outputs used for the conversion process.
    Clearly a state machine is applicable. However, I would like to "reuse" the process conversion code of the state machine by creating a separate recipe for each device and merely change the digital outputs (their physical location) for the device under conversion. Presently I have DAQ Assistants controlling digital ouputs for the conversion of one device. Is it possible to "reuse" the code by creating a recipe or a lookup table to reassign the DAQ Assistants to their proper physical location (the digital output lines) for the device under conversion?
    I could - copy and paste the code, go into the process and reassign every DAQ Assistant to the correct physical channel of each digital output for the other 3 devices. I was curious if there was a more efficient way.
    I see documentation online for recipes; however they are dated 2006. I thought there may be some updated examples.
    Using:
    LabVIEW 2011
    cDAQ-9188 chassis

    Hi MgDAQ,
    DAQ Assistant is a quick way to start acquiring data, however it's not the most efficient.
    Everything that DAQ Assistant does can be acompished with basic DAQ functions on the
    Measurement I/O -> NI-DAQmx pallete. For example, you can use DAQmx-Create Channel.vi and
    a Channel Constant to select the channel from which you want to acquire data.
    To get started with using the DAQmx functions you can browse through Hardware I/O examples in the Example Finder.
    Open up a new LabVIEW VI and then go to Help -> Find Examples -> Hardware Input and Output [folder] -> DAQmx -> Digital Measurements
    Now, as you probably know, copying and pasting code is inefficient and it's not a good programming practice. So what I would do is create the code for your conversion process and then simply change the channel constant to read the digital output you need.
    Mikhail
    RF Toolkits, Product Support Engineer
    National Instruments

  • HT1212 I am locked out of my iphone. In resetting my passcode I must have hit a wrong digit, because the 4 digits I thought I used Don't work (and of course not my old passcode).  I have tried the instructions both for "if you have previously synced your

    I am locked out of my iphone. In resetting my passcode I must have hit a wrong digit, because the 4 digits I thought I used Don't work (and of course not my old passcode). I have tried the instructions both for "if you have previously synced your device with iTunes" and "If you have Never synced your device with iTunes" . Neither has worked and I'm in a vicious circle with each time after lengthy downloads it still all ends with the program, & my phone, asking for my passcode to proceed.  I'm not sure if I have ever synced to my mac book (i may have) but my address book seems to automatically update on both devices without the need to plug in. Thank you for any knowledgable help that could efficiently get me  out of this passcode ****!

    Hi DRussell,
    If you have not sync'd your device to your Mac then you will have to force the phone into recovery mode and restore as a new device. Read the information in this link and follow the instructions to recover the phone:
    http://support.apple.com/kb/HT1808
    Hope this helps!
    Cheers,
    GB

  • How can I keep a state machine readable when using large amounts of in/outputs

    Hello, I am new to Labview,
    Read trough the fundamentals and the
    getting started and a lot of examples.
    What I want to do is use a standard
    state machine from the template, and add some stages, for example
    orange, apple, banana. At this point I can use numeric controls to
    put in the amount of oranges, apples, bananas there are. I can even
    use a led to tell the user which state of the state-machine is
    active.
    The thing is there will be more numeric
    controls and more leds and it would be nice if the code would still
    be readable when there are 20 inputs and 20 outputs.
    Questions
    (1) It would be nice if I could use the
    typedef to select the right state AND the corresponding numeric
    controls and leds out of a cluster or an array kind of structure to
    keep the number of wires low. Is this possible, how can I do this?
    (2) I tried to put the numeric controls
    into a cluster but that way I can't put the numeric control for the
    apples in the upper right corner and the numeric control for the
    oranges in the lower left down corner of the front panel.
    (3) An example would be really nice, I
    know that I saw some examples describing this problem but there are
    so many examples that after a few hours of searching I haven't found
    the right one yet.
    Thanks in advance for the effort.
    p.s. I will not use Labview to do
    calculations on fruit, I am only using this to make the question
    easier to understand.

    I can only start a proper answer but I might as well start with that.
    When I am developing State Machines I have to think about what data is used and manipulated in each state. I then have to think about where am i going to keep and manage the data. I list all of the fields that are "touched" in each state and what values are used together and which are independent form the others. After this phase of the analysis, I usually have some data structure defined (cluser array etc).
    Then I flipp from thinking about the state to thinking about the data (after all this is LabVIEW and the data-flow paradigm is critical). If I see data that is only used by the State machine and is used in many of the states, then the data structure get put in a shift-register for easy access in each state. This maybe enough of an answer for your fruity question.
    When i see data that is shared or only used in a handful of states then I concider putting the data in an Action Engine. Depending on how you design your AE, you can access each of the fruit totoal by name or increment etc as required.
    If your app demands many fileds that are all related (can't be broken into distinct data structures) then create a cluster that has all of your values that are used by the AE. Then create an Wrapper VI for each call of the AE but only put the associated fields on the FP of the wrapper and then bundle that value into the cluster and invoke the AE.
    Ben
    PS: Sorry about reverting to neBulus mode but this topic could take days to cover in detail.
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to use elapsed time function with state machine in Lab VIEW

    Hello
    I've been trying to use state machine with elapsed time function in order to sequentially start and stop my code. The arrangement is to start the code for 1 minute then stop for 5 minutes. I've attached the code, the problem is when I place the elapsed time function out of the while loop it doesn't work, on the other hand when I place it inside the loop it does work but it doesn't give the true  signal to move to the next state. 
    Could you please have a look to my code and help me to solve this issue.
    Regards 
    Rajab
    Solved!
    Go to Solution.
    Attachments:
    daq assistance thermocouple(sate machine raj).vi ‏436 KB

    Rajab84 wrote:
    Thanks apok for your help
    even with pressing start it keeps running on wait case 
    could you please explain the code for me, the use of Boolean crossing, increment , and equal functions 
    Best Regards 
    Rajab 
    OK..I modded the example to stop after 2 cycles. Also recommend taking the free online LabVIEW tutorials.
    run vi. case statement goes to "initialize", shift registers are initialized to their constants. goto "wait"
    "start"= false, stay in current state. If true, transition to "1 min" case
    reset elapsed timer with True from shift register(counter starts at zero)."time has elapsed"=false, stay in current state(1 min). If true, goto "5min" case
    reset elapsed timer with True from shift register of previous case(counter starts at zero)."time has elapsed"=false, stay in current state(5 min). If true, goto "1min" case. Also, bool crossing is looking for "true-false" from "5 min" compare function to add cycle count.
    Once cycle count reaches 2, stop while loop.... 
    Attachments:
    Untitled%202[1].vi ‏42 KB

  • I have a separate apple id and my daughter bought a song using my ID rather than hers.  Now I've got this song that I don't care for and have no use for.  Is there a way to get it to her ID short of burning it on to CD and then uploading it to her phone?

    I have a separate apple id and my daughter bought a song using my ID rather than hers. She was playing on my computer and bought it, thinking it would download to her phone through the cloud. Now I've got this song that I don't care for and have no use for.  Is there a way to get it to her ID short of burning it on to CD and then uploading it to her phone?

    sure pretty simple.  make a backup of your current settings
    http://support.apple.com/kb/HT1766?viewlocale=en_US
    then restore device from old backup you need pics off of
    then import pics to computer
    http://support.apple.com/kb/HT4083
    you may need to save pics to camera roll first
    then restore the new backup and sync pics back to phone via itunes
    Peace, Clyde

  • Advantages of Using Queued Message Handler vs. Standard State Machine

    Hello,
    What are the advantages of using a Queued Message Handler?  Also, why are they more powerful than using Standard State Machines?
    Thanks!

    They are really just sort of an extension of a state machine.  The general idea is that you have one loop doing a specific job.  You then use a queue to tell it how/when to do this job.  For instance, I might have a log file loop.  I will send it commands to open a file, write some data, write some more data, and finally close the file.  Each of those commands are coming from the queue.  The beauty with this setup is that anybody that can get a reference to that queue can send the command to that loop.
    So the QMH is "better" than a state machine mostly because of the decoupling of functions.  In a given application, I will have a loop for log file writing, GUI updates, reading of a DAQ, instrumenet communications, server communications, etc.  Trying to do all of that in a single loop state machine is a major pain in the rear end.  Seperating them out makes life so much easier.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Create Multiple tasks for Single Item in List using state machine workflow in sharepoint

    Hi,
    I want to create multiple create tasks for Single Item in List based on Assigned to column using state machine Workflow through visual studio
    Here Assigned to column allows multiple users. so i have to create task for every user based on column .
    I'm trying for this but i didn't got any solution
    Please provide solution for this.

    Hi,
    According to your post, my understanding is that you wanted to allow multiple users to approve.
    There are some articles about creating parallel tasks in state machine workflow, you can have a look at them.
    http://www.codeproject.com/Articles/477849/Create-Parallel-Task-in-State-Machine-Workflow-in
    http://msdn.microsoft.com/en-us/library/office/hh128697(v=office.14).aspx
    http://social.technet.microsoft.com/Forums/office/en-US/b16ee858-4360-479a-a686-4ee35b7be9db/sharepoint-2010-workflow-creating-multiple-tasks?forum=sharepointdevelopmentprevious
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

Maybe you are looking for

  • Best Practice for disparately sized data

    2 questions in about 20 minutes! We have a cache, which holds approx 80K objects, which expired after 24 hours. It's a rolling population, so the number of objects is fairly static. We're over a 64 node cluster, high units set, giving ample space. Bu

  • Old Reminders in Notification Centre That Don't Exist in Reminders

    In the Notification Centre on my Mac I have 2 Reminders from 61 days ago listed, but I don't think they actually exist - if I click on them in the Notification Centre the Reminder application opens but on today, it doesn't go the the reminder I click

  • I purchased the yearly plan for premiere cc and only get trial how do i fix this?

    I recently bought the pay by month, yearly plan for the Adobe Premiere CC but i only seem to be getting the 30 day trial version... I have followed other discussions on how to fix this but nothing is working.  I even tried to follow steps to redeem a

  • Ageing analysys

    Hi Gurus, I want to know how to do ageing analysis in SAP for customers and vendors. i.e i want to know Regards SAP guy

  • Conditional build tag for folders

    I was told this might be a new feature in coming updates but have not seen an update in about 4 years (glad i didn't buy the maintenance) - does anyone know a way to edit core files to enable a folder to link a conditional build tag without code bein