Changing an
Algorithm While
It Is Running
The VT1419A has a feature that allows a given algorithm to be specified that can
be swapped with another even while it is executing. This is useful if, for instance,
the function of an algorithm needs to be altered that is currently controlling a
process that cannot be left uncontrolled. In this case, when the original algorithm is
defined, it can be enabled for swapping.
Defining an Algorithm
for Swapping
The ALG:DEF command has an optional parameter that is used to enable algorithm
swapping. The command’s general form is:
ALG:DEF ‘<
alg_name
>’[,<
swap_size
>],’<
source_code
>’
Note the parameter <
swap_size
>. With <
swap_size
>, the amount of algorithm
memory to allocate for algorithm <
alg_name
> is specified. Make sure to allocate
enough space for the largest algorithm expected to be defined for <
alg_name
>.
Here is an example of defining an algorithm for swapping:
define ALG3 so it can be swapped with an algorithm as large as 1000 words
ALG:DEF ‘ALG3’,1000,#41698<1698char_alg_source>
NOTE
The number of characters (bytes) in an algorithm’s <
source_code
> parameter is not
well related to the amount of memory space the algorithm requires. Remember this
parameter contains the algorithm’s source code, not the executable code it will be
translated into by the ALG:DEF command. An algorithm’s source might contain
extensive comments, none of which will be in the executable algorithm code after it
is translated.
How Does it Work?
The example algorithm definition above will be used for this discussion. When a
value is specified for <
swap_size
> at algorithm definition, the VT1419A allocates
two identical algorithm spaces for ALG3, each the size specified by <
swap_size
>
(in this example 1000 words). This is called a “double buffer”. In this example, they
will be referred to as "space A" and "space B." The algorithm is loaded into
ALG3’s space A at first definition. Later, while algorithms are running, ALG3 can
be “replaced” again by executing:
ALG:DEF ALG3,#42435<2435char_alg_source>
Notice that
<swap_size>
is not (must not be) included this time. This ALG:DEF
works like an Update Request. The VT1419A translates and downloads the new
algorithm into ALG3’s space B while the old ALG3 is still running from space A.
When the new algorithm has been completely loaded into space B and an
ALG:UPDATE command has been sent, the VT1419A simply switches to
executing ALG3’s new algorithm from space B at the next Update Phase (see
Figure 3-8). If yet another ALG3 were sent, it would be loaded and executed from
ALG3’s space A.
The Algorithm Language and Environment
Defining Algorithms (ALG:DEF)
118
Chapter 4
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Содержание VT1419A Multifunction Plus
Страница 5: ...4 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 15: ...14 Contents Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 25: ...24 Chapter 1 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 173: ...Notes 172 Chapter 5 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 332: ...332 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 333: ...Appendix A 333 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 334: ...334 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 335: ...Appendix A 335 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 336: ...336 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 337: ...Appendix A 337 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 338: ...338 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 339: ...Appendix A 339 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 340: ...340 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 341: ...Appendix A 341 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 342: ...342 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 343: ...Appendix A 343 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 344: ...344 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 345: ...Appendix A 345 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 346: ...346 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 347: ...Appendix A 347 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 348: ...348 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 349: ...Appendix A 349 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 350: ...350 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 351: ...Appendix A 351 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 352: ...352 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 353: ...Appendix A 353 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 354: ...354 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 355: ...Appendix A 355 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 356: ...356 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 357: ...Appendix A 357 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 358: ...358 Appendix A Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...
Страница 370: ...Notes 370 Appendix C Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com...