03-11-2007 05:04 PM
03-12-2007 10:15 AM
Thanks for posting your findings. Still digesting all the information.
In order to replace the While Loop on the State Machine, you will need "right click" on the while loop and select "Unlock code from state machine". You can then replace the While Loop with a Timed Loop. Unfortunately this means you can no longer use the state diagram editor with this state machine.
03-12-2007 11:10 AM - edited 03-12-2007 11:10 AM
Hello,
Thank you for your reply. Yes I know I can unlock the code from tthe State Diagram.
However, the problem is that some States in in some of the State Diagrams may call a process that in some cases will not return for a long time (but they run in a Loop and do yield processor time by calling Wait (6 ms): 70% of the loop time is spent in Wait).
Thus we have a Outer Loop (The outer State Machine) that calls an Inner Loop that may not return in a long time, but does regulary yield processor time.
In this Scenario, a Timed Loop in the Outer Loop will not work since it has a fixed interval.
Message Edited by geirove on 03-12-2007 03:57 PM
03-13-2007 02:45 AM
Hello,
I have updated the white paper. There is a new Audit section in the document showing what has been updated and where.
Download the updated document from our web site here: http://objective.no/multi_process_cfp_realtime.htm
or directly here: http://objective.no/white_papers/multi_process_cfp_realtime/Multiple_Parallel_Processes_under_Realti...
03-13-2007 08:35 AM
03-13-2007 10:29 AM
03-14-2007 08:36 AM
03-14-2007 09:41 AM
Hello Gerardo,
I was not aware that you work for NI. I have some important questions for you:
Assume we use your trick and wrap a Timed Sequence around the outer Loops of State Diagram Toolkit generated code.
Now the user code runs at a Priority above High Priority, but below Time Critical Priority. Right?
Questions:
1) Which, if any, System (RTOS) processes will Preempt User Code running at this Priority Level ?
(Probably the Memory Manager / Garbage Collector, but we are not doing any operations which should make GC kick in)
2) If the User Code still can be preempted by System Processes, what is timewise the upper bound (apart from GC) of these processes?
i) The System Processes may run for a long time, so the Time Slice of 10 ms will be the upper bound ?
ii) The time is much shorter, shorter than X ms, where X is ?
Please, knowing this will give us more peace of mind !
And, if you may, which processes may Preempt High Priority?
----
We have run our endurance test now for 39 hours and it has performed 150.000 Relay Operations as described in the White Paper. It has met the expected Min / Max response time perfectly every time.
It has 24 processes running at High Priority and one Communication Process using Shared variables running at Normal Priority. So the system seems to work, but we must know before deploying the system at the customer site!
04-07-2007 03:43 PM
Hello,
I wanted to follow up on my own questions so that others reading this thread also can find the answers to the questions asked:
The solution to the problem of running several processes (State Machines) in Parallell is indeed to wrap a Timed Sequence around the VI containing the State Machine:
Timed Loops and Timed Sequences run at a Priority level Above High Priority, but Below Time Critical Prioirty. I believe the only System Process that will interrupt "Timed Loop Priority" is the Garbage Collector (Meomory Manager).
I will update the White Paper at our web site as soon as I get the current project out of the way: We may even through in some more "goodies" / experiences that we have made.