How can I set one loop's frequency as a slave of another loop ?

I have 2 loops in parallel. The first runs at 500Hz. The AIread controls the frequency. How can I set the second one at 100Hz ? It is very easy to set it with local variable, but really not clean. The second loop must not use the CPU while waiting the next 100Hz tick. Is it possible ? I am trying to use occurrence, but the second loop will always (I think) use CPU while waiting next tick !
Is it possible to set one loop in one thread and the other one in another thread ? Then set each thread to a CPU (I use a bi-xeon PC)
Thanks

cariboo wrote in news:5065000000080000001EBE0000-
[email protected]:
> I have 2 loops in parallel. The first runs at 500Hz. The AIread
> controls the frequency. How can I set the second one at 100Hz ? It is
> very easy to set it with local variable, but really not clean. The
> second loop must not use the CPU while waiting the next 100Hz tick. Is
> it possible ? I am trying to use occurrence, but the second loop will
> always (I think) use CPU while waiting next tick !
> Is it possible to set one loop in one thread and the other one in
> another thread ? Then set each thread to a CPU (I use a bi-xeon PC)
> Thanks
One solution is to place a case inside the loop which run at 500 Hz. Put
your 100Hz code inside the True case. Use the "Quot
ient & Remainder"
funtion and the iteration counter to execute the true case every fift
execution of the 500Hz loop.
This may not work if the 100Hz code use to much time, it will then delay
the 500Hz loop.
I would go for the occurences solution. The wait will use some CPU
resources while waiting but i don't think that should be any problem (when
done correctly).
Rolf

