LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run Time Script Engine Basic Example with State Machine

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.

 

 

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 1 of 3
(3,265 Views)

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.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 3
(3,246 Views)

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.

 

M3K CAN ESS Main_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 3
(3,230 Views)