Click here to Skip to main content
15,881,757 members
Articles / Web Development / HTML

C#/XML Based State Engine

Rate me:
Please Sign up or sign in to vote.
4.00/5 (7 votes)
20 Jul 20043 min read 47.7K   626   30  
How to create an XML based state engine for controlling a simple real-time system
<?xml version="1.0" encoding="utf-8" ?> 
<StateTable>
	<State Number="0">
		<Function>CheckInputs</Function>
		<Action Type="SLEEP">
			<SleepTime>1000</SleepTime>
			<NextState>0</NextState>
		</Action>
	</State>
	<State Number="10">
		<Function>FirstPressed</Function>
		<Action Type="MOVETONEXT">
			<SleepTime>100</SleepTime>
			<NextState>0</NextState>
		</Action>
	</State>
	<State Number="20">
		<Function>SecondPressed</Function>
		<Action Type="MOVETONEXT">
			<SleepTime>300</SleepTime>
			<NextState>0</NextState>
		</Action>
	</State>
	<State Number="30">
		<Function>BothPressed</Function>
		<Action Type="EXIT" />
	</State>
	<State Number="40">
		<Function>NonePressed</Function>
		<Action Type="MOVETONEXT">
			<SleepTime>1000</SleepTime>
			<NextState>0</NextState>
		</Action>
	</State>
</StateTable>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Web Developer
Australia Australia
Web developer with 15 years of commercial and industrial experience in the software world.
Now working as a contractor through his own company http://codeconsults.com/. See his blog here
Personal homepage http://russquinn.com/

Comments and Discussions