Best method/practice to run two loops (read + write) simultaneously in sync

Hello,
I thought I had a program working that could write and read simultaeously with reasonable accuracy, but have discovered it may not be as reliable as I thought (it sometimes gets out of sync/jumps steps).
Is there a good guide, tutorial or recommended method to do this reliably, in sync and efficiently?
Should I use notifiers? and/or timed loops?
I have a write loop, which sends steps to some type of equipment (stepper motor or magnet etc) at no more than about 100 Hz.
I have a read loop, which reads data from a detector (eg photodiode, the signal being dependent on the write step), at no more than about 1000 Hz (the read loop runs faster than the write loop)
I then pass information from one loop to the other (one loop writes to a group, the other reads from it).
I then save data to a file by saving the contents of the graph.
Thanks
Solved!
Go to Solution.

Jeff_Tech wrote:
(1) .... in sync....
(2) ... (the read loop runs faster than the write loop) ...
Aren't these two statements a contradiction?
There is significant information that you have left out, for example is it sufficient for the two to be in sync or is it also necessary that they occur at a very regular rate.
In what way do the two depend on each other? Is this a control application where the output depends on the input in some way or is it simply a excitation/response pair.
Are you doing software timed single point acquisition?
Does it need to run for extended periods of time or it it just a finite sweep each time?
In any case, the right thing do probably do is run both hardware timed from the same clock. Setup the output array for the AO and arm the AI, then start both running from the same clock (e.g. you could tie the AI conversion to the AO clock). Read the buffered AI data at leasure in a loop that does not need any special timing.
Can you show us some code so we get a better feeling what you are doing?
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • I am moving from PC to Mac.  My PC has two internal drives and I have a 3Tb external.  What is best way to move the data from the internal drives to Mac and the best way to make the external drive read write without losing data

    I am moving from PC to Mac.  My PC has two internal drives and I have a 3Tb external.  What is best way to move the data from the internal drives to Mac and the best way to make the external drive read write without losing data

    Paragon even has non-destriuctive conversion utility if you do want to change drive.
    Hard to imagine using 3TB that isn't NTFS. Mac uses GPT for default partition type as well as HFS+
    www.paragon-software.com
    Some general Apple Help www.apple.com/support/
    Also,
    Mac OS X Help
    http://www.apple.com/support/macbasics/
    Isolating Issues in Mac OS
    http://support.apple.com/kb/TS1388
    https://www.apple.com/support/osx/
    https://www.apple.com/support/quickassist/
    http://www.apple.com/support/mac101/help/
    http://www.apple.com/support/mac101/tour/
    Get Help with your Product
    http://docs.info.apple.com/article.html?artnum=304725
    Apple Mac App Store
    https://discussions.apple.com/community/mac_app_store/using_mac_apple_store
    How to Buy Mac OS X Mountain Lion/Lion
    http://www.apple.com/osx/how-to-upgrade/
    TimeMachine 101
    https://support.apple.com/kb/HT1427
    http://www.apple.com/support/timemachine
    Mac OS X Community
    https://discussions.apple.com/community/mac_os

  • I currently have one input but need to run two loops. I cannot get the two while loops to run so that they both pick up the same data, they are both picking up alternate samples. How can I get them to both pick up all of the values?

    The system I am trying to create calculates a number of values based on an input. I need to make the calculations and display the values for an entire production run and for each hour. The only way I know to do this is to create two while loops, one looking at all the values that are received and one looking only at the values for hour long periods.
    Any help would be great.
    Thanks
    RossH

    Why do you think that you have to have two loops to accomplish this task? Why not use one loop and accumulate the same data into two data sets based on the two sets of criteria?

  • How to run two DAQmx Read (Analog) at the same time?

    I would like to measure a voltage and a current,
    but the two cannot be conbined in one task.
    Therefore, I had to use two DAQmx Read in the same program. But it did not run.

    Multiple channel types can be combined in a single DAQmx Read. One way is to use multiple DAQ Create Channel fucntions. Look at the posting here and the second example at the link in the answer.

  • How to run two DAQmx Read (Counter in + Digital in) simultaneously?

    Hello to all, i have following issue:
    I want to acquire a digital (UART like) bus signal. For this purpose i use a DAQmx Card (PXI 6070e). I need precise time information about time lenght of 0 and 1, so i use a counter. The counter is adjust to CI Semi Period(continuous samples) -> on the edge change i'll get a new measured time value. It works perfectly, but i newer know what kind of state (0 or 1) actually belongs to current value. Of course they changing with each edge, but i need to know that exactly. So i should take a digital input which watching the current state. Unfortunately i can not synchronise two DAQmx-reads.
    Finaly i should get two values:
    time value(counter) and his state(digital in
    ) to work with them. How can i do this?
    I use LabView 7.0

    [SRQ 211371]
    This is not a trivial taks but here is one way to do what you explained with a PXI-6070E and some external circuitry:
    1. Use buffered semi period measurement to measure the width of your pulses.(Meas Buffered Semi-Period-Continuous.vi)
    2. Use a buffered continuous analog data acquisition with external scanclock (e. g. Cont Acq&Graph Voltage-Ext Clk.vi). Maybe you should use a triggered example to start the acquisition at a defined time.
    Now you could connect your signal to the ScanClock input (PFI7) of the 6070E but then you only would acquire only a sample at either the rising or the falling edge. As you need a sample at both edges you need some external circuitry that generates a short positive TTL pulse at each edge (rising and fa
    lling).
    Sorry that I can't provide a solution for this circuitry but I'm pretty sure something like this should be available as a low cost IC.
    You may want to allow your signal some settling time after the scanclock pulse has occurred. In this case simply acquire data on two AI channels. The first channel is only a dummy channel. Connect your signal to the second channel. The delay can be adjusted with the interchannel delay.
    If anybody knows a good solution for the external circuitry or if anybody has a better approach please post it here.
    Best regards,
    Jochen Klier
    NI-Germany

  • Advice on best methods / practices

    I'm about to restructure a prototype program into a desktop application, and I'd like to TRY to do it the best way possible. So, if you have any input based on your experiences I would appreciate it.
    The program is a graphical editor with a look and feel similar to photoshop. The main difference, however, is that there are two drawing panes. The first is used to select regions of an image and the second allows the user to manipulate those regions to create an altered version of the original image. For example, the user can select a rectangular region on the original image that can then be stretched and moved on the edited image.
    Each image lies in its own JInternalFrame on the JDesktopPane, but all the information for each image (and its edits, children JLabels, etc) should be accessible to the other image. What do you suggest as the best method for sharing information between image panes?

    Here is the benchmark for the creating collectors in IPM and reports.
    S. NO
    Table/Granularity Selection
    LMS Version
    No of Records in Table
    1
    Minute
    LMS 4.0
    72,000
    2
    Minute
    LMS 3.2
    96,000
    3
    Hourly
    LMS 4.0
    72,000
    4
    Hourly
    LMS 3.2
    96,000
    5
    Weekly
    LMS 4.0
    72,000
    6
    Weekly
    LMS 3.2
    96,000
    7
    Monthly
    LMS 4.0
    72,000
    8
    Monthly
    LMS 3.2
    96,000
    With IPM, you need one source device that can be used for multiple destinations in the collectors.
    http://www.cisco.com/en/US/docs/net_mgmt/ciscoworks_lan_management_solution/4.0/user/guide/monitoring_troubleshooting/mnt-collectors.html#wp1391898

  • Is it possible to run two GPS tracking apps simultaneously?

    I have a couple of apps that track your position via GPS, like MotionX GPS. They run in the background under iOS 4.2.1. Is it possible to run two of these at the same time? Will they both get GPS updates from the OS as quick as they would if only one were running?

    Before someone says "try it and see if it works," I plan to. I just haven't had a chance yet.

  • Running two different VI codes simultaneously

    Hello guys
    I am conducting a study in which I am required to run multiple codes for different harwares simultaneously, I have the vi codes for them, I am looking for suggestions on how I can integrate them in such a way that all of them run simultaneously, can I use "Sync" option provided in the pallate. 
    Please suggest
    Thanks in advance 
    Best
    Deependra
    P.S-  All the hardwares are independent and I am not using any chassis to sync them externally, I only need to integrate the vi codes

    Are you just reading from the EMG and force plate?
    I'm not hearing anything that says you need absolute synchronization.  So I would just run them as two separate subVIs.  You will want to get away from the example and use the actual driver VIs.  If they both are just reading, them put then in the same loop.  Read the EMG then read the force plate.  Do whatever with the data and loop through it again.  This usually works well as a Queued Message Handler.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Two loops in a table in main window

    Hi all,
    I have a main window and under it I have created a table with header main window and footer for 6 fields with 6 cells and 6 texts, each text under each cell.
    I want to run a loop for first 3 fields and another loop for the other fields.
    I mean the table should be partitioned as 3 and 3 fields.
    The first 3 fields say Item, description and Debit in one part and the other part  date, credit and particulars
    I want to run two loops to run calculate the debits and credits?
    Now my point is how to partition the table into two?
    Do I have to create two tables and take 3 in one and the other 3 in the second table?
    If I create 2tables then how to calculate the second part fields data ?
    I mean how to get the data or show the data in the right side of the table?
    Please answer
    Thx

    Hi
    Create two loops in the main window and in first loop display only three fields and in second loop display remaining three fields but border of the cells need to change to white color so that it will not display the black color lines in the main window.
    One variable to calculate sum of first loop and display sum at the bottom the main window and another variable to calculate sum of second loop and display sum at the bottom..
    Regards
    Srilaxmi
    Regards
    Srilaxmi

  • Sync Calendar / Contacts without installing software - best method?

    I'm still scratching for an answer to this problem.
    My calendar and contacts are on my work PC (Outlook). I can't install software on that computer.
    I have a PC at home, with iTunes installed.
    What is the best method of keeping my iPhone and my work pc in Sync with each other?

    Allan Sampson wrote:
    You need iTunes for the sync process with the iPhone so you need to transfer your data from your work PC to your home or personal PC and sync your iPhone with this PC only.
    That's the conclusion I came to a couple of months ago. I was hoping things might have moved on. Never mind, perhaps something will develop out of the SDK when it is launched in Feb.
    Thanks anyway.

  • How to run two versions of dreamweaver at the same time

    How to run two versions of any dreamweaver at the same time?
    There must be a way to do this.

    east99 wrote:
    > How to run two versions of any dreamweaver at the same
    time?
    > There must be a way to do this.
    Yes, there is: on two separate computers.
    You cannot run two versions of Dreamweaver simultaneously on
    the same
    computer. They can coexist side by side, but the operating
    system will
    not let you run them together.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Does anybody know how to run two independent instances of Calendar simultaneously?

    I've enabled the Debug mode, and have 2 windows open at the same time but can't get them to operate independently. Anybody done this?
    The situation is that I work for a music school that uses iCal to keep track of music lessons for multiple tutors in real time, which sync to relevant tutor's iphones. We've just opened a second premises and would like to use the same system, but be able to monitor everything from either school.
    Debug mode will let me run two instances of Calendar simultaneously, but removing tutors' calendars from one of the Calendar windows removes them from the other.
    Basically I need one Calendar window open for each school, and for them to be independent from each other.
    Any takers?

    How about creating a new "Calendar" with in the same Calendar app?
    Calendar App---> File---> New Calendar
    Name each Calendar for each business location. Example if the original location is on Main St, name that Calendar Main St and the second on Broadway, name that calendar Broadway.
    The other solution could be the same as above, but File---> New Calendar subscription. But I have no idea how that works though.
    KOT

  • Read/Write Jar files?

    This is really a newbie question, but since there's a forum specifically for jar questions I figured it was better to start here and move it to the newbie section if y'all deem it appropriate.
    I have written a desktop application using Java 1.4.1 class libraries and intend the application to run on multiple platforms including Mac OS X, Windows XP and Linux. The application works standalone (not yet jarred) on the machine it was developed on, but now it's time to begin figuring out the distribution method.
    Right now, the application reads several files from a flat text-file database, allows the user to peruse and display the information in a variety of ways, and gives the user a method to add to the flat-file database as needed. The file is about a megabyte and is excerpted into memory at initialization, then not referred to again unless the user writes additional data. When the user generates new data, write traffic to the file is fairly light, maybe 2-3kbytes per session.
    I searched the forums for the best way to handle read/write data files for distribution and so far I haven't found anything that seems relevant, but surely the question must have been asked and answered before - maybe I'm using the wrong keywords?
    Anyway, I have three basic questions:
    1) Can I both read and write a file that's enclosed in a jar file? Or are files read-only once "jarred"?
    2) Assuming I can both read and write a file within my jar file, is reading and rewriting within the jar so inefficient as to make that a non-preferred approach?
    3) How do other folks who have a local read/write datafile in a desktop application deal with distribution? Keep the read/write datafile within the jar? Make a copy of it outside the first time the application is run and always read/write the copy outside the jar? Or some other strategy?
    Thanks for any suggestions you can give a newbie at the Java game.
    Jon

    Thanks, that was pretty much what I suspected.
    I have several data files and configuration files for this project, so I was trying to make the distribution as clean as possible. At least some of the config information can be hidden in Preferences, but I was struggling with the data files. I'll include the data files in my jar, then unpack them to the user's directory when launched the first time and work with them thereafter in the user's directory.
    Enjoy the Dukes!
    Jon

  • Help! - Datasocket read/write problem

    Here are two basic read/write datasocket vis... that do not work properly.
    Start the DS engine, run both vis, modify the string array in read.vi or resize the write.vi window and you will see that the indicator display in write.vi is wrong.
    Can anybody tell me why?
    Thanks a lot for your help.
    MichelC
    Attachments:
    Datasocket.zip ‏19 KB

    From what I see, the elements being written and read are not synched to the same iteration number, and thus are not array-indexed the same, therefore, you'll have a difference in the array index # for what was written and what was read. In other words, the DSS-read is not always at the same iteration # (index #) as the DSS-write when the write and read occur.
    However, with that thought, you could remove all looping and simply DSS-write the whole array to your DSS-read. Then you keep the indexing equal on both ends. When you send and receive a whole array, no looping is needed, so the process also is quicker.
    Well, that's how I see it, good luck with it, Doug

  • TS1474 What is the best way to run two iphones on the one computer?

    I have recenty upgraded to an iphone 5 and my husband has taken over my 4S. However when trying to sync on itunes found even with different log ins for itunes some of my mail and photos ended up on his phone.
    Have duplicated ITunes as a copy for one phone and still some data crosses over. What is the best method?
    Laptop does not ahve library of our music installed to use as option.
    Would apprecaite advice.

    More than likely, your issue is sharing of iCloud information.  You can run as many phones, iPads, iPods, etc as you want on one PC without issue.
    Make sure you under Settings > iCloud that you have different IDs.  You should also use separate Apple IDs, which can still sync to the same PC.

