By Tomi Maila
At JKI, we have found that a professional user interface design can make a huge difference for LabVIEW applications. That’s why we’re very proud to announce we have just released the JKI Flat UI Controls for LabVIEW, a beautiful, professionally-designed set of LabVIEW controls that we use on some of our own projects at JKI! We hope that by sharing these with the community, we can help make it easy for just about anyone to build their own beautiful and intuitive user interfaces in LabVIEW.
Learn More & Download
By Tomi Maila
We recorded all JKI presentations and have made them available online. AI and deep learning with Javier Ruiz & Ian McFarlane, .NET integration and interface design with Sarah Zalusky, and Caraya unit testing with Jim Kring. Good stuff!
Caraya: A New Take on LabVIEW Unit Testing - TS9754
by Jim Kring
Designing a LabVIEW Interface for .NET Applications - TS9757
by Sarah Zalusky
Artificial Intelligence With LabVIEW: Deep Learning-Based Classification and Control - TS9758
by Javier Ruiz & Ian McFarlane
I have to develop an application and I would like some help designing the architecture.
The system controls a number of pumps and valves to create flow around a network of pipes. There are flow meters in the network which are used as feedback for PID to maintain a flow. The network of pipes is gradually opened up to get flow and then PID kicks in to maintain a flow. The test sequence is pretty much a big state machine. For example:
1. Open valve 1
2. Wait for pressure to build
3. Ensure temperature is not over limit
I will have a number of different screens which I want to load into a main sub-panel:
Â· Main SCADA screen (show state of all valves pumps etc)
Â· Test setup screen (configure tests)
Â· I/O screen
Â· Alarm screen
I will also have a number of I/O processes:
Â· Digital (valve sates)
Â· Analogue (flow meters, temperature etc)
Â· Modbus and serial devices (flow meters)
Â· Digital Output â€“ Valves etc
Â· Analogue - Proportional valves
I want to use the Actor Framework because Iâ€™ve used it 3 times now and it is easy to spawn processes, make popups, inter-process messaging, error handling etc. I can have all my processes separate (high cohesion) with separate user interfaces (if they have a UI) .
My problem is that AF and State machines donâ€™t really go that well together (correct me if Iâ€™m wrong).
What happens when I want to do PID or loop in the same state?
Time delayed message?
A a VI for each state and enqueue the next or same state from within that VI?
Does anybody know a good way to incorporate a state machine into AF or should I chose a different way of doing things?
Any thoughts will be appreciated.
I have done a few applications with the JKI State Machine, however I can never find a way to get into the "", "Idle" state in order to scan for Events.
I tried passing various strings such as "", Idle or use an intermediary case event. Also tried modifying the Timeout on the event case.
There's already an Event Case inside of JKI SM, so why would we need to add a another loop in order to control it as a Producer-Consumer for the front Panel to be responsive?
I don't think the implementation of the Producer-Consumer on http://forums.jki.net/topic/1347-jki-state-machine-producer-consumer-loop/ would work since it does requires detecting an event.
The only way I can think on how a P-C would work, it would require adding a "Add State(s) to Queue" between the "Parse State Queue" and the main case structure, where the data inserted would come from some kind of shared variable between the Procuder loop and the Consumer loop. Then you would still need to clear that variable and manage the new states to be added only on a change of the variable after it is added and cleared.
How can we force the scan for Events when we want with the standard JKI SM loop?
The only way that I see the JKI Events being useful is on single clicking applications, where the actions on the front panel always end up clearing the Queue. The while loop would only be used to keep the application active.
The only workaround that I found is to add all local variables within the states that would break the sequence if modified. Which is bad because you will need to track every interface item manually.
Here is an example:
(Not sure if the image is working as they are blocked where I work so I added it also to attached files)
This State loops on itself until an action is done to stop the loop, such as toggling the Read DMM or stopping the VI (I shouldn't even need to track those...). As you can see the issue remains that the front panel remains non responsive if I modify anything that is not one of those 2 buttons. I have tried forcing the Idle state through a Timeout case which sends "Idle" to the JKI SM.
By Walter Gunter
I am working on some labview code that I really want to use OOP. I have some classes, ie, motor, relay, potentiometer, etc that I am using and wanted to incorporate in a state machine. I wonder if there are some good examples of this? I found a thread on here discussing it http://lavag.org/topic/13064-object-based-state-machine-pattern/ , but I am not clear if it answers my question.
1. When I try to wire a class into a state machine (while loop with a case structure), I always get a broken wire in the while loop. It says the wire type is different? Am I thinking of this incorrectly. I have a class object I put on the block diagram, i wire it to 'Initialize.Vi' and it breaks (there and on any vi from that class).