StateMachine Eventlist
Hi Forum,
I'm using a machine to States with Labview (States: start, recording, record, report, stop) I wish I had a report to a text file with the changes of the State, date and time.
What would be a great way to do this?
Example:
Time
00:00:00 start
00:01:00 registration
00:02:00 registration
00:02:30 registration
...
Thank you and best
Martin
Tags: NI Software
Similar Questions
-
create a list or a container for the States of a statemachine
Hello
I'm working on an application where many different types of devices will be put into a test set-up for Board level testing. Depending on the type of Board, I need to create an ordered list of all necessary tests for the device. I have a state machine and a single State for each of the tests and try to figure out how to create a list of tests for the specific device. I want to have control in each of the States to remove the first element of the list and then take the next value and he lead the shift register used to go from one State to the other. This should allow the state machine switch to the appropriate State based on the type of device and its sequence of necessary test.
It should be with a table? Is there some containers easier to work with this use case? I need a container that will allow me to easily add between 5 and 30 names of State (based on the needs of the unit type) and easily remove or increment a pointer to the next State in the container.
Thank you
Gary
Hi Gary,.
an array of string or "enum" comes to mind. You can use it for the selection of States.
You have to transfer data?
Another way would be a queue. You can read the States with the enqueue function.
It may be useful
Mike
-
acquire, analyze, and log data using the technique of the statemachine
I'm technical state machine learning to develop code to acquisitoin of data and logging. I think I wrote the correct code for this purpose, but I couldn't have done the following:
All the values(>0) of warning should appear on table 1 d on the façade. The code is written only the first value.
All values must be recorded using to write to the palette of the spreadsheet and written on the excel sheet. Code is only writing first value.
I wonder what is the error. The code I created is attached, I would be grateful if someone fix the code and post in response.
Thank you in advance for help
See you soon
Hi kwaris,
"What is the error": well, you use a lot of unnecessary conversions. Really a lot of...
Why do you convert a dynamic scalar value, then convert to table, then index an element of the array? Why convert to dynamic when everything you needis a simple "build table" node?
OK, I've included a shift register where you will store your table. It of just a simple 'how to', but not the best solution for all cases. But it should give you a clue...
-
StateMachine in Subvi, restart shift registers
Hello
I'm having a problem with a reentrant Subvi, which implements a State Machine. The Subvi is called only once in the code, so problems with re-entrant execution concave/no is not the problem.
The Subvi implements a State Machine whose output is a reference position for a drive motor. The state machine is implemented with while loop with shift registers. The Subvi is called once each control cycle (cycle being about milliseconds time), so that the State Machine while loop is executed once each cycle control (stop Terminal is connected to 'true'). And the shift registers are used to save data between executions.
When I opened the main VI, it works perfectly. When I stop the VI and restart, the Subvi begins to use the last values of the previous main run of VI. I want that my position reference to start from 0. I guess my problem is that I should start the SubVIs shift registers.
Is there a way to do this without adding any extra code? (Perhaps an invoke node functionality for the Subvi or something like that?)
Thanks in advance for your help
Best regards
Pestana of Jesus
Hi jespestana,
I recommend adding a case of initialization.
Mike
-
I'm new to dasylab and come across something that has baffled me. I need to set a response time and a slider length run then press a run button. After running button is pressed, the system expected seconds (response time) and writes data via a DDE to a spreadsheet excel for seconds (duration of race). I write data slider length run a variable ${RANGE} and the cursor of response time for a variable ${RESPONSETIME}. I can get the DDE to write on demand using a push button and a relay, but can't seem to get the delay to work.
CHANGE >
More info: I set up a simple spreadsheet that uses modules of timer and it works fine, but when I use delays in my real world project, I get the following error:
"The duration of block or the information of the input channels do not match. These channels can be linked in this module. STOP! »
I get this error if I use a fixed value in the slot of duration rather than the variable ${RESPONSETIME}.
I solved this right here by clicking "Input" in the synchronization of the Slider modules or reading Variable options. I don't see how to delay module.
I love statemachines, but maybe that's a lot for the questioned effect... ;-)
(see attached photo and zipped the DASYLab 12 worksheet)
-
Movement, measurement and time between them
Hello friends,
I have a doubt with my program. I made a statemachine (using the 9.0 lab, which is not possible to use a new) to move two motors and a measure of the (curved). Move engines measurement is performed, and this measurement is done in the same time Motors move, why?
What should I do? I want the engines move, and then do the measure, when this is done, then move the engines again and so on.
Any idea? Any help is appreciated.
Attached you will find the program (sorry because of the drivers, they are Thorlabs for engines and Keithley 2400 for the measure)
-
Hello world!
I'm working on a project with more comlex VI included, and I have some problems with the closure.
I want to manage a statemachine Central stop, here I get a Notifier and send a bool cluster. The first element of the bunch is true if the closing process can begin, and then all VI before actually writing the corresponding element of cluster true, so ultimately I can check if all VI had wound up down correctly.
It goes perfectly with each VI written by myself, the problem appeared when I tried to change third party VI. The VI is required, this is the original watchdog of a motor controller, so it is not possible do not use.So there is a TimedLoop in this VI, and it seems that the TimedLoop the Notifier is not refreshing itself inside, so I don't have the chance to stop him.
Can you give me some advice, what tool could I try to use to give a command of the machine of the State of closure?
Thanks in advance!
In the meantime I discovered that there was a problem created by myself outside of the VI.
Thanks for the help! -
Cannot install the state diagram Toolkit
I have LabVIEW 2009 and 2010 is installed on my machine. I use the former state diagram Toolkit for many programs. Usually, since the tool box works with a single version of LabVIEW, I installed for what version I need, then if ever I need to use it in different version of LabVIEW, I uninstalled the Toolbox, and then reinstalled for the other version of LabVIEW that I want to use. A bit of a pain, but it uninstall / installs quickly, and I don't have to do all that often, so not a huge deal.
I did this procedure several times, but more recently when I tried it, the box tools uninstalled without problem, but when I go to re - install the Toolbox, it gives me an error saying 'not installed LabVIEW 7.0. Run the program installed LabVIEW 7.0 (or later) before running this installer". Which installer may find out who isn't there anymore?
Hello
I'm surprised to not see JB answering this thread, as I know, he is a lover of the SDE. Maybe he's on vacation!
To install SDE for another version of Labview, you must locate the following folders from the EDITOR (in the draft) and copy them into the new version of LabVIEW:
C:\Program NIUninstaller Instruments\LabVIEW x.x\examples\statediagram
C:\Program NIUninstaller Instruments\LabVIEW x.x\resource\plugins\statemachine
C:\Program NIUninstaller Instruments\LabVIEW x.x\vi.lib\addons\statediagram
So to install the Toolbox of the CD once, then copy it to the other version.
I hope this will help you.
Best regards
-
Hi, I am trying to add a light display to indicate when a certain part of my code is running. Basically, I need to know how to activate and deactivate a single Boolean indicator in a flat sequence structure. Any help would be appreciated. Thank you
Hi DoomPirate,
Place your indicator in the first frame and a local variable or a property of the node in the last.
It is also possible with only the flag if you are using a statemachine architecture.
Mike
-
Charge of the capacitor, synchronization and dish-sequence struture
Hello
First I'll give you some information about my project:
I'm quite new to Labview, but I have much programmed with C + c++ / C/Assembly. The attached program is a small part of a larger system, but I did a version of it, just to get the hang of it. A capacitor (image) will be charged up to 3, 3V. I'll make two measures 2.5 V and 3.3 V, about 3 tau and 5 charging tau. There are some delays and it is here, I had a few problems.
Sequence:
- As soon as the signal must be 0V for at least 300 ms.
- The capacitor must reach at least 2, 5V in 430 ms from the beginning.
- Then the capacitor must reach 3.3 V within a maximum of 510 ms from the beginning.
My attached program is built on a flat sequence structure (statemachine is maybe better?). If I change the 'Wait 300 ms' ms ' wait 80 ", the first time-check will pass.» If I use 300 ms, the first check-time is about 600 ms and the latest ms 950 (it should have been ms 430-300 ms = 130 ms and ms 510).
I don't want you to do something for me, but maybe give me a hint where to look. A statemachine would do better than the flat sequence? Am I on the right track when checking the time, or is the number of cycles that is useless in this case?
Is the code in the category Ruby Goldberg?
Additional info: I am LV 2009 and 2010, but only the versions of Basic. Data acquisition in my program can be replaced by a signalgenerator of 2.5 V and 3.3 V just to test.
I think that the program does its job, but my timing is not on the right track.
Thanks for any help.
Kind regards
Even
I'd do the "timing" completely on data acquisition, it is much better than the drunks. You can synchronize the OD and HAVE to have a shared sample clock and a shared start trigger. When you start the task of the AO, the task of I is also running well (you can also do the opposite).
In the end, you just need to analyze the data of the task to HAVE it. The sampling rate you calculated that are the data points in the table that correspond to your time limits then the array index and check if the voltage is higher than your limit.
In addition, you have the complete characteristic curve.
Felix
-
Acquire the values only when the digital output is high.
Hello
I work with test of transistor, whose door is controlled by the digital release of USB6289, related to BNC2120.
Test plan:
Door 1.transistor is enabled for 5seconds, with P0.0 for example
2. then, everything remains off for 1secondes.
3.p0.1 is used as digital output to activate the circuit passing him curent through in the opposite direction, P0.1 goes high for 3 seconds, PS: Gate is off.
4. the same cycle repeats again.
My question is to store values to the output of the transistor when P0.0 and P0.1 goes high, and these values should not change until my digital outputs respective again go high.
I can access transistor by continiously read out my power supply values.
and in the State off I want to read AI0 because at that time, my power supply is off, so that I can activate the circuit to pass the current in the opposite direction.
Again, my question is to gain the output through power value when P0.0 is high and store them until the transistor turns on.
and even for P0.1, acquire the value of output through AI0, when P0.1 is high and store it until it goes high again.
Hopefully, I'm able to explain my problem clearly.
Please help me.
Concerning
Anurag
Think about what States (object:statemachine and determine when to use sequence Structures) do you want from t0... t(n-1), IF DAQmx generates outputs and/or inputs are absorbed and what needs to happen (event timed out), before move you on to the next 'State '.
type def 'enum' with your different States:
- initialize
- wait (the user initializes times (sec) set for States, or whatever and presses button 'Start')
- T0 (generate DigOutputs, store acquired data AnalogOutput (string output number) the register shift, before moving to the next State > user 'set time' must elapse (Note: the wait function allows you to control the rate of execution of loop and allow the CPU to respond to external events and system tasks and avoid using wait functions at the same time an operation of software...))
- ...
- t(n-1) if ' end (made requirement) "> goto 'stop', ' another (not requirement not)" > goto regardless of 'State '.
- stop
- write a text file of data (string).
-
Race conditions manifested in the state machine in queue
Hello
I ' am developing a vi in which I use a design of producer-consumer model.
the producer s enqueue States for the consumer. but at a certain point in execution of I want to enqueue the next state of the statemachine consumer, within the State of the consumer himself. This causes a problem?
in other words I have given queue in the loop of consumer can also. so the man the next state of consumers will depend on the data in queueThank you
I make extensive use of Handleres of Message queue where the "producer" and the consumer enqueue for the same queue.
A "Firinstance" of work today: here are two screenshots of a part of the same code
The top loop controls the State of a semi autonomous process where data is collected.
- an event is detected, triggering the start of the measuring cycle
- Data are being gathered
- Another event tells the top loop that it's time to stop collecting data and "Analize" is sent to the end opposite to the consumer
- The buffer empty analize, formats the data and continues to the State of "Log".
The thing to remember is to use a priority queue. Enqueue to place free and flush properly, in front of end control. See also 'A trip to Grandma's House'.
It is a very powerful technique for applications where you want abstract on the 'what' and 'When' the how and just leave a "do".
And Yes, if I had chosen a unrestricted data (string, var) rather than an enum type and built the lower loop as a child class, you have a "player".
-
the user change list of diagrams to run
Hi guys,.
I'm writing an application that will allow users to add the game testing and delays a list in any order, then exicute the relevant schema for each test in order.
I had a play with statemachine arcitecture but cannot make it work.
Any suggestions on how I can go about this?
I want what he consit of a list box whose elements can be added.
Thank you Zac
Take a look at the Machine of State JKI; It is a machine of the State in queue based on a string. I used it successfully for a while and one of the things I've done during development was to put a text box on the front panel to allow me to create sequences on the fly. It requires a bit of work to learn, but it is well worth the effort.
All you need to do is type in the sequence of States that you want to run interactively.
-
Timed automatic Boolean control
Hey,.
I hope it's a simple problem. I want to be able to control the Boolean input to my case structure with "button" on the inside. I want to be able to have the entry which is held to 'true' for x amount of time and be maintained 'false' for y amount of time. More loop on "true" / "false" number time z. IM confident enough on the last part, but I can't find a way to change the Boolean States on a timed basis.
I have attached the Vi
Thank you
Adam
Hi Adam,.
I would use a statemachine: your problem is reduced to only two States...
-
How to stop the VI and a Sub VI together
Hi, in my application, I have a vi with a state machine with a loop of event handler. One of the events in my loop of event handler is out who runs the State of the output of my state machine. I also have an under vi outside my statemachine.
The problem:
1. at the exit of pressing my Vi does not stop.
Reason: my sub vi is still running.
Need solution : How tp stop the two loops together using the exit button.
StateMachine P.S:1.My is inside a while loop and while loop runs inside my sub vi also.
2. both the loops are parallel, since I'm on queues in it.
2. both the loops are parallel, since I'm on queues in it.
There are many ways, depending on your architecture.
Can pass you a message from out of your event loop to your another loop on the queue?
Another way is to use a global Boolean variable 'Stop' and use it in your second loop exit condition. Set it in the event loop when you want to stop the program.
The producer consumer example stops the second loop by closing the queue during the first loop stops and then to capture the error when the second loop trying to read the queue.
Maybe you are looking for
-
TOSHIBA StorE 1524E-1HK0 - does not work after moving
I just moved to another apartment and installed all my computer stuff. Unfortenaly my external hard drive won't give any connection to the PC. Also not to another PC. The light is red and blue turning. All cables are connected correct. To turn off th
-
Unknow Device for HP DL380 G7 using Windows Server 2003 32-bit
I need help to identify the right Windows 2003 SP2 32-bit driver for an unknown device in the Device Manager on a HP DL380 G7 server. I have attached a screenshot. The only information than the other, is that the device can be a PCI ISA device. Any
-
Problems HTTPS: lack certificate root approved
Hello After a malware attack (potentially not associated), I ran into a problem where the 'Authority of Certification COMODO ECC' certificate is no longer listed as an approved root certificate, which is causing notifications not secure in IE and chr
-
Problem with update of the system after running a registry cleaner
I am running the latest update of the 3.14.0017 system and after that I ran the McAfee registry cleaner (big mistake!), I now get "not applicable to your system of packages were found. I tried a system restore and restore failed. So I uninstalled th
-
wireless problem: how to test hardware and software
all of a sudden my wireless connection is gone. don't know if my router or laptop. Here's what I did (a) all other devices work. My mobile phones (5) and XBox work on routher (b) computer laptop at McDonald's, connection Wi - Fi does not (c) took the