03-03-2017 01:29 PM
Hi, I'm fairly new to the JKI SMO framework and I have been looking at many examples online about how to use the framework (the HAL Webinar was very helpful) and I think I understand most of what is being presented but I'm having trouble making the next step of actually implementing it into my applications.
At a basic level I'm having difficulty with launching the splash screen SMO. When I launch a splash screen using the created TestLauncher.vi it launches without difficulty, but when I try to create the Splash Screen SMO from another SMO, it gets stuck in the SMO.lvclass:Start.vi. Particularly, the subVI StartProcesses.vi. It's waiting in the Event structure for an event never seems to happen.
Any ideas as to what I'm doing wrong?
Thanks,
Bruce
03-12-2017 06:30 PM
Hi Bruce,
would you be able to post some code so I can take a look?
Also, which version of SMO are you using?
You are likely to get faster attention on the Github issue tracker:
https://github.com/JKISoftware/JKI-State-Machine-Objects/issues
Francois
03-13-2017 11:27 AM
I wasn't able to get my code to work, it seems I may be having trouble with the basic concepts of how to use multiple SMOs. I was trying to start a Splash SMO from within another SMO and maybe that isn't the way to go with these.
I've been looking extensively at your Microscope Webinar and code, and it looks like you have 1 VI to start all of your SMOs. So if I wanted to add a Splash Screen SMO to the Microscope controller, how would you go about doing this? Would you add the Splash Screen SMO directly to the Microscope.TestLauncher.vi or would you add a higher level VI to launch Splash Screen and launch the Microscope.TestLauncher.vi?
Attached is some code, but until I understand these concepts a little better it probably isn't worth your time to debug my code.
Thanks,
Bruce
03-13-2017 03:45 PM
Hi Bruce,
thanks for uploading this code example. The issue is that your splash screen never completes its startup process because the registration is occurring during the registration process of your caller UI.
There are two considerations to solve your issue.
First of all, the "Process: Sync" frame is extremely important in "Process.vi" for any SMOs. That's the step that notifies the framework that event registrations have completed and that your component will not miss any important messages such as state changes, errors or more importantly, shutdown or abort signals... The overall state of your state machine object will remain "Created" until the stack of children implementations all reach the Process Sync frame, at which point the SMO will transition to "Started".
In your "Acquire and Log UI.lvclass:Process.vi", you need to perform all actions instantaneously or asynchronously to allow your SMO to start (aka. reach the Process: Sync frame).
As you can see in the screenshot, your app currently waits forever in the "UI: Launch Splash Screen" and cannot sync, which is why it waits forever in the Start Processes vi.
We will remove the blocking part (event structure) and interact with the splash screen asynchronously.
Secondly, it is not possible at the moment to Start a subprocess (SMO Splash in this case) while you are in the process of Starting your caller subsystem (Acquire and Log SMO). This means that you cannot call the "Start" method until after the "Process: Sync". But this is not what you want... so the current option is to call it before the Process.vi is called: essentially, you can override the "onStart" method to start your Splash screen before the process is launched. You can then use the "onStarted" override to close your splash screen.
Alternatively, I will be looking into a way to launch a component subsystem during the startup process: it is possible by making the Register Process method re-entrant... however I want to run unit tests to make sure this does not mess with other features, so this is not an option at the moment.
Let us do a step-by-step walkthrough of the modification to do what you want:
I hope this helps.
best,
Francois
02-25-2018 11:30 PM
can anyone convert this project to LabVIEW 2015? I want to study how to write practical program using JKI SMO.
02-26-2018 06:06 PM