Engine step by step running an event Structure

Version: Labview 2012

I have an event within a state machine structure. I want to use the State to choose each drive a motor by defined parameters, State of the 'ok' button or via the signal by a State to "pay input" of the knob, there is also a timeout State.

The expiration time and OK button States work properly, input state for does not work. I enclose a copy of my complete code, although it may not be easy to follow, and also pictures of the States.

I took the initial a sample code. In the example of that input state to pay has been fuelled by a dial, I changed it be motivated by the input value to pay. I think that the motor does not move it is because the State of entry for does not (using the probe) but I can't work on how to make it run. When you use a dial I think that the use of the dial executed somehow the State. I may be wrong in my assumption that the executing State is the problem.

Any help or advice on how to get this to work would be appreciated.

For an entry is an indicator, it will not trigger a value change event. Instead of connecting the new value of the indicator to connect to a node property set to 'value (signaling)', this triggers the event to change the value.

Ben64

Tags: NI Software

Similar Questions

  • Running two engines step by step at the same time of a port

    Hello

    I have to run two motors at the same time - was used to move a linear ball screw and the other to get a grip. I do voltage and test on small twist wires, but the tension and torsion must be made at the same time. I must also build capacity for each engine to take several steps, IE. have an engine steps number at speed x and then move x number of speed z steps. The two engines must be able to do. However, I have problems to make the engines to run at the same time and to take all measures. The engines are connected to two RMS Technologies R356 controllers. The two controllers are then connected to a RS485 to USB converter card and this card is connected to one of the USB ports on the computer. Currently, I spend an array of orders to two loops each VISA containing read and written. I have attached the vi to watch. All the stuff in the code synchronization is because a new order cannot be sent to the controller until the engine is running the previous command. If orders are sent right after the other, the controller will not execute the first command and then return with an error.

    Does anyone have a suggestion as to what I'm doing wrong?

    Thanks in advance for any help.


  • Read the output values after each step runs in the User Interface of LabVIEW

    Hi all

    Development environment: TestStand 2010 SP1 and LabVIEW 2010 SP1

    Problem: is there a way to run the following steps programmatically and get values out of each of them?

    I have already extended a bit a complete interface IO for TestStand load any sequence, choose among the measures and execute step by step (something as an alternative to the steps run selected). What I'm trying to do is to add some actions between each step and do in the UI (I can't change the sequence!), so I start the NewExecution with some previously configured InteractiveArgsParam and option breakAtFirstStep set to true. Eventually I do just something like step over when debugging the sequence and it works well, but I didn't do well a way yet to read the output values of the place...

    So, if I wait before the end of the run I can read my results by treating the ResultObject, but it works only after the completion of the test sequence. Because I wanted to stop after each step, read the values, do some actions and continue to the next step, I've tried to register a running Trace event reminder View Manager. I see that after each step is executed, this event is fired, but when I try to read that a ResultObject returned in the event data it is not filled with values (ResultList seems to be empty?). Is this a correct behavior or maybe I'm reading the wrong way? (It's the same VI regarding the reading of the ResultObjects after the sequence ends and there it works very well for tables, containers and other types of data).

    As I mentioned I can't change Test sequences, I can not add a UImessages.

    What are my options? If the trace event returns output all the values from each steps or is it just used to check the status? Or maybe there's a completely different approach to this issue?

    Thanks in advance for your suggestions,

    Best regards.

    When you manipulate the UIMessage trace (you need this before the return of the event or you will present the race conditions), download myuimessage. Thread. Then call Thread.GetSequenceContext (0, & Iplease).

    And then on the context of the sequence, either go to PreviousStep.Result if it exists, or watch Locals.ResultList.

    Trace events occur between the steps executed step the more recently is the previous step, but it is also a trace event to the beginning before any measure have run at this time, there will be a previous step.

    Hope this helps,

    -Doug

  • NI Stepper drive is compatible with NEMA 11 both NEMA 42 engines step by step?

    I have an NI PXI-7350(Motion Controller), a UMI7774 or (Universal Interface), and a (Stepper Drive) P70530 NOR and tried to connect the new NEMA 11 stepper motor actuator linear Hayden Kirk and kept getting a constant red flashing light on the driver. I then plugged my new actuator linear motor NEMA 23 stepper Hayden Kirk and the pilot got the green light ahead go and it worked fine. I consulted the manual and saw that the driver was compatible NEMA 17-34 Steps. I tried the third affecting both the NEMA 11, nothing helps. Does anyone know a player NI Stepper, which is compatible with my UMI and motion controller and is also compatible with a NEMA 11 and NEMA 42 (another engine step by step I need) stepper motors?

    Hello T.I.

    It is true that our engine controls step by step only have been evaluated and tested for engines not to not NEMA 17, 23 and 34 size. I personally haven't seen or worked with readers with the NEMA 11 or 42 engines step by step, but given that NEMA standards are only a standard size, as long as your engines are under tension, power and plug for your engines to P7000 series inductance, walk, then they should be able to work.

  • Arduino/LabVIEW input acquisition and control engines step by step at the same time

    Hey, I'm doing my last year of electronic engineering project and I'm trying to control 2 Motors step by step with labVIEW. A microphone will be placed on a platform that the stepper motor control and adjusts the position of the platform according to noise levels read from the microphone. To control stepper motors, I use 2 controllers engines step by step Sparkfun.com.

    https://www.SparkFun.com/products/10267

    These controller requires input of pulse. I'll use a DAQ 6008, but I don't know if this can produce a pulse? I also thought using the Arduino to control stepper motors that work perfectly with the controllers, but it would be able to order the engines while gaining an analog voltage to the microphone?

    I appreciate any help you can give.

    But you can use LabVIEW to work with the Arduino using the tools described here http://sine.ni.com/nips/cds/view/p/lang/en/nid/209835

  • Clear VISA with event structure

    Hello

    I have a number of virtual serial ports of bluetooth as stream very quickly as soon as you open them with VISA configures port. I have set up/open these ports one after the other and it takes a lot of time (2 min), I think it's because they are com ports virtual bluetooth.  However, as soon as a single port is open, the data streams in and fills the buffer (eventually crashing the program), while I open other ports. I was invisioning something similar to an interrupt driven microprocessor to erase the buffer whenver it exceeds 2000 bytes to the port, my friend told me about event structures is similar to interrrupts. So, ideally, I would like to create a user event customized, defined by the property (bytes to the port) of a VISA com port node when it exceeds 2000 bytes. I would like just to run code that was going to free the buffer when occurs the same. Seems like a simple idea, I searched and did not find what I wanted to do.  Any help would be appreciated

    Thank you

    Chris

    Its delicate, but I think it would work.

    LV allows multithreading, so you can certainly run screws in parallel which are completely independent of each other.  But the challenge is that your code cannot access the same COM port simultaneously.  But the way you described the problem, which could be circumvented.  I think your 'COMPortMonitor' could sit and wait for each port to open before their follow-up... so that your main loop before opening the following COM port.

    Here's what the flow would look like:

    VI of HAND PORTMONITOR.VI                                      

    0 Begin execution of this

    1 separate launch PORTMONITOR.VI

    2 open COM1 begin implementation of this loop

    3 tell PORTMONITOR COM1 is open

    4 begin to monitor COM1

    5 open COM1 empty COM2 buffer when it becomes large

    7 tell PORTMONITOR COM2 is open

    8. start monitoring COM2

    9 empty COM1 & COM2 when they become large

    10 stop this loop when last COM is open

    11 more...

    In step 5, your parallel loop will work with COM1... so that your main loop is busy opening COM2.  In theory, I expect to run independently.  And you can try to put them in separate threads, too.  This links talking about parallel loops in series:

    http://forums.NI.com/T5/LabVIEW/multiple-parallel-asynchronous-continuous-serial-visa-reads/m-p/8090...

    BTW: I think that you must ensure that your VISA application is asynchronous to operate (right-click on them).

  • Reading of RS232 event structure

    Hello

    I use the Write.vi to read RS232 attached as a starting point and do RS232 - help.vi him. successfully, the original written 1 posts, then wait a little, then reads 1 message. What I'm trying to do is to be able to read several messages. So I would write 1 message and I would read 1, 2 or 3 messages back or however many messages to ever come back, I guess that.

    Here is how I modified the original vi to get where I am now:

    I tried to add a structure of the event around half 'read' RS232 program. My structure of event triggers when the bytes to read the changes, this value can range from 0 to several bytes to be read, or muliple bytes to read 0. Up to half of the time I would trigger and not need, so I then added the accession of case which only works when the bytes to read the value is not 0, which means that it must be something waiting to be read whenever the program inserts this box. (I hope that's clear).

    At the moment, my program will not read and I don't know why. Through the program of first base, I can read and write properly. (I just hooked pins 2 and 3 on my cable so I read everything I write for testing purposes). So I know that the problem is spoil me the 2nd joint program

    Any help would be appreciated! Thank you.

    EDIT: I added 2 .jpgs incase you are on an different labview version.

    Better.

    But I don't think that permutation of the structure of the event for the structure of the case actually has really helped what.  In fact he madet worse.  You had the case of locking Panel event before the value until the end of the event.  But with the structure of the event within the structure of the case, there is a chance that the structure of the event will never run and therefore the façade will be locked up forever.

    1. you want to only 1 VISA close.

    2. event structure has been set.  I also added an event for writing switch is restored.  So now, it'll write if you change the channel or when you turn the switch to True.  (Note, you will not be able to always send the same string as in the original example because you must press the power button or change the channel.

    3. I used the structure of the event to stop the loop of both Scripture by trigger on the event that the button is pressed.

    4. I don't know what you mean by a «black» read

  • Structure of the event in the event structure

    Is it possible that I can have a structure of the event, which is in another structure of the event? When I run the code, I can't use other buttons. (See chart for details)

    Do not put the event structures in the structures of the event! There is never any reason to do so.

    Redefine architecture your code in a correct state machine.

    (By default, events lock the façade until the event ends and if you raise the event internal or external, first of all, the other event can never fire because the current event can never accomplish or is inaccessible by data stream.)

  • Which situations give an event structure do not capture a Boolean value changes?

    LabVIEW 9 x 86

    Windows 7 x 64

    I have an event structure that works very well.  It has 5 cases, each triggered by a change in value of various indicators.

    I added another case of event, I'm trying to raise the case of the event with the express control "Out of time", I made a deal to raise when the Boolean value "out of time".  The structure of the event does not run when the value changes.

    In addition, once figured out how to make this indicator to trigger structure of the event, I would like to only trigger when the value goes from 0 to 1 and not from 1 to 0

    Search the forums for "event to change value" and "value traffic".

    The value (I guess you have on the structure of your event, bar header you seems to miss information.) the change is triggered only when the user enters new data in a control, or you write a new value programmatically by using the Value property node (signaling).  Completed just by a program written for a local variable, or do not ' value' property node.

    To trigger that in a sense, you can put the code in the event of a case within a case structure so that it runs only when it it True (or False, if that's what it takes.)

  • Two loops of event Structure: hang

    Hello

    I have a wired problem when I try to use two loops with two event structures (see VI below).

    The problem is that you can stop the measurement and close the VI with X but not to stop it only with STOP button: this would lock the façade.

    Here my (rather long and perhaps not quite understandable) description of VI:

    A structure must respond on the user interface and the other a certain action. The first uses only user events: change value button START, PANEL NARROW? and the value enum STATE changes. The second event structure uses those registered dynamically: start the event user & user close event. Action when the STATE changes from button should always be done. When you press start the startup user event disables the START button and activates a loop in the second structure that should make continuous measurement. Now, we can always change the STATUS button and information (this works). The measurement loop should stop if the STOP button is true. Later START is enabled again and we should be able to press START again. It does not work as the front panel is locked. Curiously the last implemented user action works very well: by pressing X of VI, the PANEL CLOSE? is called in the first loop and should stop the two loops: If the measurement loop is running, STOP is True first, stop the loop measurement. Then a secondary structure event waits until the JUDGMENT is again set to False. If the measure is not in the process of running the first loop stops. In both cases, the event close user is sent to the second loop, successfully stop.

    I'm really confused, because I have no idea what is wrong. I would greatly appreciate any help on this.

    Best regards

    Daniel

    Thank you very much! This solves the problem. I did not understand that structures of events queued events even if they are not "active".

    (Finally there is even no need one notifier, you can just change the value of the real STOP button and will raise the event close user, comapare attached, work VI)

    Thanks again,

    Daniel

  • The quit event structure works when I switch the cdaq to crio

    I changed my structure of producer of written consumer 2009 for use crio in 2010 and my event structure enough work. The event source is the same.

    Panel controls raise no events on targets in real time as the cRIO, as these systems have not really accessible facades by the user.  When they do not display a façade, it runs on the separate development of the cRIO system; LabVIEW just give a homogeneous appearance.

  • Event Structure Weirdness

    Last night, SAP posted an interesting question on his blog (The Daily CLAD).

    In short, we create a dynamic event, enter it and generate two events with the data being 1 and 2.  Then we travel a structure of the event that is registered for the dynamic event.  Inside of the event is another structure of event which is also on the dynamic event inside a loop set FOR to run twice.  The data of the event was autoindexed and went straight to the final output.  Now logic would state that the output should be {1,2}.  But when I run it, I get {1,1}.  I thought it was really strange.  So of course, I got to play.

    I changed the buckle FOR to run 3 times.  Oh, it is here and waiting for another event.  If it is to see two events, as it should be.  It's just that for the second event data is not transmitted correctly.

    But let's play others.  I put another LOOP around the external event structure and did run twice.  He does not see the second event at all (that is to say, is there and waiting for another event on the second iteration).  Why not?  It is registered for it?  He saw the first event?  Why wouldn't it the second event in its queue?

    Now if I remove the inside OF the loop and let my loop FOR external, everything works perfectly as I expect.

    Now, it becomes even more strange.  I added a button and changing the value for the button of my external event structure (the two structures event with loops to go twice).  The structure of the external event is also ignorant of my button value change event.

    OR, what the #* $& @* is happening here?

    The problem is not with nested structures event, but with the shared record refnum. An event record refnum should belong only to a single event structure. As soon as share you, you get undefined behavior. It could work very well, he might behave in a totally random way.

    Example of David is wrong for the same reason. He may have worked when he ran, but it is not something that must be invoked. The structure of substantive event should have a separate record node.

  • event structure vs case structure

    I am developing LabVIEW: tool of control and vision. Front Panel has a lot of buttons, each button will execute a single or a group of the screws.

    I found that:

    1. event structure is good for digital change. i.e. the user change a corordinate and motors are moved.

    2. the structure cases is suitbale where such that use click "run MTF", a case structure is executed to calculate MTF.

    I tried to use the structured event to pick up button click but it isn't reliable workign, such as the user clicks too quickly and LabVIEW does not record events or LabVIEW records the event even twice

    However, I have a number of clicks functional structures. My block diagram will be uncontrollable.

    Any idea/tip/trick be greatly appreciate!

    -best

    If you understand how LabVIEW works and understand the principle of data flow, what I'm going to say the will of sense.

    The idea of a Structure of the event, it's that he's sitting there, don't take no time CPU until an event (usually a change in a Front Panel control) takes place.  Then he does everything you ask in its event arguments.  The trick is to do almost nothing in the structure of the event, but to say another loop, running in parallel, to do something.

    The key here idea is you have two loops, running in parallel, independently, at their own pace.  One, the event loop, waiting for an 'event '.  When it happens it it "sends a message" to another loop (or loops) that make treatment (which may take some time) as defined by the event loop.  The point is that it is very fast to send him the message (which is usually done via a queue), so the event loop is able to respond much more quickly that the user can push buttons on a façade.

    However, when the hands of loop event off the Message 'go do this task' another loop, the task may take longer.  If the tasks are put in a queue and then they get finished, the next task is running.  The key thing here is that the two loops, the loop «Ask» (events) and the loop ' Do ', run indepedently and at their own speed, nor dependent on the other.

    Bob Schor

  • Cases of event structure do not work (probably façade is disabled

    Please find the attached VI, I tried the update feature and inlcude a new code. And it ends in a non-responsive event structure.

    Is this a bug (related to the definition of property of "Windows run in a transparent manner") or am I missing something...?

    You have your events to lock the front until full.  If you have a keydown event, the structure of the event 2nd he also captures and locks the front panel.  You might think that you have a timeout, but this loop does not receive the value of timeout until the first so that the loop ends.  Your second loop depends on the completion of the first loop.

    If you do not hit the combination just with a keydown event (or leave of mouse or mouse enter and other events that would lock the front) which causes also this first loop to stop.  You have locked your program.

    As Mike said, have 2 structures of event on a diagram when you do not understand how to work the event structures.

    I recommend reading warnings and recommendations when using events in LabVIEW.    This document has a little more items that I think should be mentioned.  But it's a good start.

  • How to raise events from within an event to an another event-structure

    Hello

    I have two events-structures (struct1 struct2) that are running on the same parallel of time in a loop.

    Currently there is a keydown event in struct1, so when I press a button, then the corresponding event runs in struct1.

    STRUCT2 is used to execute a custom-Petite runtime menu entries.

    What I want to do is to choose a menu entry (which runs a struct2 event) and the of inside this event I want to trigger an event in struct1 (means simulates keypress?).

    Is this possible?

    Thanks for the help

    Use the event to the button, not the keydown event.

    Then in the second structure of the event, use the Value property (signs) of the ok button to trigger the value Change event.

    Felix

Maybe you are looking for