08-24-2015 08:43 AM
Does anyone have an example of a run time script (text parsing) engine based around a state machine that can be shared?
Trying to layout a design for a set of commands provided by the user to control the flow of an application using the Que Messeging architecture relying on a state machine.
I was thinking the state machine would handle the parsing of the command which would then inject the commands into the que.
The commands will be instructing the application to perform math operations on multiple sources of data.
I am thinking I would have multiple que loops setup to facilitate parallel math operations
The results would then need to be brought together and sync'ed so each result represents the same point in time. Can anyone offer a suggestion on how to sync the result data? The original data does come with time stamps which I should be able to keep matched to the individual results but what is a good approach to pull all the result data together in a Que architecture? Shared Variables? I have read good and bad about that technique. Or send the results into a dedicated result handling loop with a que-flag that sends a message to a dedicated "Sync-Results" Loop, which would then sync the result data once all the result data has been recieved?
The initial data set is probably no more than 5meg, so once I start sending the data down the wire into multiple loops am I essentially adding another 5meg to the memory used for each analysis loop I use?
Exploring ideas, always good the here what other folks have to say.
Thanks in Advance
Tim C.
08-24-2015 11:08 AM
I don't have any code to share unfortunately but I recently re-wrote our internal scripting engine which is used by engineers/researchers to perform tests on test rigs with a scripting language.
This was somewhat inspired by something I saw at a user group meeting on recursion but essentially it's a LabVIEW Object Oriented solution which has a parent 'Step' class which has 'Action' and 'Sequence' child classes. A normal sequence contains an array of step objects (so can contain other actions/sequences) and you can inherit the action class for the different actions that your system performs. It's quite a complex architecture (requires OOP and recursion) but allows for timing, looping, nesting, branching of sequences/test steps. In my case, each 'action' sends a queue message to the relevant handler (and can optionally wait for a response to confirm it has finished or if an error occurred) to perform the action.
You might also want to have a look at the PTP Sequencer as it does something similar.
08-24-2015 12:30 PM
I've done this in the JKI State Machine; it's string-based, but you could take any combination of States as text input and add states to your State Machine.