Three timer application with defined endpoints

I'm having trouble making a rather basic application. . .
I am trying to create an application that has three timers (let's say A, and B, and X) that are triggered by three different keys on the keyboard (the "a", "b", and "space bar" keys respectively). this will be used to record the amount of time, and the number of times, that a subject investigates two different objects (A and B). The user of the app will press either the A or B key on the keyboard when the subject starts investigating one object, and then "Space Bar" when the subject stops.
The app needs to output an array/file (or multiple) that has the durations of EACH seperate visit to object A and/or B, as well as the total number of visits to each.
Finally, the App must stop (or give an indication to the user) when EITHER the total (cumulative) amount of time spent at A + B is 30 seconds (i.e. the subject has spent 30 seconds investigating any object), OR the trial has lasted for 20 minutes (i.e. A + B + X ≥ 20).
I'm able to create individual parts of this app, but I'm having a hard time integrating them.
any help regarding tricks I should use to accomplish this would be much appreciated!Message Edited by tlambert03 on 10-06-2007 11:34 AM

I think I saw the behavior you are talking about.  I would look at a few possibilities.
1.  The shift registers in your innermost loops up top are uninitialized.  So they will maintain the state from the last time they were executed.
2.  The outer most loop of the upper portion has no shift registers at all.  So the inner shift registers will only get their state from the last iteration of the outer loop.  I think you may need to put your shift registers on your outer most loop.  The inner most loops are behaving like a functional global variable that is embedded in your application.  Since they only run once, I think you should probably eliminate the inner most loops and wire the shift registers to the outer most loop.
3.  The lower event structure has a little bit complicated logic with case structures embedded 3 levels deep.  That makes it harder to debug and determine if the right case is executing depending on the conditions.
4.  I don't believe local variables are as bad to use as some members of the forum, if they are used carefully.  But with the deeply embedded logic structures, there is a possibility of a race condition going on where the logic is executing on a stale value of the indicators.
I think there is room to simplify and clarify the structures in points 1, 2, and 3 above and that may help determine the reason for the inconsistent behavior which I would attribute to the uninitialized shift registers.

Similar Messages

  • Build real-time application with Compact RIO

    Good afternoon,
    I am currently trying to run a VI on compact RIO and would like to control it through remote front panel. I followed steps on this link http://digital.ni.com/public.nsf/allkb/AB6C6841486E84EA862576C8005A0C26 and successfully done everything with a simple example.
    However when I moved on and did the same thing to a more complicated VI (my purpose is to make this VI work), everything was fine until I reboot the compact RIO. After a few seconds connection lost between the host computer and cRIO, and I had to shut it down and delete the startup file (with extension .rtexe).
    I am not sure what happened since everthing works fine with simple VI but not the complicated one. It could because the second VI has many sub VIs as well as objective functions loaded in it, it could also because the VI takes too much memories of the CRIO and stop it from connecting to the host computer.
    If anyone have any ideas of how to make it work please let me know.
    Thanks very much
    Carl

    Hello zzzfreedom,
    There are a number of potential issues I can see with the VI you're trying to deploy as a startup executable.  How do you intend to interact with this VI? Are you running the front panel as a remote panel or connecting to the VI using debug tools? A few points:
    - Your VI will run immediately when the RIO boots unless you're using debugging tools to prevent this from happening, keep that in mind.  It looks like you've accounted for this and required an initialize or network trigger of some sort for some of your loops, but the AI loop will start quickly and appears that it may require user input. 
    - You have several "user prompt" style express VIs.  These will not work (or will not work as expected) on a standalone RT target.  There is usually no front panel to interact with!
    - Like dialogs, event structures watching for user interaction probably aren't going to do what you want.
    - You are writing quite a bit of data to the VI's front panel, and there is at least one chart indicator.  Again, how will the user interact with this VI?  It looks like you need a host VI that will run on a machine the user will interact with.
    - You're using quite a few local variables.  It looks like you've taken a lot of care to protect against race conditions, but this causes a lot of data copies and tends to be error prone.
    - I've not analyzed all cases, but it looks like you have a number of places where the execution of a timed loop may be blocked under certain conditions.  This will likely rail the CPU due to the much higher priority of the timed loops.
    - What will happen if you lose connection with the server in your TCP command loop?  it doesn't look like there is any way for the user to reconnect without restarting the RIO.
    If you do intend to run this as a remotely accessible VI on your RT target, another point to note is that when running from the development environment, the front panel of your VI executes on the host machine. Once you deploy it as a remote front panel or debuggable RTEXE, everything is hosted on the RIO, and this has the potential to bog things down quickly.
    Here are a few references I think you might find helpful:
    LabVIEW Help: Real-Time Operating Systems - see considerations for Express VIs and Front Panel interaction
    http://zone.ni.com/reference/en-XX/help/370622L-01/lvrtconcepts/rt_osnotes/
    LabVIEW Help: Real-Time Module on VxWorks Targets - see unsupported features
    http://zone.ni.com/reference/en-XX/help/370622L-01/lvrtconcepts/rt_vxworks/
    NI LabVIEW for CompactRIO Developer's Guide -lots of good general information on architecting RT applications, network communication and hosts, etc. It looks like you're using the RIO Scan Engine, so the FPGA portion might not be relevant at this time.
    http://www.ni.com/compactriodevguide/
    Best Regards,
    Tom L.

  • HT1768 Itunes will not open and play.  It says "Itunes has stopped working".  I have deleted and reinstalled Itunes (three times), same with Quicktime.  i have updated the driver, but it still won´t open.  Any other ideas?

    My laptop is Windows Vista.

    Having the same problem - am running Win 7 Pro 32 bit. Discovered that when you close iTunes task manager shows that iTunes.exe is still running and will not close unless you reboot. I have also found that after starting Win 7 that if I launch iTunes by inserting a CD, the CD plays and displays all tracks correctly. However, if I eject the CD and insert a different one neither Win 7 or iTunes recognises the CD. These problems seem to have started with the release of 10.5.2 - prior to that no problems at all. Have tried reinstalling and it does not make any difference.

  • After uploading our phones with the latest update, we have noticed that the battery life has deminished considerably.  I now have to charge my phone overnight and two or three times a day. Prior to the update, my battery life lasted me at least a full day

    After uploading our phones with the latest update, we have noticed that the battery life has deminished considerably.  I now have to charge my phone overnight and two or three times a day. Prior to the update, my battery life lasted me at least a full day.  We have several phones in our office and the ones that have updated (4) now have issue holding a charge/battery life. I really liked this phone and can not believe that you are now going to charge us $79 a battery to fix what is most definately a problem with your latest update.  I know other people outside of our company that are having the same problem. Not to mention when I called AT&T it was confirmed to me that they are hearing the same issue and then some from other customers as well.  Your own people, once I talked to them earlier today, told me they are showing a history of issues that are showing up after the update was put in place. Of course she tried to say, "Maybe the age of the battery and the update both contributed".  Whatever. 
    I want you all to know how disappointed I am in your company for the handling of this issue.  I always thought "Apple" was the line I didn't have to worry about having any types of issue. And that you all would stand behined your product 100%. Now I am not so sure.   
    I would love to hear back from your company on how you perceive the issue with all of these phones that prior to the update didn't have any issues and how after the update THEY ARE NOW having issues.  I do not believe this was an issue due to the age of a battery and that was pretty lame to say so.  It was fine and now its not.
    Please feel free to contact me and help me figure out a way to pay for all of the batteries that will be needed for our company to contiue doing business as needed.
    Thank you.
    Web Address (URL):
    5106 McNarney

    Sorry this is a user to user technical forum.  There is NO APPLE here as stated in the term of use when you signed up for this forum.
    here are some battery tips
    http://osxdaily.com/2013/09/19/ios-7-battery-life-fix/
    http://www.apple.com/batteries/iphone.html

  • CRIO and ni 9234 modules not working or communicating through fpga with accelerometers, fpga connected to real time application which is also connected to shared variables linked to modbus slave

    Hi,
    I have a compact rio which has a 4 way chassis attached to that chassis is three ni9234 modules they are linked using fpga to a real time application then using shared variables in the low speed loop that are linked to a modbus slave to communicate with dcs, the ni 9234's have accelerometers connected to them with iepe ac coupled option on the c modules, my problem is the real time application seems to be running okay even when power loss occurs it restarts with no problem and the fpga writes to the portable hard drive bin files fine but without a accelerometer connected I get low noise readings as soon as I connect a accelerometer to any one of the 10 outputs it just goes to a fixed number (0.03125) as soon as disconnect it again it reverts back to reading noise, I have run a scan on the modules and only get a spike when I connect or disconnect the accelerometer, I have tested the voltage at the pins of the module and I get 22 volts dc which makes it more likely that the hardware is not the problem but a software is maybe causing this to hang-up, I attach project and files for your perusal. I also carried out a new project which in scan mode directly linked the module input to shared variable and the same scenerio again. Help would be much appretiated. 
    Many thanks
    Jason
    Solved!
    Go to Solution.
    Attachments:
    logger 2plusmodbus2.zip ‏679 KB

    Whren using waveform acquisition with the 9234s we recommend the following FPGA and RT template.
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/209114
    it can be extended as a data logger with:
    http://zone.ni.com/devzone/cda/epd/p/id/6388
    or using shared variables combined with scan engine
    http://zone.ni.com/devzone/cda/tut/p/id/9851
    The FPGA in all of these, as well as the RT framework have been used successfully by 1000s of users.  I would recommend giving these a try. 
    Preston Johnson
    Principal Sales Engineer
    Condition Monitoring Systems
    Vibration Analyst III - www.vibinst.org, www.mobiusinstitute.com
    National Instruments
    [email protected]
    www.ni.com/mcm
    www.ni.com/soundandvibration
    www.ni.com/biganalogdata
    512-683-5444

  • TS1367 My MacBook air has a blinking file folder icon on a blank screen with a ? In the center of the icon. I've tried turning on and off three times but it hasn't helped.  Any suggestions?

    My MacBook Air has a blinking file folder icon on a blank screen with a ? In the middle of the icon. I've tried turning my computer off and on three times with no luck.  Any recommendations on how to fix the problem? 

    Reinstall OS X without erasing the drive
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install Mac OS X 10.6.8 Update Combo v1.1.

  • Compatibility of Pattern I/O with a PXI-6533 card with real time application

    Hi,
    I use a PXI-6533 card on a chassis with a PXI-8145 RT controller. I want to acquire 32 bits of data with this card at 1,25 kHz. These data are generated by an external FPGA card together with a clock signal. Referring to the 6533 documentation, a simple way to synchronize the acquisition is to use pattern I/O, entering the clock signal on the REQ pin. I tried the LabVIEW example Cont Pattern Input.vi. It seems to go well, but it does not work when I change this .vi priority to Time-critical or any higher priority than normal. Is there an incompatibility between this type of acquisition and real-time ?

    Hi,
    Sorry for this late answer, I effectively added a �wait until next ms function� in the time-critical loop and it seems to work. In fact, I don�t see exactly how, but it works with 1ms up to 50 ms.
    Nevertheless, the next step is to add the content of this example in a more complex system with a communication loop to transfer the acquired data to the Host PC. I already have such an architecture, with a �time-critical priority� .VI to read the data at 1.25 kHz and a RTFIFO to transfer them to a second �normal priority� .VI loaded on the PXI, that ensures a TCP communication with the HOST PC. This architecture works correctly on another application with an internal clock, BUT doesn�t with this example, even with your solution.
    In
    fact, it seems to work when I put the two .VIs loaded on the PXI in �normal� priority, but with a tremendous jitter (the frequency varies from 1 to 2 kHz) and a scan backlog that gets full very fast. Then, the PXI crashes as soon as I change any priority.
    You�ll find attached these three .VIs and I hope this could help to find a solution.
    Cordially
    PS: Since we started this thread, I�m in relation with NI Support France on that subject. Nevertheless, we haven�t found any solution yet and any new idea is welcome !
    Attachments:
    HOST_Comm.vi ‏532 KB
    RT_Comm.vi ‏265 KB
    TCLoop.vi ‏256 KB

  • TS1702 I am having a major problem with a Z2 app. I have written to the three times and received no response. Is there somewhere to report this and at least get my money back?

    When Z2 did their first 5. Update, a message popped up saying you had to do the update. After doing so, another pop-up said to remove and reload the game. In doing so, all my progress/ purchases disappeared. I only updated on my iPad, not my iPhone, so the iPhone app is till on the "you have to install the update to play" status. I've written to Z2 three times with no response. I would at least expect a refund of the $ I have spent on the game.

    You bought an app but it did not work properly on your device. You can easily report problems with your iTunes Store purchases via the iTunes Store. Here is how:
    Launch iTunes > Choose Store > Sign in.
    Store > View My Account > Purchase History then Click the Report a Problem button.
    Fill out the form explaining the problem you are having.
    Submit the problem report and wait for a response from Apple, they usually respond within 24 hours.
    Notes:
    When Apple emails your invoice, there will be a link on the invoice. You may also click the “Report Problem” link next to the app that you are having issues with to report your problems.
    Problems with in-app purchases or free apps, report them here:http://www.apple.com/support/itunes/ww/
    Before reporting your issue, make sure that you followed these troubleshooting steps explained here.
    <Link Edited by Host>

  • Just bought a new iPhone and am having trouble with iTunes and App Store. I can log in to Cloud, iTunes, and app store but once I try to download, it says "Youe apple id has been disabled". I've reset my password three times and have no issue on my Pad.

    Just bought a new iPhone and am having trouble with iTunes and App Store. I can log in to Cloud, iTunes, and app store but once I try to download, it says "Youe apple id has been disabled". I've reset my password three times and have no issue on my Pad.

    Hi FuzzyDunlopIsMe,
    Welcome to the Support Communities!
    It's possible that resetting your password multiple times has triggered this security.  Click on the link below for assistance with your Apple ID Account:
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Here is some additional information regarding your Apple ID:
    Apple ID: 'This Apple ID has been disabled for security reasons' alert appears
    http://support.apple.com/kb/ts2446
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Click on My Apple ID to access and edit your account.
    Cheers,
    - Judy

  • How to configure oracle 6i report server run time component with application server

    we got oracle 6i report server for developing the web based reports for our undergoing product. we r succesed in developing the web based reports using oracle 6i report server.But we r facing problems while deploying the product with oracle reports at clients place,why because the client does not have the oracle 6i report server. To solve this problem we have to configure the oracle 6i report server run time component with application server at client side , but we are unable to configure this component(that is CGI handler).

    You can run multiple instances of Reports Server in 6i.
    In tnsnames.ora, for each server, have a different name and each listening to different port.
    For example,
    server1.world = (ADDRESS = (PROTOCOL = TCP)(Host = myhost.mydomain.com)(Port = 1949))
    server2.world = (ADDRESS = (PROTOCOL = TCP)(Host = myhost.mydomain.com)(Port = 1950))
    Also, if you want to know about Reports Server Clustering, you may refer to "Publishing Reports" document on OTN:
    http://otn.oracle.com/docs/products/reports/pdf/A73173_01.pdf

  • I have a 1st generation Time Capsule with current firmware. Can I define the time periods when my children's devices have access to the wi-fi network?

    I have a 1st generation Time Capsule with current firmware. Can I define the time periods when my children's devices have access to the wi-fi network?

    Can I define the time periods when my children's devices have access to the wi-fi network?
    Yes, using the Timed Access feature in AirPort Utility, you can setup specific rules for each wireless device which define the exact timeframe each day that the device will be allowed to connect to the wireless network.
    Example....junior's iPhone can connect.....
    Everyday......Between.....9 AM and 10:00 PM
    or
    Weekdays.......Between......4 PM and 9 PM
    and Weekends.....Between......9 AM and 11 PM
    At the same time, your own personal devices will have Unlimited Access at all times.

  • I have a 6 week old 4s running 5.1.1 Just started recieving "failed sim" message the other day. This leaves me with no cell service . Service comes back after shutting down and restarting. at least until message reaapears. Has happened three times in two

    I have a 6 week old 4s running 5.1.1. Started recieving "failed sim" message yesterday. this leaves me with no cell service. Shutting down and turning back own seems to alleviate problem temporarily. It has happened three times now. Help.

    Sounds like you have a battry issue but don't want to believe it.
    If a car was running fine on one tank of gas, then you filled it up with another tank of gas and it began to run funny, one might suspect that tank of gas. But let's just say coincidence blew a valve-- would you think the new tank of gas was the culprit?
    BUT WAIT!! It just might have been! The gas could have been of higher octane and put more more strain on the valves; you know, like going from 87 octane (OS6) to 93 octane (OS7) and showing you the engine was on the edge of compromise.
    Sometimes you have to go with common sense. If everything else is ruled out, it must be the battery. And if it runs fine one moment in OS6 but immediately ***** in OS7, I'd believe my battery was suspect-- though comfy-- in OS6 but the OS7 showed its true power.
    Moreover, if you had the answer-- or didn't want to believe someone's more competent advice-- why did you even call?  You've already shown that you don't know much when you asked if you could go backwards after setting up the new OS as a new phone.
    Additonally, if you're such the know-it-all, but yourself the $29 battery and put it in yourself. It's a piece of cake.
    <Edited By Host>

  • MAC LED lights three times with clicking noice after Software Update

    Hi all!!! I am a new Mac user.  As recommended i have been regularly updating my OS (software updates).  After updating, as mentioned, the MAC restarts.  But during restart it tries to restart three times (the LED light on the bottom right corner lights u

    I'm a bit confused here so I hope to clear things up in your post.
    You're Device is listed as Z10 (unless you've updated within the last 2wks of this post).
    Mac Desktop?
    - did you mean BlackBerry Desktop Manager for Mac?
    - or did you mean Z10 BB10 OS updated to 10.1? (which provider)
    If on Z10 you mean you updated to 10.1 I hope you're not using a leaked BB10.1 release (that's going to cause you nothing but issues down the road if you're not sure what you're doing, trust me i thought I did myself lol).
    Keyboard:
    Have you checked in Settings > Keyboard for any entries you custom added or shortcuts that auto correct? If you're not sure you can clear them ALL out, close your apps on your Z10 and retry say an email with a paragraph and see if that fixes it?

  • One of my imported MOV files turns "black" after editing with it for a time and I can't retrieve the images. This has happened three times, only this file. The placeholder is still there. Files are fine on hard drive. What gives? how to stop this?

    One of my imported MOV files turns "black" after editing with it for a time and I can't retrieve the images. This has happened three times, only this file. The placeholder is still there. Files are fine on hard drive. What gives? how to stop this? is in final cut pro 10.1.4

  • I am having an installation failure issue with my itunes 11 software.  File is corrupted and i don't know what to do.  I've un-install and re-installed the software three times and continue to get the same error message.  It states that "This copy of ITun

    I am having an installation failure issue with my itunes 11 software.  File is corrupted and i don't know what to do.  I've un-install and re-installed the software three times and continue to get the same error message.  It states that "This copy of ITunes is corrupted or is not installed correctly.  Please reinstall Itunes"
    iMac, iOS 6

    HI,
    If your old version of iTunes is still working - then I sugest you stick with that.
    iTunes 11 is a lousy update - It will not retain your playlists, you can't find and delete duplicates... and a whole arry of oyher issues. (have a look around this forum to see how many issues IT11 gives people)
    Just a friendly advise and warning :-)

Maybe you are looking for

  • Problem related to PO?

    Hi All, I have creating a PO of Subcontracting and in that I am exploading BOM which is containing two materials, but on exploading BOM it is picking the material defined on line item 1 by default, But I want That it will pic material on line item 2.

  • Import video problem , crash

    hello everyone , my name is Etienne i have a problem with flash professional CC (last version) , i want to import a video in a new file and play it , the matter is that anytime i try to do an import (videos) the program freezes and crash .. anytime ,

  • Stream entire iPhoto library to Apple TV?

    I realize this might be more appropriate for the Apple TV discussion boards and so I posted the question there too, per below, but thought I would try here too in case anyone here knows the answer: >>> How can I stream / slideshow (e.g., "screen save

  • Why the LMS topology Service takes long time to reflect the device availability status?

    In the topology services map, the color status of the router takes long time to move from red to green and vice versa. i have already configured the time interval in the fault monitor poller setting to 6minutes but the only thing reflected the little

  • Can't import photos now

    My son received a new camera for Christmas. After successfully importing photos from his camera (an HP), I can no longer import photos from my camera (Cannon Powershot A85) that previously worked fine. When I click the import button it does not recog