Problem in synchronizing two executions

One execution (not in loop structure) is to run vi-A to move a motor by certain distance. Another execution is a loop struction, and in each loop execution vi-B inside it acquires current motor position.
I hope to synchronize this two executions so that when the motor just begin to move, the vi-B simultaneously begin to acquire position. However, I always failed to synchronize them. In the position ~ time plot, there are always a short beginning period where position is zero.
Any suggestion on solving this problem? Thanks a lot.
Dejun  

My first thought is why make it into two separate threads?  It may be easier to have it move then read position in a loop.  This would simplify the problem and make things easier.
If you need to use threads I have two thoughts.  Use LabVIEW 8.0 Shared Variable to share information between the two threads.  You can also FIFO commands using the Shared Variable.  Second thought is that you may be overrunning one of the threads.  You can probably read faster that you can move so put loop count indicators on the front panel to see how many iterating each thread has run.  You may be surprised by what you see.
Let me know if this is any help.  If not, fire me back a specific question and I will try to help,
Matt
Matthew Fitzsimons
Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

Similar Messages

  • Synchronizing Two Custom Z Tables Using Abap Program

    Hi,
        My requirement is Synchronizing two custom z tables using abap program me.
    I have vendors in two tables, i have to select the common vendors from first which are existing in second  table also.
    In first table each vendor can have more than one supplier types in one field only. In second table these supplier types are divided into
    different fields.
         My requirement is I have to check supplier types in first table and i have to pass X to corresponding supplier types in second table vendor.
    I have to pass X value for each depending in Second table depending upon supplier type in first table.
    . How to do it can any one suggest with code.
    Thanks in Advance,
    Vivek
    <subject edited by moderator>
    Message was edited by: Manish Kumar

    Hi,
    Imho, you need to get (meaning, extract into separate fields) the different supplier types from Table1 first. Your key for Table1 is the vendor no, which is also the key in Table2 (or the key for Table2 is Vendor no & Type).
    For better performance, better select multiple/all required entries from Table1 instead of doing a select endselect.
    Depending on the format of the vendortypes in Table1, put them in a new itab (for our purpose named Table1New where vendor no & type are the only 2 fields. For example, if the type length is fixed to 2 chars, or divided by space,... use your coding accordingly.
    Next step is to select all vendor no's in Table2 which you have selected in Table1. If in Table2, the vendor no is the only key (and the all vendor types are filled in a single record), then loop check the vendor types from Table1New against the types in Table2.
    If the key of Table2 is vendor no & vendor type, then do a read table for the key.
    The logic in pseudo-code:
    Select from Table1 into table. If you'd like to limit the selection size, add package size statement.
         extract the vendor types in to itab Table1New.
         Select the vendor & types from Table2 by using the for all entries option (better performance).
         loop at Table1New
              check in Table2:
                   if the unique key is vendor no: check all fields for the vendor type from Table1New
                   if the unique key combo is vendor no & type: check by using a read table.
              If not found => add entry to Table2
         endloop.
    endselect Table1 (when using package size)
    I guess the most difficult step is to extract the types from Table1 into separate fields, all the rest seems straight forward. Please keep in mind the itab type definitions for a better performance.
    Good luck!
    Best regards,
    Zhou

  • Problem returning a two-dimensional array in web service

    Hello. I'm having problems returning a two dimensional array in my web service. The service returns a MyClass[][] correctly, but the client receives a different one.
    I've done a test that returns a MyClass[1][1] an the client shows a MyClass[1][20]. All the MyClass objects returned in the array are the same and all it's fields are null. There's even an element of the array containing null instead of the object. As I say, the service creates the array ok, but the client gets other thing.
    I have other methods returning one-dimensional arrays MyClass[] and I have no problem.
    My system:
    WindowsXP
    Tomcat 5.5 (Axis 1.3?)
    JDK 1.5
    Eclipse 3.3
    My wsdl is generated with eclipse, although I've had to update my wsdd manually.
    Any Ideas?
    Thanks.

    Does it have to be stored in an array?
    Because you could use the java.awt.Point class, and a
    java.util.Set to create random points until you have
    the correct number of unique points.Of course it is no must to store it in an array. it was just my first thought of approaching the problem. I will try the Point.class. Thanks for that hint.

  • Always have a problem ,every month two or three times all my contacts DISAPPEARS

    Always have a problem ,every month two or three times all my contacts DISAPPEARS

    Betewen all i save all my contact in I cloud ,any the same DISAPPEARES !!!
    After 2 day rutern show all my contacts !!!
    what's the problme ??

  • On my iPad mini, my inbox number count is over 500 even though the inbox. Is empty. All accounts do this on my iPad but all my other device are fine. Problem showed up two weeks ago???

    On my iPad mini, my inbox number count is over 500 even though the inbox. Is empty. All accounts do this on my iPad but all my other device are fine. Problem showed up two weeks ago???

    Hi Peter,
    Thanks for participating in the Apple Support Communities.
    It sounds like the Mail app on your iPad mini is showing that you have over 500 unread email messages, but your inbox is actually empty.
    There are several steps I'd use to troubleshoot this situation.
    First, restart your iPad to see if it clears up the symtom:
    Restart or reset your iPhone, iPad, or iPod touch - Apple Support
    Press and hold the Sleep/Wake button until the red slider appears.
    Drag the slider to turn your device completely off.
    After the device turns off, press and hold the Sleep/Wake button again until you see the Apple logo.
    If this doesn't correct the behavior, try removing and re-adding the affected email accounts next:
    Get help with Mail on iPhone, iPad, and iPod touch - Apple Support
    Delete the affected email account from your device.
    Tap Settings > Mail, Contacts, Calendars.
    Tap the affected email account.
    Tap Delete Account.
    Add your account again.
    If the same thing happens after re-adding the account, you may need to use the steps below to reinstall iOS. You may want to back up your iPad to iTunes before completing this step.
    Make sure that you have iTunes 12 or later on your computer.
    Put your device in recovery mode.
    When you get the option to restore or update, select Update. This will reinstall iOS without erasing your data.
    From:
    If your iPhone, iPad, or iPod touch doesn't respond or doesn't turn on - Apple Support
    All the best,
    Jeremy

  • [svn:fx-trunk] 10214: This fixes the problem that if two text components share the same textFlow there is an infinite loop involving updateDisplayList - damageHandler - invalidateDisplaylist - back to updateDisplayList.

    Revision: 10214
    Author:   [email protected]
    Date:     2009-09-13 07:33:58 -0700 (Sun, 13 Sep 2009)
    Log Message:
    This fixes the problem that if two text components share the same textFlow there is an infinite loop involving updateDisplayList -> damageHandler -> invalidateDisplaylist -> back to updateDisplayList.  The bug file was for TextArea which is RET but the same bug was in RichText as well.
    This example with a renderer exposed it because the typicalItem that is composed to figure out sizes and the actual first item in the list share the same textFlow.  It actually has nothing to do with useVirtualDisplay other than it was sharing a textFlow.
    It turns out that the TextFlowFactory dispatches damage events every time the textFlow is composed.  Unlike when the flowComposer is used, it always considers the flow damaged.  It was exacerbated by each of the two components having a damage handler for the same textFlow.
    The solution is to use the textFlow generation number.  In the damageHandler if the generation is the last known generation number, assume no changes, and return immediately from the damage handler.
    QE notes: There are 1 TextArea, 6 TextInput and 2 NumericStepper failuers, with or without my changes.  The common link seems to be DispatchKeyEvent.  Most were testing maxChar, displayAsPassword and restrict.  I tested these and they seem to be working correctly.
    Doc notes:
    Bugs: SDK-23002
    Reviewer: Gordon
    Tests run: checkintests, TextArea, TextInput and NumericStepper
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-23002
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichEditableText.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/RichEditable TextContainerManager.as

    Revision: 10214
    Author:   [email protected]
    Date:     2009-09-13 07:33:58 -0700 (Sun, 13 Sep 2009)
    Log Message:
    This fixes the problem that if two text components share the same textFlow there is an infinite loop involving updateDisplayList -> damageHandler -> invalidateDisplaylist -> back to updateDisplayList.  The bug file was for TextArea which is RET but the same bug was in RichText as well.
    This example with a renderer exposed it because the typicalItem that is composed to figure out sizes and the actual first item in the list share the same textFlow.  It actually has nothing to do with useVirtualDisplay other than it was sharing a textFlow.
    It turns out that the TextFlowFactory dispatches damage events every time the textFlow is composed.  Unlike when the flowComposer is used, it always considers the flow damaged.  It was exacerbated by each of the two components having a damage handler for the same textFlow.
    The solution is to use the textFlow generation number.  In the damageHandler if the generation is the last known generation number, assume no changes, and return immediately from the damage handler.
    QE notes: There are 1 TextArea, 6 TextInput and 2 NumericStepper failuers, with or without my changes.  The common link seems to be DispatchKeyEvent.  Most were testing maxChar, displayAsPassword and restrict.  I tested these and they seem to be working correctly.
    Doc notes:
    Bugs: SDK-23002
    Reviewer: Gordon
    Tests run: checkintests, TextArea, TextInput and NumericStepper
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-23002
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichEditableText.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/RichEditable TextContainerManager.as

  • Problems with synchronizing iCal with iCloud accounts on my Mac Pro

    I have problems with synchronizing iCal with iCloud calender accounts on my Mac Pro runnning OS 10.6.8
    (error message "HTTP/1.1 403 Forbidden" på handlingen CalDAVAccountRefreshQueueableOperation.)
    It works fine on iOS devices.

    Due to lacking hardware driver compatibility i our graphic production environment we can't upgrade to Lion.
    Does that mean that it after the closing of MobileMe is impossible to synchronize calenders to Mac's running OS 10.6.8 ??

  • Hi All,problem in synchronizing toughbook

    Hi All,
             Pls provide the solution for the problem  when synchronizing toughbook  .Its Urgent .

    'Hi Bharat,
    well, can you connect to the NWA from the Toughbook? It could be that you have some settings on the Toughbook that avoid this.
    First test: Connect via Ethernet in the internal Network. Then try to sync - is this working? Is the setting correct?
    If this is ok, then check via GPRS - first to call the Webservers J2EE Main page, then the NWA and finally try to sync.
    The problem: it has nothing to do with the Hardware as such I think - even a Toughbook is a normal Laptop. The problem seems to be in the Landscape. Your URL setting is not correct or there is a Firewall in between blocking the access to the Server - or you have not setup the Toughbook to alllow TCP/IP calls at all.
    So this is the area you need to look at.
    Hope this helps to give you a hint where to look at to solve the issue!
    Regards,
    Oliver

  • Gap between two execution

    Help!I have got an urgent issue.
    I code a complex sql that joins three tables.
    When I first run it, it works well.
    When I second run it, it works pool. The performance is so low that I wish to see the output before the end of this year. No any change is made during the two execution. Any guru has any suggestions or idea what is the root cause? or what happened here.

    Is the "first run is fast, second run is slow" reproducible? I mean, is it the first run of the day? Or was just the very first run fast, and now it is always slow?
    You have the ability to get an explain plan for the query, as long as you can login via sqlplus.
    Once in sqlplus, do this:
    explain plan for select * from dual;Change the select stmt to whatever your query is. Then look at the table PLAN_TABLE. It has your explain plan in it.
    See this doc for how to view that table. This is 10 docs... not sure, but it may be different in 9, if that's what you have.
    http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10752/ex_plan.htm#16939
    Tom Best

  • Problems with synchronizing

    Hello,
    I am fairly new to using Dreamweaver CS5, but suddenly am having problems with synchronizing my projects. It was working fine until a few days ago, but I'll just list the steps of what happens now to try to make it clear.
    I refresh and click the sync button.
    I choose 'selected local files only' and 'put newer files to remote,' then 'preview.
    Then, Dreamweaver says it's connecting to my server, retreiving folder information, then complete.
    After that, it says that it's putting file temp2342.htm on my server.
    Then it says no synchronization is necessary...even though I do have newer files which haven't been put on my server.
    I've tried 'putting' individual files on the server, but it says 'file activity incomplete. 1 or more files not completed.'
    Up until a few days ago, the synchronization would work just fine and put the newer files on my server. I'm not sure what kind of setting I might have changed between now and then, but any ideas on how to fix this problem would be much appreciated!

    Call our customer care, they'll sort this out. You can find the details from "contact us" link on top of this page.

  • Problem in synchronizing apps

    hey guysi am having problem in synchronizing my apps with new update (ios 5).. & i can't sync my apps which i download from appstore.. is there any solution for this....

    yes i am synchronizing them from my itunes in computer , but it does't synchronize! i don't know why......... i want to sync apps but no synchronize..............

  • Where do I store data common to two executions?

    I have been using the parallel model and cannot find a common data point in TestStand where I can share variables between the two executions. Well, there is StationGlobals, but it is constantly asking me to save the changes.
    If I put my data into the parallel model's FileGlobals, each thread gets a copy. I've tried passing data as a parameter, but I got lost inside of 'Initialize TestSocket' where it calls 'Create Test Socket Execution'.
    The VI that is trying to access the data is in the Operator Interface in the UIEventHandler. It only sees the data for the first execution.
     What is the best way to share common data? (If it is StationGlobals, then I'll live with that.)

    Hi,
    You can use File Globals if in the SequenceFile Properties you set the setting 'Sequence File Globals' to "All Executions Share the Same File Globals".
    Hope this helps
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Readers Writers problem and Synchronized doubts

    I made this code for implementing some Lock because I have to permit the write/read action on shared file between different threads. I would like to let more than one thread reading at the same time and just one for the writing
    This is my code, it's in italian but in english the class name would be AccessManager
    import java.io.Serializable;
    public class GestoreAccessi implements Serializable{
    //number of reader
    private int lettori= 0;
    //flag for someone writing
    private boolean scrittura= false;
    //number of writer waiting
    private int scrittoriAttesa = 0;
    private String nome;
    //Il gestore accessi prende un nome
    public GestoreAccessi(String nom) {
    nome = nom;
    //Blocco per la lettura -- Lock for Reading
    public synchronized void lockRead() {
    try {
    //Fino a che c'e' qualcuno in scrittura o processi che aspettano per la scrittura mi metto in attesa -- If ther is some thread writing or waiting for write
    while (scrittura || scrittoriAttesa > 0) {
    wait();
    //Altrimenti aumento la variabile dei thread in lettura -- Add one thread reading
    ++lettori;
    } catch (InterruptedException ex) {
    //Fine del processo di lettura -- Finish reading
    public synchronized void unlockRead() {
    --lettori;
    // solo gli scrittori sono in attesa e uno soltanto deve essere svegliato
    if (lettori == 0) {
    notifyAll();
    //Blocco per la scrittura -- Start Writing
    public synchronized void lockWrite() {
    ++scrittoriAttesa;
    //Fino a che ci sono lettori o qualcuno che scrive aspetto -- if there are readers o someone writing
    while (lettori > 0 || scrittura) {
    try {
    wait();
    } catch (InterruptedException ex) {
    --scrittoriAttesa;
    //Altrimenti inizio il processo di lettura -- Start the process of reading
    scrittura = true;
    //Fine del processo di scrittura
    public synchronized void unlockWrite() {
    scrittura = false;
    notifyAll(); // sblocca uno o piu' lettori o uno scrittore
    Before all critical part I create a GestoreAccessi object and invoce the .lock.. method and finish the critical part the .unlock.. Do you think it's a good way to solve the problem?
    I have some doubts on the multiple reading at the same time. I read on synchronized: "First, it is not possible for two invocations of synchronized methods on the same object to interleave. When one thread is executing a synchronized method for an object, all other threads that invoke synchronized methods for the same object block (suspend execution) until the first thread is done with the object.
    Second, when a synchronized method exits, it automatically establishes a happens-before relationship with any subsequent invocation of a synchronized method for the same object. This guarantees that changes to the state of the object are visible to all threads."
    It's possible to two different thread read at the same time? The .lockRead() method is synchronized: if one thread has acess in a critical part it takes the lock and no other thread would be able to have an access on the same part?! How can i do this? I have not to declare synchronized the read method?
    Please help me and sorry for my bad english!!
    Bless from Italy

    >
    I made this code for implementing some Lock because I have to permit the write/read action on shared file between different threads. I would like to let more than one thread reading at the same time and just one for the writing
    >
    Multiple threads and even applications can read the same file at the same time; it is writing that is problematic.
    There is nothing in what you posted that even shows any 'file' manipulation so no comments can be made about that.
    It looks like you took those quotes from this Java Tutorial Page on Synchronizeds Methods
    http://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html
    Those quotes are accurate as far as synchronizing a particular instance is concerned but that would not prevent some other code from trying to read/write the same file. But again, you code doesn't even include any file-related objects that you are trying to control access to.
    See the Java Tutorial section on 'Lock Objects'
    http://docs.oracle.com/javase/tutorial/essential/concurrency/newlocks.html

  • Problems in syncronyzing two threads into Test Stand using a Global Variable (TestStand 4.1.1)

    I have one thread that is doing TCPIP Aquisition into a Global variable defined in Teststand. And I have another thread that it supose to read it. All are in the same sequence and execution. The problem is that the aquisition thread got a lot of bytes, while the processing thread is reading always only a few. Do you know what the problem could be?
    I will attach also some pictures just to be maybe more clear...
    Attachments:
    Implementation_pictures.zip ‏368 KB

    I wasn't looking at your Sequence, I was looking at Receive_HDL_Block.JPG. What is that VI doing (the one with number 3 on the icon and Size_in_bytes as an input) ?
    Where in teststand are you doing any checking?
    I don't really understand your sequence.
    You have a sequence (running in a new thread) (why), following by another called Receiver Handler (also running in a new thread) then two more sequences which seem to do some with transmitting something (also running as new threads). You are only waiting on one of these threads (the Receiver Handler). There does seem to be any loops in TestStand, you dont seem to be bothered about the other threads that you have running. What happens when this test sequence finally does stop, what is stopping the Threads that you have running.
    Your pictures dont really seem to fit in with your Test Sequence, such as where does Test_005.vi fit into everything
    The whole thing is a bit of a nightmare.
    Maybe your best bet would be to scrap the lot and start again. Only this time have a better understanding of what you what to achieve, what would be best to put into Teststand and what to put into labview. Whether you really need all those new threads running.
    Sorry to be so blunt.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Problem in merging two files using BPM

    Hello Frens,
    I am doing a scenario for merging of two files N:1 using BPMu2026
    I have to merge two files into one file. The two input files are as below :
    File1 : Id, Name, Age, Place
    File2 : ID, Street, Adrress
    And output File is : ID, Name, Age,place, street, Address
    For this scenario I have defined three datatypes , message types and  the message interfaces as below :
    For File1:  Mi_file1_ob, Mi_file1_abs
    For File2: Mi_file2_ob, Mi_file2_abs
    For output : mi_output_ib, mi_ouput_abs
    In interface mapping I have selected two source interface and one targetu2026
    For Integration process I have selected two receives as two branches of fork and transformation to collect them and a send..
    In IR part I have defined three communication channels sender1, sender2 and a receiver . I have imported the integration from IP and rest is sameu2026
    I am facing a problem for getting the outputu2026
    When I checked in sxmb_moni  everything is fine  and sxi_cache and the return code is also 0 but I am not getting the outputu2026
    Can anyone help me in finding out the problem..
    Thanks in advance...

    Hi,
    Have a look into these blogs and links
    /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
    http://help.sap.com/saphelp_nw04/helpdata/en/de/766840bf0cbf49e10000000a1550b0/content.htm
    you can design the ccBPM. To know more about Correlation -with e.g
    http://help.sap.com/saphelp_nw2004s/helpdata/en/0e/56373f7853494fe10000000a114084/content.htm
    /people/sravya.talanki2/blog/2005/08/24/do-you-like-to-understand-147correlation148-in-xi
    /people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm
    /people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi
    Re: Correlation
    http://help.sap.com/saphelp_nw04/helpdata/en/a5/64373f7853494fe10000000a114084/content.htm
    i hope this will help you.
    Regards
    Aashish Sinha
    PS : reward points if helpful

Maybe you are looking for

  • Front Row issues with MacBook Pro?

    I just bought my MacBook Pro today and transferred all my files from my old Mac via firewire. I run Front Row, and it says "an error has occurred" every time i try and play any playlist OTHER than the playlists of stuff bought from iTunes... any idea

  • I cannot change my desktop Picture On Mac Os 10.10.1

    I having a problem once i update to mac os 10.10, Update to 10.10.1 also the same issues. My desktop picture still cannot change.It appear Could not load Desktop & Screen Saver preference pane.. Kindly advise for this case. Thanks & Regard,

  • Dropped Ipad, red discoloration, won't fix by slapping

    I dropped my iPad 1 and now there is a red discoloration on the screen. I had previously seen in an article on Apple Support that you can fix it by slapping the back of the iPad. I have tried that for over a day and it won't go back to normal.

  • Tone curve - please bring back sliders, Canon DPP software just as clumsy!

    Please bring back sliders for the tone curve beta 4 in this respect is now just as awkward and clumsy to operate in this respect as Canon DPP!

  • Photoshop CC Properties Panel Live Shape bug

    I know this problem was being discussed in the Photoshop forum a few months ago, but I want to put it in CC forum, since it's a CC problem. I'm having the same issues as these people, where the properties panel doesn't always show you the live shape