First of all I have to say that I posted this question on NI forum, but I still don't have a solution yet, so I hope you can help me.
I have a case with semaphore vis getting stuck (deadlock) waiting for each other.
In my program, I have 2 dynamic VIs.
The first one, called processtransmit.vi, sends continously messages to CAN at different rate. So I used parallel time-loops with different interval times. Each of these loops has a semaphore to guarantie that there is only one loop can call send data function to send message to CAN at a time.
The second one, called processreceive.vi, receives messages from CAN. If there is a request message it will send back some asynchronous message. Cause it also using send CAN function so I also use semaphore.
After runing for couple of seconds, all of these semaphores get stuck. I did try turn on the hight light function both before and after it gets stuck but I still not understand why this happens.
I attach here 2 pictures, one is processtransmit.vi, another one is responsemessage.vi which is call from processreceive.vi. You can see the waiting green arror on the acquire semaphore VI. The response VI will be send out base on the request message.
I would appreciate any helps or suggestion of another architect which make it runs better.
Best regards,
Thang Nguyen