Similar Messages

  • My ipad 3 dosenot have passcode how can i set one ??

    my ipad dosenot have passcode how can i set one ??
    i did not find the passcode set option under Setting > General icone ???

    And when you enter a passcode, write it down...there are several users a day who have forgotten their passcodes and ask how to reset them.

  • How can you use one NetStream to publish video and audio from another NetStream in AS3?

    Let's say one of your client programs in AS3 is able to receive live video and audio from a NetStream and play it on the screen.  How could you make it also take that video/audio stream that it's receiving, copy it over into another NetStream, and publish it elsewhere?  I need to know how to do with this regardless of whether RTMP, RTMFP, or some mixture is involved.  The reason why the stream needs to be relayed this way is a real long story, but it's necessary in this particular case. Thanks!

    RTMP is TCP, which has higher overhead and latency because it guarantees packets are delivered (handshaking, causing latency and overhead). It also doesn't allow you to share connections directly between clients forcing the server to do all the work.
    RTMFP uses UDP, which is a choice protocol for streaming video because it's the opposite. It's lossy which decreases latency and overhead from no retransmissions and most importantly (in some applications) allows you to connect directly from one Flash Player to another Flash Player (p2p) so the server overhead is dramatically reduced. The server is only required to negotiate the initial connection and then it's up to the clients to continue to facilitate that.
    How you code your one to many or many to many relationship broadcast network will be based entirely on which of those you choose.
    URLStream is very common to use in p2p. Here's an older Adobe article on p2p and an alternate quick old video tutorial (FP10) as a quick simple example of p2p over RTMFP you can view the source of.

  • What is the default identity store - and how can I set it?

    Hi,
    I'm running Webcenter on WLS, and using WLS and JPS for the authentication of users. On the WLS Console, if I go to Security Realms -> myrealm -> Providers, I have a list of four different providers.
    If I understand correctly, these four providers are my identity stores. How can I set one as the 'default' identity store? Or see which one is currently the default?
    The reason I'm asking is I have the following code in Webcenter to create a new user in the Active Directory:
          // Get the default identity store
          IdentityStore idStore = WCSecurityUtility.getDefaultIdentityStore();
          // Get the user manager object
          UserManager usermgr = idStore.getUserManager();
          usermgr.createUser(loginName, password.toCharArray(), propertySet);So I have a utility Java class which gives me the "default identity store". Now I want to change the WLS configuration so that the Active Directory in which I want to create new users is the "default" identity store.
    Thanks in advance for any help,
    Ludovic

    Hi,
    Thanks a lot for your help and providing this link. I'd actually already looked at that before, but I don't understand how it clarifies what the default identity store is. The relevant part is this, if I understand correctly:
    OPSS initializes the identity store service with the LDAP authenticator chosen from the list of configured LDAP authenticators according to the following algorithm:
    1.    Consider the subset of LDAP authenticators configured. Note that, since the context is assumed to contain at least one LDAP authenticator, this subset is not empty.
    2.    Within that subset, consider those that have set the maximum flag. The flag ordering used to compute this subset is the following:
        REQUIRED > REQUISITE > SUFFICIENT > OPTIONAL
        Again, this subset (of LDAPs realizing the maximum flag) is not empty.
    3.    Within that subset, consider the first configured in the context.Step (1) will match 2 external AD's and the built-in WLS LDAP, so 3 in total.
    Step (2) will still match 3 in total, as they are all 'sufficient'. In my setup, I need them all to be 'sufficient'.
    Step (3) is a step I don't understand. What is "the first configured in the context"? What context? Do they mean the one that was first created? In that case I can't change the default, right?
    Or do they mean "the first in the list on the WLS Console"?
    Best regards,
    Ludovic

  • I forgot the administrator password for my mac and cant set a new one without it how can i set a new one

    i forgot the administrator password for my mac and cant set a new one without it how can i set a new one

    Reset Password 10.7, 10.8...
    http://reviews.cnet.com/8301-13727_7-20087723-263/how-to-run-the-password-reset- utility-in-os-x-10.7-lion/

  • I would like to know how can I set songs in iTunes to play at different times automatically during the day. i.e. one song at 10am the other at 10:30am etc..

    I would like to know how can I set songs in iTunes to play at different times automatically during the day. i.e. one song at 10am the other at 10:30am etc..

  • How can we assign one attribute set to multiple business partners at a time ?

    How can we assign one attribute set to multiple business partners at a time ? Is it possible ? Can anyone explain me ?

    Hello,
    please refer to the following thread:
    How can we assign one Attribute Set to multiple Business Partners at a time? Is it possible?
    best regards,
    Johannes

  • How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    How can I set up two iPhones with the same contact, photos, music etc... but a different sim card and phone number. They will both be my phones, but one will be for use in other countries.

    Phone A = phone with information you want duplicated
    Phone B = phone that you want to copy from A
    Backup Phone A.
    Wipe Phone B using these instructions. What to do before selling or giving away your iPhone, iPad, or iPod touch - Apple Support
    Phone B should be on the 'Hello' screen. Do not swipe it. Launch iTunes. Plug in Phone B.
    When iTunes asks if you want to set up as new phone or restore from backup, choose restore from backup of Phone A.
    After this setup, any changes to one phone (i.e. adding a contact, downloading an app) will have to be manually duplicated on the second phone, if that is your desire). Making changes to one phone will not affect the other after setup.

  • HT5620 How can I set up two separate accounts on one iPad?

    How can I set up two separate accounts on one shared iPad?

    The iPad is meant to be a single user device.
    It is possible to use multiple ID's on an iOS device, but when you switch ID's and download content with another ID, you associate the device with that ID for 90 days and lock yourself out of the other ID for that 90 day period.
    So while it is possible, it's not advisable.

  • How can I set up a wi-fi network, using one time capsule and two airport express

    how can I set up a wi-fi network, using one time capsule and two airport express ?
    The time capsule is near the Mac. ok
    The first Airport is on the corridor, ok, works well and the App on the iPad signals so, ok
    But when I plug the next Airport on another room nearby nothing happens, and signals disconected ....
    is the signal so weak that is not able to go to ono room to the other ?

    Well, even if you have the first express set up to extend the network, the second express can only extend from the TimeCapsule.
    Maybe you got walls of sheetrook in the way, or kitchen/bathroom tiles, etc, dampening the signal rapidly.

  • How can you set up more than one device on iTunes. I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices.

    How can you set up more than one device on iTunes? I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices. I have all my music/videos on iTunes on my mac book pro. Can you set up separate folders for each device and drop in what ever music/videos from the main iTunes library?

    In itunes it is called syncing and you can choose exactly what content to sync to all devices and it can be different for all of them
    How to sync

  • How can I set up multiple spaces (desktops) on my new MacBook Pro 10.9.5?  I have six set up on my other computer MacBook Pro 10.8.5 but can't find how to do it on this new one.  Would appreciate help on this.  Cheers.

    How can I set up multiple spaces (desktops) on my new MacBook Pro 10.9.5?  I have six set up on my other computer MacBook Pro 10.8.5 but can't find how to do it on this new one.  Would appreciate help on this.  Cheers.

    It's not completely obvious. What you have to do in Spaces is to position your cursor to the upper right of the screen, after which faint + (plus) sign appears in that area. Click that, upon which another Desktop will appear.
    The + may be difficult or impossible to see with some desktop backgrounds (black, for instance):

  • My husband and I share one computer.  We want to be able to share the same music on our iPhones, but we don't want to share the same contacts and applications.  How can I set this up so we still share music, but everything else is separate on our iPhones?

    My husband and I share one computer.  We want to be able to share the same music on our iPhones, but we don't want to share the same contacts and applications.  How can I set this up so we still share music, but everything else is separate on our iPhones?

    Welcome to the Apple Community.
    iTunes and iCloud are different accounts. You can both use the same ID for the store login and share your music etc., and use different ID's to log in to iCloud, thereby keeping your calendars etc separate.

  • How can I set my phone to delete messages after a certain period of time? 6 months, 1 year??? It is taking up over 4GB on my phone.  I don't want to delete everything just the oldest ones.

    How can I set my phone to delete messages after a certain period of time? 6 months, 1 year??? It is taking up over 4GB on my phone.  I don't want to delete everything just the oldest ones.

    If you update to iOS 8, you can select that in Settings>Messages>Keep Message and then select your option. If you don't update to iOS 8, you'll need to do it manually.

  • How can we set the Order block for One-Time Billto-address?

    Hi Experts,
    How can we set Order bolck,if user uses one-time bill to address and needs to trigger workflow for releasing process according to order block.
    Please suggest me.
    Thanks and Regards,
    Kiran

    suggest me pls!!!!

Maybe you are looking for