Event Structure/foot control

All,

I have a project I'm trying to acquire a reading of a Magna Mike. While I can do this successfully via a button on the user interface, my users want to use the supplied pedal that sends the data via RS-232 port. The pedal is connected the Magna Mike.

My problem is that I can not understand how to tell Labview that the foot switch has been pressed and say that data are sent to the Structure of the event. Any ideas?

do not use a structure of the event to the polling stations.

in a vacuum vi put open visa initialize the serial port, you need, start a while loop and in this wile, use a shipment of t with endcharacters possible visa,.

followed by a reading of x characters (the answer) visa and show that answer on the façade.

user error in and sequencing error and check the error to stop the ored with a stop button loop read you also inside the loop.

After the loop, you close the serial port of visa and display the content of the error e.

Good luck

Tags: NI Hardware

Similar Questions

  • Event structure/state machine

    Here's the scenario.

    I use the buttons controlled by the user in an event structure to control a state machine. Currently, I have a different State for each button. However, 4 or 5 of these buttons could ideally correspond to the State, which is what I would like to get... Each of these 4 or 5 buttons causes flow data and the results are stored in a table, but listened data are different for each button! Therefore, if each of those 4 or 5 buttons caused the same condition occur how I could decipher what button was pushed? Ideally, I would have 4 or 5 different paintings once all the buttons are out of the same State.

    Is there anyway that I can achieve this?

    Hi the shots.

    you have access to the refnum of the element inside the event. With the Ref, you can simply get the name or any other property of the control to distinguish them.

    Mike

  • Controls that trigger cases of timeout event structure

    In a structure of the event, we can understand the controls in the event of timeout. But if we do it this way, we do not get event data node associated with the controls. I don't know if it is a good practice and whether there are issues listed. Please comment. Thank you.

    guangdew1 wrote:

    In a structure of the event, we can understand the controls in the event of timeout. But if we do it this way, we do not get event data node associated with the controls. I don't know if it is a good practice and whether there are issues listed. Please comment. Thank you.

    A 'practice', it's what you do. You talk about a limitation (or characteristic). Event data nodes display only those items that are common to all the events of this particular event case, so for example "old/new val" is not available if there is also a timeout that is assigned. If you do not need them, it does not matter whether they are there or not.

    This often isn't a problem because you usually only the new value and you can get that by placing the terminal control inside this event.

    If you need the specific event data node, create an otherwise empty case event dedicated to control and raise the timeout event temporarily affecting the timeout to zero using a shift register. Set the time-out period to zero in the case of timeout events. If the new value is also necessary in the case of a time-out, leave the Terminal inside event newval event data node timeout usage in the case.

  • Control a Subvi VI main using the event Structure

    Hi all

    I'm moving hand Vi VI Sub values...

    However, my Subvi works with a structure of the event. (Change in value).

    So when I run my main VI and I press the highlight (yellow bulb), the sub vi does not run...

    I'm sure... I m missing something very basic.

    My main and the Subvi operate with a structure of the event.

    Please see my attached files.

    Each event structure listend to a button to calculate different: one on the respective fromt Panel. (Even if they have the same label, they are completely separate!)

    Events are mainly for any user, they won't be triggered if a terminal is written by program. If the front panel of the Subvi is closed, you cannot press the top button.

    Can you explain the purpose of your exercise? You seem to confuse you upward in some misunderstandings based on the flow of data and events.

  • How to merge the event structures?

    I have a program of VI script that reads a text file of records and displays a structure of the event.  It works very well because it creates all the controls and indicators I need associated with the defined registry and code backend (i.e. the structure of the event).

    After I generated all this code, I copy and paste in the main VI I develop.  Everything works very well.  The only problem is that there are 100 text files from separate registry.  This means that I end up with 100 separate event structures.  Although it works, it takes a lot of space and I prefer to combine them.  However, each event structure has anywhere from 15 to 75 entries, so to do this manually is not an option.

    Is it possible to selectively merge the event automatically structures?

    I guess I could write a labview scripting routine that could get a reference to the structure of the event in VI, then merge... but part of the problem there is that there are a handful of structures of event I want to separate them just because they are not associated with the set of registers, that I mentioned.


  • Best way to code structure to control several instruments

    Hello

    I am a novice but not inexperienced labview programmer. I'm writing a labview code to control a physical optical experiement. This involves writing a GUI which of your interfaces then with a variety of instruments (such as motorized turntables, lock-in amplifiers, power supplies, Renault, etc...) all connected to the computer through various means. All the instruments are delivered with their own labview drivers to complete their most important functions. Essentially, the instruments will operate independently, but occasionally, will be a set of steps involving several instruments (such as move, take a step, move again,...)

    My question is what is the best way to structure the top level VI where all GUI controls? I have currently the code structured so that each instrument has an event structure that manages keys and commands for it. Simple events like the movement are dealt with in the cases where structures themselves while queues and occurrences are then used to handle more complicated events in external loops. It is an appropriate way to handle this scenario, or is it that most commonly architecture?

    Thank you for the help

    You play with fire when using several structures of the event. My preferred method for executing an instrument that has a 'stream' mode (example: a spectrometer where you always see the spectrum), is to provide that it is a clean line, with a dequeue item. The 'element' may have a message part (or State) in the form of an enum or string, as well as some data in the form of a Variant. You want to set a parameter, you could send a cluster containing the enum "Set the parameter" as well as the value of the parameter in the form of a Variant. The default case would be to get a spectrum and update a graph (or send another message to a user interface management loop that updates the chart).

    You can open the project template QMH who comes with LabVIEW to see how a line would work, and then you can add multiple queues for different instruments. I keep the new loops in their own SubVIs and reference to the queue in a global functional to clean the main schema.

    Here is an example of what your data of the module flow record might look like (the string constant empty considered double quotes is by default to expire the message dequeue)

  • mouse event structure entrance decoration

    I want one of my events in my event structure to detect my mouse entering a specific decoration that surrounds a control. I used the property pane to find what decoration is # but now I don't know how to call this specific décor as one of my events.

    The goal is that I want the user to have pushed a button to make a data folder before hitting to start generating data. I need the user to get an error message that they did not create the folder if they get even close to the Start button. I don't want to get the error after what they already hit early, because my Start button is linked to the data to a network variable that will get the ready message even if my host program has generated an error.

    Decorations of the façade are not the type of objects that can be associated with events.

    I think you have several options.

    1. follow the mouse move event and to compare the coordinates of the mouse with a few constants that you set that based on the location of the decoration.  This seems to be a large number of polling stations.

    2. not to associate your button start a dependent shared variable in the network.  When you press the Start button, make your comparison, if that's OK, and if not, the error.  If it is allowed, activate another hidden Boot button that is associated with your shared variable.

    3. use the mouse down? event on the Start button.  If you find that it is not a valid time press the button, ignore the event.

    4. use the event mouse input on on the button itself.

    5. use the event mouse entry on another button, which is located behind the actual button.  It could be transparent, or disabled, or disabled and greyed.

    6. If the button get press, the program automatically creates the folder for them instead to raise a dialog box and forcing them to manually.

    I think #6 or #2 would be the best option.  As a user, I would find it quite annoying that whenever I swept the mouse over an area of the screen especially involuntarily to have a pop up dialog box.

  • 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.)

  • 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.

  • While loops and event structures

    Is there a problem using more then one While loop with an internal structure of the event, in a single VI?

    In my (only a partially attached printscreen) VI there is more then 2 all in curls with a structure internal even who controls a different devices.

    Event structures are being controlled by a box structure.

    From time to time the VI gets stuck and resetting local variables.

    Hello

    Using two while the loop is not a problem, it depends on how you structure the code.

    Generally, we use two while loop for Producure-consumer, master - slave structure type of applications. Try to use the structure of State machine inside while loops, see standard state machine examples in the palette of NOR find example.

  • 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

  • Event Structure/AC help

    Hello

    I'm stuck... I have some difficulty to find out how to make my VI attached to behave according to the needs. The highest level 'EventStructure.vi' VI is an interface user of façade to a printing application label (using ActiveX). Loading the VI he sits in internally while loop until printing or buttons on front of output. If the product "select" drop-down has a change of value I love out to the special label for this product file and read a serial number from the label file variable and indicate the serial number on the front. I wish I had the façade VI keep this serial number that there is another change of the value on "Select Product" but right now it only he holds on the front panel so that the next time through the whole loop. Also, the string containing the path to the file of labels only holds in memory until the next time through the whole loop where it is cleared. Is it possible to have these values stored in memory and only change when there is a change in value on the drop-down list box "Select Product"? I do not understand that this behavior is the General event Structures work, but I am unable to find a better way to do it without using a Structure of the event. The sub - vi 'GetNextSerialNumber' calls to an external application using ActiveX and it takes a while (4-5 seconds) so that the application load and process the ActiveX controls so I want to just call the external application when there is a value change on the drop-down list box "Select Product".

    You need to store values that you want to keep in the shift registers. This will allow you to pass the value from one iteration of the loop to the other.

  • replace event structure

    Hello

    I have a nice code that works very well. I got my event OPI program.

    Currently, the event source are control or button on the front panel.

    I want to improve my program. I need my program to run automatically (I need for my program will read a text file that gives instructions to the place to obtain the instructions of the user).

    I want to use my old program. can I change my code. so that the structure of the event will work according to instruction written in text file?

    It is impossible to download my program it is pretty great, sorry.

    Thank you

    I guess that your entire program is locked in the Structure of the event, and that you have only a single loop.  Indeed, you can "drive" the Structure of the event from a file.  What you do is open the file and read the information (that you can do before you start the event loop).  Let's say you have two controls, 'File Path' and 'Go', both set as a value change events.  You read the path to the file (from file), then you create two nodes of property with the Value property (Signalling) for the path and to Go.  Wire the file name to filename signalling value entry (you may need to change the property node to 'Write') and a 'true' value signalling go entry.  Error line allows you to make sure that you perform these property nodes in this order, and before the Structure of the event.  Now at the start of the Structure of your event, it will act as if you manually put the data in the controls on the front panel.

    Bob Schor

  • Event structure vs business structure?

    I'm developing an application that can be fairly entered user based... a lot of command buttons Boolean to do different things.

    In the past, I was able to avoid the event structures "change value" and went instead with a while loop, stacked sequence and series of structures of the case. After, I decided that it was a terrible idea. This time, I intend to build an array from a Boolean, convert it to a number and feed it in to a unique business structure. This will give me the ability to add cases for different combinations of the Boolean being pressed.

    I guess the question is: what is the best way to do something like that?  Does have advantages over the other?

    Edit: I was not clear.  I would like to a comparison between the method of structure of event 'change of value', and just feeding into a table-> structure of the case.  I also fear that with the bool-> structure table affair I'll run problems where I find myself with too much control variable and the value of the resultant becomes ugly number very quickly. The application has several buttons... then, finally, save, load, several different configure configuration buttons etc.

    Thank you!

    Aalenox wrote:

    I guess I could do two separate loops running simultaneously.

    ^ ^ ^ THIS!

    Search for architecture producer consumer

  • 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

Maybe you are looking for