12.07.2015 Views

HVAC Control in the New Millennium.pdf - HVAC.Amickracing

HVAC Control in the New Millennium.pdf - HVAC.Amickracing

HVAC Control in the New Millennium.pdf - HVAC.Amickracing

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>HVAC</strong> <strong>Control</strong> <strong>in</strong> <strong>the</strong> <strong>New</strong> <strong>Millennium</strong>Processes and ThreadsIn W<strong>in</strong>32 term<strong>in</strong>ology, a process is def<strong>in</strong>ed as an <strong>in</strong>stance of a runn<strong>in</strong>gapplication. W<strong>in</strong>dows CE, like o<strong>the</strong>r 32-bit W<strong>in</strong>dows platforms, isa multitask<strong>in</strong>g OS that supports multiple threads of execution with<strong>in</strong> arunn<strong>in</strong>g process. Thread management <strong>in</strong>cludes schedul<strong>in</strong>g, synchronizationand resource allocation. These are handled by <strong>the</strong> kernel.Inside <strong>the</strong> processes that run on 32-bit W<strong>in</strong>dows platforms are <strong>the</strong>threads that rely on messages to start process<strong>in</strong>g, control system resourcesand communicate with <strong>the</strong> OS and user. W<strong>in</strong>dows messages canorig<strong>in</strong>ate from a variety of sources, <strong>in</strong>clud<strong>in</strong>g <strong>the</strong> OS, keyboard, mouseor touch screen actions and o<strong>the</strong>r runn<strong>in</strong>g processes or threads.Exception and Device Handl<strong>in</strong>gSections of code that could fail due to hardware resource problems,device conflicts or cod<strong>in</strong>g errors need to be protected. Exception handl<strong>in</strong>gprotects <strong>the</strong> application from term<strong>in</strong>ation or o<strong>the</strong>r system-levelproblems.The software <strong>in</strong>terface must be able to manage simultaneous ornearly simultaneous events from different types of devices <strong>in</strong> <strong>the</strong> system.The W<strong>in</strong>32 API supports both synchronous and asynchronousmethods of device access. In a synchronous <strong>in</strong>terface, <strong>the</strong> software requestsan action from a device and <strong>the</strong>n waits for <strong>the</strong> result. Examples<strong>in</strong>clude read<strong>in</strong>g and writ<strong>in</strong>g files. In an asynchronous <strong>in</strong>terface, <strong>the</strong>device requests services from <strong>the</strong> application. An example of an asynchronousdevice is a keyboard.In <strong>the</strong> W<strong>in</strong>dows CE kernel, <strong>in</strong>terrupt handl<strong>in</strong>g is split <strong>in</strong>to <strong>in</strong>terruptservice rout<strong>in</strong>g (ISR) and <strong>the</strong> <strong>in</strong>terrupt service thread (IST).Keep<strong>in</strong>g <strong>the</strong> rout<strong>in</strong>g as small and fast as possible is important forreal-time applications.At <strong>the</strong> hardware level, each <strong>in</strong>terrupt request (IRQ) l<strong>in</strong>e is associatedwith one specific software ISR. When triggered, <strong>the</strong> ISR directs <strong>the</strong>kernel to <strong>the</strong> location of <strong>the</strong> IST.Interrupts have a priority associated with <strong>the</strong>m. W<strong>in</strong>dows CE usesa priority-based, time-slice algorithm for thread schedul<strong>in</strong>g. The EmbeddedToolkit allows tun<strong>in</strong>g of <strong>the</strong> <strong>in</strong>terrupt tim<strong>in</strong>g and priorities for aspecific application.©2001 by The Fairmont Press, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!