Maybe you are looking for

  • Java 2 Platform Standard Edition wont install

    Error number: 0x80070725 Description: Incompatible version of the RPC stub. Setup will now terminate whats a RPC stub how do i fix this problem?

  • Only back and forwad arrows show in IE 11 and in IE 9.

    This is an issue we have starting having in the last week or so.  We are running Windows 7 Ultimate and Windows 7 Professional.  We run mostly IE 9 because of software compatibility issues.  When IE is pulled up, this is all that shows: It is frozen

  • Outlook 2010 won't sync with iCloud on the web

    Outlook 2010 Calendar syncs with the iCloud Calendar in Outlook. Both are visible in Outlook, both are ticked. Calendar Sync is set up in iCloud Control Panel 2 and on settings on my iPhone & iPad. However, appointments don't show in iPhone, iPad or

  • Why do the site's propietary icons disappear after dragging to the taskbar?

    I've found a site I absolutely need in my taskbar, when I drag the icon down the link is there but the icon has been lost somewhere. The icons are usually proprietary so I can't even edit the quicklaunch to find the image. Why does this happen, and h

  • ESS  I View Problems

    Hi We installed ESS and MSS Business Packages, i am not sure problem is with workset's or  iviews . Bcoz when i click on some worksets they are working fine but other worksets career job and employ time are not working, they are system error. So anyo