reading two sensors (alternately) in a structure of the event permanently

Hello

I have a structure of event with various functions of the user interface. The entire application is on a laser diode control and playback of two light sensors IR which cover different wavelengths (if and InGaAs). The two sensors are connected to the same AD converter, but to different channels. So if I want to read the two sensors, I have to change the setting of the "Converter" AD channels. The real question is how to implement playback continues two sensors in the structure of the event? I want to be able to read alternately each sensor in a span of 50 or 100 m is possible, another using function of time-out of the structure of the event with a kind of logic xor for switching channels? Maybe something with more features (somehow by a timed loop)?

Any idea is welcome.

Thank you and best regards,

Gregor first

P.s. The sensor reading is done by a National Instruments SPI map where SPI is the master.

2010 VI converted down

Tags: NI Software

Similar Questions

  • Read DAQmx in the structure of the event

    Hello world

    I am currently working on a DAQ application that will (ideally) have 3 tasks DAQ sampled at different rates with the results displayed on different maps.

    I use a USB-6009 box alongside a cDAQ-9174 with 9201 and 9211 modules should have enough clocks.  I would like the application to each sample continuously or for a dependant of time done on user input.

    After reading the help files DAQmx and looking at the sample code I came up with a code for a single task. I enclose an excerpt and the VI.

    The code is almost as planned, "capture" a click on the task of data acquisition starts reading the data and display each 0.1 s.  The issue I'm having is that I cannot select the 'Stop the Test' button at the end of playback.  I guess this is because of the structure of the event, but I don't know how to solve the problem.

    I would like to develop a program that reads from all 3 tasks at the same time in this unique event.  I have limited experience so any help appreciated!

    Thank you very much

    Peter

    You need a trigger to start shared. See this document for more information:

    http://zone.NI.com/DevZone/CDA/tut/p/ID/3615

    Felix

  • How to manage the structure of the event with two loops

    I have a question about the structure of the user event with 2 buttons?

    key 1: START LOGGING DATA

    key 2: STOP LOGGING DATA

    How do I control my

    structure of the event so that it will work? because now that the loop is save data... I can't stop the loop, when I clicked on buttons.

    super_saiyans wrote:

    the problem with moving it is that I don't have control of the DATA RECORD STARTING?

    Of course, you do.  When you get your press conference button, you say your state machine to move to the State of logging.  You must also make sure that you return to visit the State to wait for the event to check out the events of the stop button.

  • Front panel locked, but not due to the structure of the event

    Hi it LV community.

    I did a staemachine program that executes an oscilloscope (screenshot of a provided below... the State of the problem). I ran my program yesterday and it worked very well. Then, like a model, a dialog box opens and I just clicked on it in a hurry. now my front hangs as soon as I move the above-mentioned State "the Oscilloscope settings.

    As indicated, I have go a repeat loop that collects successive impulses of my oscilloscope and displays on the front panel (it works fine). In parallel, I have a structure of the event that makes the tail for the real-time feedback of changes to parameters that I placed on the façade (exodus of state change).

    Here's the problem: as soon as I State 'Oscilloscope Settings' using a Boolean button on the front panel for get me there, the front hangs... No event triggered by this point, and even if it did, I already deselected the "Lock panel until the end of the matter for this event" checkbox in the case where the structure menu.

    So WHY is my front lock now? Thoughts anyone?

    Read the detailed help for event structures.

    He urged that a single event structure serve in a VI. There are moments where more can be used effectively, but caution and a thorough understanding of the structure are needed.

    The problem is that you have several structures of the event in the various cases of the state machine and they are set to respond to the same events.

    When the button Set Oscilloscope, the structures of the event in the purchase Menu and home screen States receive the event. The two lock the screen, but only one of these cases may work. It can transfer control to the State of the Oscilloscope settings, but the other event responding to this same event structure maintains the locked Panel.

    The solution is not not to release any of the event. The default value is usually the best setting. The best solution is to spend on an architecture of producer/consumer (events). Who uses two parallel loops. The producer has the one and the only structure of the event and passes orders to consumer loop through a queue.

    Probalby want as the mechanical action on the buttons to lock when you press. Put kiosks inside the respective case of event changed value and local variables becomes unnecessary.

    Lynn

  • Structure of the event within the structure of the case run once

    Hi all

    I am a controller using myRIO and labview where the program compares a value of the probe in a "Preset" and then choose a structure case depending on what type of air supply is required. What can be seen on the picture, for example, is 0 if saturated air supply is necessary.

    The structure of the event is used to send a signal to step to the stepper motors to open the valves (closing is still pretty much in the same way). In any case, the event turns my valves 90 degrees. I read the sensor all a second, however, when the case remains unchanged, the case runs the event again causing my engines running at 90 degrees per second (essentially continuously). What I'm looking for is a way to send the signal to step only once until a new case is selected.

    He is not on the photo, but this is all within the large loop.

    Apologies for any bad/cringeworthy coding, it is literally my first program always using labview. I can post the full VI if you need.

    Any ideas would be very appreciated! Thank you

    Simos wrote:

    crossrulz you have a simple example by chance that uses the feedback node?

    See if that helps

  • structure of the event with a local variable

    Hello world... I tried to make a simple program with the structure of the event in Labview.
    I need to show a value in a table, when an external signal changes its value. (I read a lot of discussions and many documents and I don't understand the thing... Sorry)
    I want to say that I am getting a value of temperature of a sensor in a controller, it works in asynchronous mode sensor, so that the detector Gets a new value in different sampling rate.
    So the PLC program changes the State of a Boolean variable simple that in Labview, indicates that there is new data (newdatareceived---> 1,0,1,0,1,0...)
    I need this draw Labview (valuereceived) value in a chart when this variable (newdatarecived) changes.
    My problem is that the table always puts a value according to the cycle time in its loop and resumes the values... (I tried, with dynamic events and signage value... and I got the same result... It works fine).
    Thanks in advance.

    And the other way:

    Thanks for your time again.

    STPG wrote:

    I've been doing a little test with xygraph and the example works now (thanks!) but I have a doubt, is this the right way or is there a better way?

    No, this code is meaningless. You write new (mostly the same!) points to the graph xy with each iteration (actually at twice the speed at which data can actually happen: 100 ms vs 200ms!), tax system unecessarily and more internal data structures like crazy.

    All you need is a simple loop with a single structure of matter which is true if the Boolean value is different from the previous iteration. Currently, you must add a point (the time for X, the value in Y) to the xy graph. Here is a quick sketch. (You can either use the meter or the elapsed time for X, according to your needs, so change if necessary).

    Events are mainly for the interaction with the user in order to avoid the loop turn unless necessary. Here you are already running a loop to interrogate the instrument and you can easily have the graphic way the same loop. Right?

    You should also be aware that the execution order is determined by the flow of data and not in a horizontal position. If it's important that OCX nodes running first in an iteration, you create a dependency of data (for example with the wire of the error). Horizontal compensation has no effect. The structure of sequence on the left has also does no work, then why is it there?

  • Structure of the event - controlled motor not variable

    I have a state machine that includes certain structures of the event. These event structures are used to control stepper motors using an Arduino Mega microcontroller. I'm using labview in 2012.

    The entrance to one of the events is the variable "pour the entry. I want to use it to control the motor speed and direction.

    If I control the motor as shown in the attached image Working.jpg, then the motor functions correctly. If I fix the motor to the steps variable # then the engine moves at the speed set in the right direction depending on whether the entry "pour" is positive or negative.

    However, I want to control the speed of the engine, not the number of steps, with the variable "pay Input". I checked that the values read by the indicator image INPUT_VALUE works do not are of the same order as the specified values, working, by using the "Set Speed". When I connect the value of the entry to the spindle speed of the motors of the Arduino (not_working.jpg) icon, the engine is running, apparently indefinitely at maximum speed. I don't understand why there is a difference in motor behavior between the value provided by these two methods at the entrance to the speed of the motor. I am confused by the present and don't know where to go from here.

    The structure of the event somehow behaves differently when taking a value from outside the structure to this data inside? or y at - it something to do with the opening of the structure on its first loop?

    I have also attached my vi together, even though she may not be the easiest to follow and requires an arduino Mega to run.

    Carlr wrote:

    I have a state machine that includes certain structures of the event. These event structures are used to control stepper motors using an Arduino Mega microcontroller. I'm using labview in 2012.

    The entrance to one of the events is the variable "pour the entry. I want to use it to control the motor speed and direction.

    If I control the motor as shown in the attached image Working.jpg, then the motor functions correctly. If I fix the motor to the steps variable # then the engine moves at the speed set in the right direction depending on whether the entry "pour" is positive or negative.

    However, I want to control the speed of the engine, not the number of steps, with the variable "pay Input". I checked that the values read by the indicator image INPUT_VALUE works do not are of the same order as the specified values, working, by using the "Set Speed". When I connect the value of the entry to the spindle speed of the motors of the Arduino (not_working.jpg) icon, the engine is running, apparently indefinitely at maximum speed. I don't understand why there is a difference in motor behavior between the value provided by these two methods at the entrance to the speed of the motor. I am confused by the present and don't know where to go from here.

    The structure of the event somehow behaves differently when taking a value from outside the structure to this data inside? or y at - it something to do with the opening of the structure on its first loop?

    I have also attached my vi together, even though she may not be the easiest to follow and requires an arduino Mega to run.

    You have a very inappropriate design of "state machine" - even if you do not have same event in more than one of your structures of the event (in addition to time-out), looks that get some of your treatment to go forward until you get something very specific (and in which none of your other user events are being processed).

    I strongly suggest that first set you design of State machine - perhaps follow producer/consumer Design Pattern (events) rather than having everything in a loop, the way you have.  If you keep everything in a loop, you should consider redesign so that you at least allow events to deal with rather than stay in a loop for an indefinite period!

    In any case, in the case where work, you send variable "Set Speed (steps per second)" for engines step by step write vi.  But otherwise, you're feeding 'Entry for' value - are they the same? And to let you know, you send only command "write" step by step when the input value to be paid.

    It's a big mess!  For starters, look at the attached picture, get rid of your structure of the event that has "for the entry" and replace it with what I showed in the picture. (In fact, all your event structures can / must be replaced with a similar logic.) Does not need the event structure in all this, you're just more complicated it must be!

    -DP

  • structure of the event a substitute

    Hello everyone and sorry for what I think may be a very newbie question, but I can't understand not just how to use the structure of the event in my program.

    The presentation is as follows:

    I'm using labview for control devices in my lab.  I have to activate something for 30 minutes, then heat it for an another 30 miunutes (the first device is controlled DAQ and the second is controlled GPIB).  While these two processes occur, I monitor a temperature using the data acquisition card.  The two-step process is finished, I have to wait for the temperature to be lower at some point and then start again it.  So, I have to repeat this process for a number of times defined by the user.

    My question is this, I use a structure of the event to handle it all (this is maybe not the best way to do it, if you know a better way, feel free to share!).  The whole process of starting the program, I want to be able to stop it at any time in case something goes wrong, and I would do this by using a Boolean on the front panel, because I will finally control the process from a distance.  Is it possible to substitute a case of the event once it has started?  I have no doubt a 'Wait (ms)' VI in there somewhere to facilitate synchronization of processes, but once the VI begins the program waits until it is done before register you for any other button presses.

    Thanks in advance for any response,

    -daman

    You should definitely read up on State Machines!

    Maybe the link in my previous post doesn't work.  Try these.

    Reference design - http://zone.ni.com/devzone/cda/epd/p/id/6091

    State machines - http://zone.ni.com/devzone/cda/tut/p/id/3024

    ExpressionFlow Blog on policy - http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/

    Machine States JKI - http://jkisoft.com/state-machine/

  • Structure of the event: problem with data transfer

    Hello everyone,

    for three days I'm troubleshooting an issue in LabView with the event structures. I really hope someone can help here, because I can't find anything on the entire WEB.

    I had six groups of equal to a VI entry, each containing five checks enum (among others) where the user can specify some configuration of measurement data. I want the program to do is: to recognize if a any of these enum values has been changed and if yes, then submit the values containing the cluster in a subvi then calculates the wiring and affect the material of the ports. In addition, i need to submit the number of the enum element that was changed, so the program is able to clear the user input in the case of a breach (e.g. If the user sets two entries of enum control 1 meter and 2 Group 1 and then tries to set a third counter of entry to port 3, the program displays a message and deletes third entry as the number of entries of counter is limited to 2 per cluster).

    To resolve this problem, I used a structure of the event with 6 x 5 cases (change of enum value 1 Group 1 Group 1 enum value 2 change... and so on until the change in the value enum 5 Group 6).

    The problem is that if the user changes a value, the event structure reacts and performs the proper case; However VALUES of the cluster, the user changed are not subject to the SECOND time that an event occurs. It is a kind of a situation, "n-1". For example, if all five controls Enum of Group 1 are 'disabled' first and the user sets enum 3 of 'Meter entry', the structure of the event runs but submits the values previous to the Subvi (all enums 'Disabled'). When the user makes the second change, say that enum SWITCH1 to "Analog Input", the structure of the event is running again and passes the values of the FIRST user to the Subvi editing, then the Subvi gets data "enum 3 meter inlet and all other disabled enumerations.

    In easier words: if I have new values on my cluster "Kanal 1" (left side of the screenshot) and run the structure of the event, on the right side to "Kanal 1" indicator, I get the previous values (n-1).

    The structure of my event is in a while loop. If I create a timeout every 10 ms, and a loop of 250 ms the waiting time, I got the 80% chance that the recent changes are transferred to the Subvi correctly, in other cases I have a delay of the 1 step as described above. It seems to be directly based on the time that I specify the while to wait - but I can't explain it and I cannot accept a less than 100% chance to transfer the correct data, nor can I accept delays of a few seconds for each loop run. If I indicate timeout (infinite) get delayed 1-1 step values in all cases.

    When I specify cases of event to react on "all items value change" of the structure of the event behaves properly - but then I can't handle indicate which element has changed, as the CtlRef of output in case of a structure does not specify "enum 1, enum 2..." but only "Group 1".

    Does anyone have a solution to this? It is certainly a problem with the structure of the event, but I can't understand what to change.

    Thank you much in advance,

    Mr. Boiger

    This is because the terminal is read until the structure of the event runs.   Terminal is read, the event structure is waiting for an event.  The change in value.  Business events are running, but the value is the old value.

    Put the terminal inside the event.

    Or, you can display the connector called "New value" on the side left (stretching down from the border of the node 'CtrRef').  Use a wire one to come.

  • using the structure of the event in the LabVIEW classes

    Hello

    I'm new in the use of LabVIEW classes, so don't know much how I can use them.

    In my main program, I have clusters with five elements in each. The elements are controls two States and in some groups, there are three States controls. The user will press the buttons (controls), and different things will happen. In my first program were I not using classes, I had a structure of the event and the controls were cases of event in the structure.

    Is it possible to somehow use an event of cases in one of the methods that is created in the classes, so that say, that's not in the main program?

    I have attached two photos: I wanted to have a structure of the event in servoTouchEvent (in left.tri.lvclass) who is a child.

    Let me know if my explanation is not clear.

    Grateful for the help!

    Hello

    Yes, you can have a structure of the event in a Subvi rather in your main VI of top-level UI. The trick is to use the 'Save for events' and passing in references to orders that you want to have the event trigger structure for. The refnum output since the function is entered in the terminal of dynamic event of the structure of the event who could live in a Subvi. You can add instances of event where you will see these control events as dynamic events then you can do something with. These excerpts from shows all the code in a simple diagram, but the stuff in the structure of disable diagram could easily transformed into a Subvi:

     

    All this can be done without classes. What will buy classes you include the ability to encapsulate your screws and also perform different code based on what object on the hierarchy of the parent-child classes is on a wire. If the behavior of your code is different between 2-3 State and controls (which I do not know what state controls 3 you are referring), you can take advantage of the classes.

  • reset the timer using a structure of the event

    I wrote a simple code to count the second and the timer can be reset if I press the button "reset".

    It works; However, there are two problems,

    1. when I run the program, the timer takes 1 second to start

    2 when I press the reset button, the timer also takes a second to answer

    I think it's the 1000ms that is connected to the left corner of the structure of the event. Is there a better way to overcome this problem? (the timer starts and resets immediately

    When I launch the program and press the "reset" button)

    Thank you!!

    Dear ivy037

    You can make the time outside the structure of the event as in the attached code.  I would like to know if this is satisfactory.

    Thank you

  • At all indexes on tables of the same value in the structure of the event

    Hello

    I have a panel with the four bays and I use a structure of the event.

    Now, I want that change of the index of array_1 also affects the index of 3 other tables at the same index.

    But there is only a property "value Exchange" and no property 'index-change' in the properties of the table.

    So I read the 'index' property and write in the other table.

    But: It seems as if I have to do so within the period of waiting-section of the structure of the event.

    Is there another way to do this?

    Thanks for help

    You can use the mouse event on each table to detec the event (of course, that will attract not only a change of index, but I don't think you care too) and then use the 'values of the indices' property on all the table to set.

    See annex VI (LV2012), hope this helps

  • structure of the event to turn on and off a LED

    Good afternoon

    I would like to activate a part of my algorithm according to the value in another part. To make it easier, I symbolize the value by a button and tried a structure of user event to turn on or turn off an LED located in another while loop.

    I can turn on the LED, but unfortunately I can't spend off of the LED thereafter.

    It is possible to change the structure of the event and select the option "change value". However, I would like the fatest way to turn on and off using the structure of the event and the Bay. I mean I would like activate a part of the algorithm only if the button is enabled for not having a continuous audit of the value of the button by the structure of the event.

    Please, if anyone has an idea to turn off the LED (after the switch on), add a comment without hesitation.

    I will be happy to solve this simple problem.

    Thanks in advance for your help.

    Ragards

    You have a race condition.

    When you click stop, it's a race about whether if the event gets not saved and destroyed by the removal of the stem all loop against sending the same user in the lower loop.

    Why it only seems to happen with the case of false must be a quirk of how the code is compiled and the order, it is run.

    If you put a step between your Boolean switch and LED, for me anyway, the error is now generated on the true case of the structure of matter (always false for switch.).

    If you put a constant error in the lower loop and wire while guaranteeing the Unregister event so that you now it does not run until the two while loops are arrested, then I don't see a mistake regardless of the value of the Boolean switch when you click stop.

  • Right-click in the structure of the event for Mac OS

    I put a right-click to activate a case of event (with the mouse down? function) in a structure of the event. It works fine in Windows 7.

    But when I try this in Mac 10.10. This does not at all.

    I connected an indicator in the "button" in the case of the mouse down and found the two clicks left and do a right-click returns 1.

    In Windows 7, left click returns 1 and do a right-click returns the value 2.

    Does anyone know how to activate the right click for the structure of the event under Mac OS?


  • How to use the structures of the event for long-running tasks

    I created a state machine that scans a cluster of Boolean controls in a State of 'home '. Most of the States run a Subvi or two in ~ 100 ms or less.

    However, a State run for 10 seconds.

    The code works but the user interface is limited because the controls are outside the cluster because they provide inputs to the structure of State machine case but do not cause changes in the State. In other words, I all orders cluster stacked vertically on one side of the main panel and do not have the flexibility to move the controls to the more intuitive positions on the Panel.

    My question: How can I convert this code in a structure of the event and keep this long term 'event' and prevent that the operator by clicking another button event during the execution of this event?

    Thank you

    You say you have controls outside of your main code... You should really put these inside and manipulate them in a State of your state machine is initialized. This allows you to make changes to the code easier and limits of line entering your outside loop.

    You can do different things to lock the user.

    You can disable specific controls so that they can't be clicked or edited.

    You can use the palette of the mouse to define the busy cursor and disabled again once finished, I do this a lot during treatment when my code something loads the user just clicked.

    One of my favorites is to set a Boolean value in your data that passes through you event titled structure "disable mouse." When the value is True, a mouse down event will effectively reject the event, clicking on disable. I also added an event mouse move where if the bool disable the mouse is set to True, it moves an indicator of string with the mouse by telling the user why it is disabled.

    If you want more specific suggestions, I suggest to post an excerpt of your code, or attach your screws, so that we can better help you.

Maybe you are looking for

  • Stor.e TV - last 23% space HARD drive cannot be used

    Hello I bought a multimedia hard drive 1.5 TB Stor.e TV. I recorded 1.4 TB VOB files and some files are ilegibles (the last copied files). After deleting some files, leaving the 23% of free space and compress the disk, reads all the files that remain

  • XP Pro SP3 still slow after a month of following threads

    I built a computer for my wife and he played wonderfully up until a month ago when she told me that she thought she had a virus because his PC is really slow. She was correct and I found and cleaned several threats to his machine. Even created a Kasp

  • Impossible to install the Bluetooth software

    Hi all When I tried to install the latest version of the Bluetooth 12.0.0.3600 for my T430s software, the installation will stop at the end with a Chinese error message. I would like to attach a screenshot of the error message, but can't seem to find

  • L2TP and GANYMEDE +.

    Hello. I have PPTP server on my Cisco 3845 router with authentication on freeware GANYMEDE + Server (Linux). GANYMEDE define ACLs and IP address for users. Recently employers decide to migrate to L2TP over IPsec. Moreover the old server PPTP should w

  • SOLVED: Computer laptop Windows 7 Home 64 bit has lost network connection (worked without problem for more than a year)

    I have laptop computer power and the router without effect recycled There is the same problem with the laptop turned off firewall. Connection failed even when using the ethernet cable. Can not ping router (return message is "General failure"), but ca