Really having problems conditioni​ng while loop with a front pannel occurance

Hi
I was hoping somebody may be able to help me with a problem I am having running my vi so it acts on front panel occurrences.
The vi in question "test platform v" is in the vi library I attach with this message.
Basically I would like the vi to run continuously and each time I change the front panel values (which set the hardware) the updating loop stops the hardware is reset and the updating loop then continues.
I guess I need to use occurrences so that the updating loop recognizes when the front panel values have changed so the new data can be written to the hardware.
I am having trouble working out how to do this.  I guess so event based code would be best - I ama having trouble implementing this.
I have simplified the code a lot to make the process of what I am trying to do easier to understand.
Hope somebody can help.
Many Thanks
Attachments:
big A 2 and tourist test platform.llb ‏1616 KB

You need a few more tricks.  The answers you seek are in a very simple solution in the attached VI.
You need to understand events and using property nodes with Signal (Very Important)
Matt
www.CompleteAutomatedSolutions.com
Matthew Fitzsimons
Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
Attachments:
genEvent.vi ‏31 KB

Similar Messages

  • Really having problems with organising documents in pages. For example, deleting pages deletes the whole section and I cannot insert a section break as its greyed out & sending an object to background deletes several pages - what the **** is going on???

    Really having problems with organising documents in pages. For example, deleting pages deletes the whole section and I cannot insert a section break as its greyed out & sending an object to background deletes several pages and trying to insert a text box autmatically creates new pages- what the **** is going on??? Is this programme really this badly thought out? I thought everything apple was supposed to be intuitive!?!?!? Help.

    You can not insert a section break into a textbox.
    You appear to have a lot of objects with wrap set, that once you take them out of the flow of text (by sending them to the background) causes the text to reflow and contract into fewer pages. Pages is almost unique in the way it forms up pages in Word Processing mode only so long as there is text on them.
    I suspect you probably have hammered away at returns, spaces and tabs as well to position things, which only works to add to the mess.
    Download the Pages09_UserGuide.pdf available under the Help menu and swot up a bit on how it works.
    You may find this a usueful resource as well:
    http://www.freeforum101.com/iworktipsntrick/
    Peter
    PS There is quite a lot of programming in OSX that is far from "intuitive". Pages is easy at one level, when using the templates, otherwise it can be quite frustrating.

  • Problem using while loop with !=

    Hi, I'm a beginner and still learning the basics of Java!
    Right now, I have a problem creating a while loop to read in two values.
    This is what I have entered:
    while((input != 'a') || (input != 'b'))
           Screen.out.println("Invalid Input");
           Screen.out.println("Enter 'a' or 'b' to continue");
           input = Keybd.in.readChar();
    }    I'm trying to get a input from the user, either the character 'a' or 'b' to continue, where my next set of code would come in and if they did not enter the character 'a' or 'b', it would display the "Invalid Input" message.
    What I can't get to happen in my while loop is that when I enter 'a' or 'b' , I still get the "Invalid Input" message etc. Even when I enter any other character in, I still get the same "Invalid Input" message. I thought the " != " mean "not equal to" and the " || " means OR. What am I doing wrong??

    while((input != 'a') && (input != 'b'))The || operator evaluates to true if either operand is true. If you enter an 'a', (input != 'b') is true, so the code gets executed. Similarly, if you enter 'b', you obviously didn't enter an 'a', so your code gets executed.
    You want to execute the code only if (input != 'a') AND (input != 'b').
    ~

  • Unxepected behaviour with clusters inside of while loop with shift register

    Colleagues,
    I just would like to post here small, but important bug (I guess this is the bug), which was found by coworker today morning. Just would like to share knowledge, and probably this will save some debugging time for you...
    So, the problem that you can get wrong content of the cluster in some cases. The cluster used inside of while loop with shift register (we using this construction for functional globals), and after bundle operation you can get data, which are not expected:
    See also attached code for details (LabVIEW 8.6.1, WinXP Prof SP3).
    best regards,
    Andrey.
    PS
    Bug report already sent to NI.
    Message Edited by Andrey Dmitriev on 10-16-2008 12:30 PM
    Attachments:
    BugwithClusters.png ‏15 KB
    BugwithClusters.zip ‏10 KB

    Thanks Andrey for brining this to our attention!
    The "Show Buffer Allocations" reveals that LV is not processing the code in the right order.
    Under ideal conditions, all of the data should be manipulated using the buffer "A". But as this demo shows the data is being processed in the wrong order.
    The previously posted workaround get around this by forcing the array operation to happen first, but this resluts in two additional buffers "C" and "D" and then copy this back into "B".
    Using an "Always Copy" is another workaround that uses a seperate buffer "F" to hold the data being moved from the first cluster to the second inside "E".
    I think you won a shinny new CAR* Andrey!
    Ben
    CAR = Corrective Action Report
    Message Edited by Ben on 10-16-2008 08:05 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Cluster_Bug.PNG ‏57 KB

  • Why writes LabVIEW only every 2 seconds the measured Value to a Excel (In a while loop with 100 ms tact)?

    Hi everybody,
    I use the myDAQ to measure speed, ampere, and voltage of a battery driven motor. (For Current measurement, i use a Sensor which outputs a 0-10 V signal). I placed all DAQ-Assitants in a while loop with a [Wait until next ms multiple] clock and set a value of 100 ms. I thougt, Labview will now write into my text file 10 times a second all values. In fact, as you can see in the attached text file, Labview only writes in a unsteady interval of 1-2 seconds a value, which is too less.
    The question: Did I do anything wrong, how can you create VI that writes you lets say 10 values a second into text file? Or is simply the DigitalMultimeter input of the myDAQ not able to sample a rate of 10 Hz? I couldn´t find any information in the specification handbook about the sample rate of the DMM?
    If anyone can help me would be great! Thanx a lot, Markus
    Attachments:
    Measure Speed+Current+Voltage into Excel.vi ‏175 KB
    Test7.txt ‏1 KB

    File I/O is not very efficient. I recommend that you do you file logging in a parallel task. Have one task do your data acquision. This task would then pass the data to be logged to the logging task via a queue. That way your file operations do not impact your data acquision. Also, express VIs are not very efficient. You would be better off accessing that directly using the DAQ VIs. The express VIs contain lots of steps that do not need to be done every time you call it such as initializing the device.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Having problems opening a pdf file with reader 10/11 get error msg cannot open close reader and try again any ideas

    having problems opening a pdf file with reader 10/11 get error msg cannot open close reader and try again any ideas

    Hi George ,
    Is it happening with all the PDF' or any specific one?
    Could you please share the error message so that we can replicate at our end ?
    Try repairing reader  once and see if that fixes the issue.
    Launch Reader>Navigate to Help>Repair Adobe Reader Installation
    Regards
    Sukrit Dhingra

  • Having problems using ion tape express with itunes cannot find the song on hard drive

    Having problems using ION tape express with itunes.  The song is on hard drive as temp1 not the name of the song.  And I have problems playing it in itunes
    because it says it cannot locate the song'

    Then correct the name of the song or point iTunes to the new file.
    Issues with restoring should be directed to the manufacturer of the backup software/device... this is not an Apple or iTunes issue.

  • I am having problems syncing my iPad 2 with iTunes. Whenever I click "sync" or "apply," the sync begins. As soon as it gets to step 3 (in this particular case "determining apps to sync") it immediately stops syncing. What's the deal here?

    I am having problems syncing my iPad 2 with iTunes. Whenever I click "sync" or "apply," the sync begins. As soon as it gets to step 3 (in this particular case "determining apps to sync") it immediately stops syncing. What's the deal here?

    You haven't purchased apps with multiple Apple ID's have you? If you have, you can only sync with one Apple ID in the iTunes library at a time. Whichever ID you are signed into on the computer and the iPad would determine which apps would sync.
    Have all of your apps been transferred into iTunes for your iPad?
    iTunes Store: Transferring purchases from your ... - Support - Apple

  • TS4001 Anybody having problems accessing Adwords Exspress login with Safari ?

    Anybody having problems accessing Adwords Exspress login with Safari ?

    Hi jhankins,
    There was a problem yesterday for a brief half an hour to 1 hour, please let us know if you are still facing that issue.
    -Ankit

  • Code golf: stop two while loops with guaranteed iteration ratio

    Proposal
    In the vein of the Perl tradition, I'd like to see if there's any interest in solving short programming puzzles in LabVIEW. Anyone can post a problem and define the rules for solving it.
    Here's a beginning/intermediate question to whet your "palette".
    Description
    With one user-action, how would you stop two while loops such that the ratio of their iterations is the always the same? One concrete way to visualize this situation is in taking measurements: two instruments use the same timing source to take measurements, but second divides the clock down so that it is an integer factor slower than the first. For example, if the slower instrument is four times slower, then at the end of the VI, if the slower instrument takes 100 measurements, the faster instrument has taken 400.
    Rules
    You may only use vi.lib
    You cannot include any other subVIs
    Your solution must pass for loop1 interval as low as 25 ms
    Template (attached in LabVIEW 2009)
    If folks are interested in this, then let's figure out how to make future problems better. Please post your suggestions and critiques, but only if you also post a submission ;-)
    Solved!
    Go to Solution.
    Attachments:
    Multirate Loop Code Golf.vi ‏11 KB

    Norbert_B wrote:
    a) You work with an integer factor of speed. While this matches many application areas, there are still cases where the factor has to be floating point (e.g. 2.5). Additionally, the factor might "invert", so the master loop runs slower than the slave (factor 0.5 for instance).
    It sounds like you're about to post another code golf question. If you think the problem scope is too small, you're welcome to fashion one to your taste. Thanks for volunteering :-D
    Norbert_B wrote:
    b) This example does not take into account that the hardware has to be synchronized with more accuracy than the software supplies (PXI?). If hardware synchronization is required, there are two possible ways:
    - The factor can be included in the synchronization (using PLL for instance)
    - The factor has to be software implemented by data reduction for the task running at the lower pace.
    Hrm, maybe puzzles aren't really your thing after all. You are correct: I did not define every constraint that can lead to a provable best closed-form solution, but that does not prevent people from stating their assumptions and forming creative, well-reasoned, and still correct designs. I overlooked this reading of the description and neglected to add a statement that said solvers were free to add their own conditions. I will do so in the fugure :-)
    If we choose the first of your suggestions, the VI must still retrieve the data at different rates. You can dedicate a loop for each instrument to decouple any jitter and latency introduced by their connectivity or internal operation; this adds some margin of safety when there is thread and driver contention. You can also implement a single counting loop like altenbach and forego the multiloop complexity.
    Norbert_B wrote:
    c) You don't state anything about "what happens with the data". Is this time consuming? Does it introduce additional delay in loop iterations? Is it OK to have data loss?
    I don't know -- you decide, you disclose, and you solve :-)
    In my specific situation, the measurements are time consuming and do add delay (each data "sample" is 5-20 megabytes), none can be lost, and the data must be available for others to analyze later. In addition, the amount of data is saturating the hard disk throughput. If a particular write takes too long, the instrument driver may overwrite a yet unfetched sample, which is unacceptable. I did not add these details to the problem discripton becuase they don't impact the puzzle.
    I don't want to burden people with my situation and ask them to solve my problem: I want to encourage them to bring their intuition and experience to a discussion. This is the design process at its heart: understanding why and how constraints affect your decisions. If a person states the additional conditions they've assumed, readers can learn why, and more importantly, when a Notifier might be more desirable than an Occurance or a Queue more robust than a Data Value Reference.
    The best NI-published advice for stopping multiple while loops (https://www.google.com/search?q=labview+stop+multiple+while+loops) is laughable (and is the "solution" in my template).
    Would you care to re-approach and contribute to this puzzle? I suspect you have a lot to offer :-)

  • While loop with stop button within event structure locks up front panel.

    I am not sure if this is a bug with my program or a bug within LabVIEW.  If you believe that this is a bug with my program then I will post my program to be looked at.
    The problem I am having is there is a while loop within an event structure that fires when a particular value changes.  Once the "Activate" button is pressed the while loop within the event structure starts going with a polling frequency of 1hz (1000ms wired to the "wait till next ms multiple" vi).  There is a "Deactivate" button that is wired to the stop control of the while loop and an outter while loop that resets the event structure so that the activate button is being listened to again.
    Once inside the while loop, however, none of the button are responsive within the front panel.  The VI continues to run, and only 60% of my CPU is being consumed, but none of the button or scroll bars work.  The only way for me to terminate the program is with the "Abort" button next to the "Run" button.  If I remove the event structure so that the while loop in question runs as soon as the program starts, the front panel remains responsive.  I've inserted probes within the while loop and verified that it is not running prior to the "Activate" button being asserted, and it is running after the assertion of the "Activate" button with the expected polling frequency set by the "wait till next ms multiple" vi.
    Can anyone help?  Do I need to post my code?
    -Nic

    It is typically not a good idea to stall an event structure by placing loops inside event cases. What good is an event structure if it is not free to repond to events?
    Have a look at some alternative solutions, such as in the following link:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=224817#M224817
    LabVIEW Champion . Do more with less code and in less time .

  • Stop dependant while loops with 1 button

    Hi,
    I am developing a utility that allows a user to configure up to 2 devices (both use same driver with a different board number), click initialize, which then brings up a file dialog and displays arrays for the data to be collected and some error messages for each measurement.  The user then clicks the Start/Stop button to begin collecting and logging data.  Currently i have a Wait(ms) block to allow the user to set often the measurement should be made.  Currently the Start/Stop button allows collection to be started, paused, and started again.  My problem is trying to have a master stop button that should stop all loops immediately when it is pressed.
    I tried using a global variable for the stop button, but the measurement and logging while loop doesnt stop until after the wait(ms) block times out.  Can anyone give suggestions.  If i need to restructure the VI into different loops, I can do that.  I just want to understand the right way to program something like this.
    The VIs are attached.  I removed the device specific measurement VI so that anyone can open the vis and run them to see how it works.
    Attachments:
    2Devices_withoutMeasurementVI.vi ‏112 KB
    BuildOutput.vi ‏27 KB
    stopGlobal.vi ‏5 KB

    Ok.  I had a chance to take a look at your code and I think you don't quite understand the concept of "dataflow".  Let me see if I can help.
    First of all...when I refer to your upper structure, I am referring to the first while loop, sequence structure, and subsequent while loops.  When I refer to your lower structure, I am referring to the while loop containing the event structure.  Just so we get our terminology straight.
    I believe that you are under the illusion that your upper structure contains three parallel while loops.  It does not.  It contains three SERIAL while loops.  There is dataflow dependency between the while loops.  The sequence structure requires data that is not available until the first while loop has finished executing, so the sequence structure cannot start executing until the first while loop has terminated.
    The second while loop requires inputs from the first frame of the sequence structure (which, by the way, you don't need and should get rid of...the sequence structure, I mean), so it cannot start executing until the first frame of the sequence structure has terminated.  The third while loop requires inputs from the second while loop...so, again, the third while loop cannot run until the second while loop has finished executing.
    Now, for your stop button.  You have that global stopping all three loops.  So here's what is happening in your program:
    Your program starts.  The first while loop executes in parallel with the loop which contains the event structure.
    At some point you press the "stop" button.  Both the first while loop and the loop containing the event structure finish executing.
    The first frame of your sequence structure executes.
    The second frame of your sequence structure executes.  The second while loop reads the "stop" value from the global, so it executes once and then finishes.
    The third while loop starts executing.  Again, the loop reads the "stop" value from the global, so it executes once and then finishes.
    Then your program terminates.
    You need to restructure your program, because right now it doesn't make any sense at all.  Your block diagram would benefit from some serious tidying up as well, your wiring is a mess.  I suggest you look into a state machine architecture for this program.

  • Threads in while loop with two data acq loops

    Good day, I am using two while loops to perform data acquisition from two different pieces of hardware inside a "main" while loop - a total of three while loops. I want each of the data acq loops to run as fast as possible. With this model will each data acq loop run in a separate thread or will they be running in the same thread because they are both inside the "main" while loop.
    I'm not getting the performance I would like and I'm looking at ways to optimize the execution. 
    Thanks
    John 

    I would have a loop for each of you data acquisition tasks and at least one, possibly two additional loops that will write your data to file. Let the acquisition loops collect the data as quickly as possible and simply queue it off for further processing. When these loops are in parallel LabVIEW will run them on separate threads. In addition you could have a separate loop with an event structure that could handle you UI interaction. This loop could control the overall application with respect to starting and stopping the tasks, etc. You don't really need to contain all these loops in any other loop or structure. They can all reside on the block diagram next to each other. Ideally you will create subVIs for the data acquision and data processing tasks.
    Message Edited by Mark Yedinak on 10-06-2009 04:29 PM
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Having problem accessing MacMini over network with PC's Windows 7

    Hi all,
    I have a Mac Mini with 10.6.x
    Onec in a while, especially when restart Airport Extreme for upgrade or something else (both are connected with ethernet cable cat5e) ALL PC's on the network having problem accessing Mac Mini Server while All MACs are fine and can access all folders no problem. Usually takes about 3-4 min for PC to connect to server. Then  once it is connected (it loads all folder and files in that current window on the PC) i can go from folder to folder with no delays. However if i close the window with all folders then again i have to wait for around 3 min. to load everything all over again. AFP and SMB are ON. Today i made an experiment and turned SMB off and the problem still excist with the difference that after 3-4 min delay no folders were shown.
    It seems that the PCs have hard time establishing connection with the server which is weird that Macs don't have that problem. It must be something with the setting of Mac MIni. Other wise i have no problem accessing Internet so the routher is working fine. DHCP is ON on the AP Extreme.
    I came across as i was searching for this issue and it seems that authentication - Golden triangle or whatever is called - might be the issue in the whole mess. Do you guys think that this might be the case ?
    The only way i have found out to help is to restart the Router and Server and that usually fix the problem  .
    Could you please help me figure what is going on there?
    Here is the original thread: https://discussions.apple.com/thread/3867559?tstart=0 ( i think i posted in the wrong forum )

    The specified changeip -checkhostname command does not make changes to your configuration. 
    To research the command (and that's entirely your perogative), please use Google or Bing to search for previous discussions and details, or review the provided man page documentation for the command.  (Launch Terminal.app (folder Applications > Utilities) and issue the command man changeip.  You'll see something like this:
    $ man changeip
    changeip(8)               BSD System Manager's Manual              changeip(8)
    NAME
         changeip -- Change service configuration files with hard-coded IP addresses
    SYNOPSIS
         changeip [-v] [-d path] old-ip new-ip [old-hostname new-hostname]
         changeip -checkhostname
         changeip -h
    DESCRIPTION
         changeip is used to manually update configuration records when a server's IP address or hostname changed in a way that affected services were unable to properly process, for example when the server is behind a NAT device and the WAN identity changed.  ...
    Given your response and your concern, consider creating a backup of your disk.  Shut down, boot the installation DVD, and use Disk Utility (from the Utilities menu) in the second screen of the installation process to copy your disk contents to an external storage device.  (Time Machine isn't as good at getting a backup of a server as is a clean backup created while shut down.)  There are descriptions around that detail how to create this backup using Disk Utility.
    There is no DNS server implemented in the Airport Extreme.  The Airport Extreme forwards DNS requests to a DNS server elsewhere.  Few gateway devices contain DNS servers; that these devices request a DNS address tends to be confusing, too.  That address is solicited from the user for use in the DHCP server that many of the available gateway devices provide.
    There is no need for a DNS forwarder, particularly if your server is configured for your LAN.  (Adding a forwarder adds another hop into the whole translation process.  That configuration and that extra hop can be useful when the intermediate DNS server is providing specific, enhanced DNS-related functions, such as security monitoring and logging, or providing a "nanny filter" mechanism.)
    If you are running DNS services on your LAN, then your Airport Extreme DHCP server should be configured to pass out the IP address of your DNS server.
    It would appear that your local box has the default self-hosted DNS, and is not configured to serve LAN DNS (other than for itself).  That's good.  Accordingly, it'll likely be getting good DNS from itself, but will not be getting translations for other hosts on your network.  That's not so good.  When DNS responses are not available, you'll get DNS-level timeouts, and those are usually around 30 seconds each.
    Check your server logs for messages related to the failed connections, and check the Windows file service logs for any errors being generated by the file service.  The log information is most easily available from Console.app, which is a utility in Applications > Utilities folder, or from the Server Admin tool (Applications > Server folder) for DNS, and for the file server component.
    The above is probably going to read like a wall of unfamiliar jargon, so please ignore this and my previous response here, and I'll leave it to somebody else to assist you here.

  • Having problems downloading dreamweaver, comes up with error 50

    I'm a student and is having, problems downloading dreamweaver, it comes up with error 50, when ever finish downloading, could someone come back to me, I need to download urgently,  Kind Regards Miss Shaw.

    I'm a student and is having, problems downloading dreamweaver, it comes up with error 50, when ever finish downloading, could someone come back to me, I need to download urgently,  Kind Regards Miss Shaw
    ............................Please reply urgent.

Maybe you are looking for

  • Upgraded router VPN no longer working - LCP: timeout sending Config-Request

    I recently upgraded my small office router from a Linksys WRT54G to a Linksys WRT610N. I duplicated all of the port forwarding configs from my previous router, but everytime I try to connect to my server I get the following error: Could not negotiate

  • Truncating last three characters in Mainfram GDG dataset.

    Hi Folks, I had developed a scenario IDOC - > XI -> File and this file is generated on Mainframe system as a GDG dataset . I was able to generate the file but last three characters are getting truncated for each record in the file(dataset). From XI w

  • Is there any view where I can drag-and-drop an image to another app?

    I'm new to LR3.4.   I'm building books using Luminix PhotoFusion and used to be able to drag-and-drop images directly from PSE5 into Luminix.   With PSE8, that capability was lost and I had to bring up the file properties, go to the containing folder

  • Third party integration with Oracle Apps

    Hi friends, I have a dot net application and I would like to integrate that with oracle applications(specifically HR module). Can I do that? Does oracle apps provide any APIs to provide this third party integration with 3rd party software we have? ca

  • Image for the subscription page

    Help, I'm using squarespace and I've apartently done everything right, but still I can't get an image up on this page! Can anyone show me how? Nick