18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

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.

Introduction<br />

The following figure illustrates how IWS executes a generic thread (such as the Viewer).<br />

Where:<br />

Executing a Generic Thread<br />

• Signal 1 is the Period time period (set to 50ms for this example).<br />

• Signal 2 shows when the thread is active for the operating system.<br />

• Signal 3 is the TimeSlice time period (set to 30ms for this example).<br />

• Signal 4 shows the execution of the thread itself.<br />

In this example, IWS generates a Period message every 50ms (signal 1). When IWS generates this message,<br />

its thread becomes active and remains active until the specified TimeSlice time period (from IWS) expires. The<br />

thread then remains inactive until IWS generates the next Period message (signal 1).<br />

While the thread is active, the operating system is responsible for executing that thread. However, just<br />

because a thread is active does not mean the operating system will execute it immediately — the operating<br />

system may be executing other threads, for example.<br />

When the operating system executes the thread, the TimeSlice timer starts counting and the thread is<br />

executed for 20ms (TimeSlice from the operating system). After the 20ms period, the operating system<br />

automatically switches to the next active thread (such as the Driver), and so on.<br />

In the above example, the TimeSlice time was set to 30ms, which means the operating system is not supposed<br />

to execute the thread more than once in each TimeSlice of IWS. However, if you specify higher values for the<br />

IWS TimeSlice time period, it is likely that the operating system will execute the same thread more than once<br />

in the same TimeSlice time period.<br />

In the next example, the Period and the TimeSlice values were changed as follows, but the default operating<br />

system TimeSlice period (20 ms) was not changed.<br />

Setting a Higher TimeSlice<br />

Where:<br />

• Signal 1 is the Period time period (set to 100ms).<br />

• Signal 2 shows when the thread is active for the operating system.<br />

Page 26<br />

<strong>InduSoft</strong> Web Studio

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

Saved successfully!

Ooh no, something went wrong!