Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Question on Semaphores


MatthewBoyd Jun 5, 2014 02:10 PM

Does the OS implicitly use semaphores when working with the same serial bus in both the main scan and slow sequence scans?

I have already used the allotted two user-declared semaphores (SemaphoreGet), but I still have to manage communications with a serial device that is polled both in the main scan (every 1s) and in a slow sequence scan (every 10s). To ensure that the slow sequence poll doesn't occur before the device responds to the main scan poll, or vice-versa, do I need to use SemaphoreGet's, or does the OS implicitly coordinate this communication? (I'm polling a device connected to an SDM-SIO1 using the Modbusmaster function in a program running on a CR1000.) Thanks.

* Last updated by: MatthewBoyd on 6/5/2014 @ 8:11 AM *


Sam Jul 14, 2014 07:41 AM

You should either a) do the 1 sec and 10 sec poll from the main scan to ensure they happen sequentially, b) use SemaphoreGet/Release so that the second poll does not go out before the first poll gets its response, c) create your own semaphore like variable that you check before executing the polls. seems like (a) would be the best.


MatthewBoyd Jul 14, 2014 02:25 PM

Thank you.

Log in or register to post/reply in the forum.