JKISoftware / JKI-State-Machine-Objects

Object-oriented framework for LabVIEW based on the JKI State Machine
BSD 3-Clause "New" or "Revised" License
96 stars 55 forks source link

SMO priority execution #27

Closed 3esmit closed 7 years ago

3esmit commented 7 years ago

I have a system which works as expected when testing the subsystems, but when it's called by the full program the execution sometimes get delayed.

Aquisiton loop runs at 100 ms and send messages to control and UI. Control implements a simple P.I.. Without UI the Control loop runs correctly at max 102ms, but when UI is running together it runs from 100ms to 300ms, and this makes the control response too slow.

I believe LabVIEW is priorizing the UI updates, that are less important then the control.

How can I configure execution & messaging priorities in SMO?

francois-normandin commented 7 years ago

Hi Ricardo,

That's a great question. As you probably found out, you cannot change the priority settings of the Process.vi itself without changing the whole hierarchy.

Starting with SMO 1.1.9+, it is possible to encapsulate the process parallel loop into a subVI and have the Process Sync work correctly. Therefore, you can then make that subVI be high priority (VI Execution Settings) and even replace the JKI State Machine with a Timed Loop.

Look at the template that comes with package "JKI SMO Template (DAQmx)" which shows which nodes are mandatory to keep for process synchronization.

Wrap the bottom loops in a subVI, make it preallocated clone with high priority. That should gives you what you're looking for.

image

which becomes: image image