126
Creating and Running Custom Algorithms
block’s <data byte(s)>. For Definite Length Block Data you must account
for the null byte in the byte count <digit(s)> . If the null byte is not included
within the block, the error "Algorithm Block must contain termination ’\0’"
will be generated.
Indefinite Length Block Data Example
Retrieve algorithm source code from file and send to HP E1415 in indefinite
length format using VTL/VISA instrument I/O libraries:
int byte_count, file_handle;
char source_buffer[8096], null = 0;
file_handle = open( "<
filename>", O_ O_BINARY);
byte_count = read( file_handle, source_buffer, sizeof( source_buffer ) );
close( file_handle );
source_buffer[ byte_count ] = 0; /* null to terminate source buffer string */
viPrintf( e1415, "ALG:DEF ’ALG8’,#0%s%c\n", source_buffer, null );
Definite Length Block Data Example
Retrieve source code from text file, determine length of file, create a
Definite Length Block header and send algorithm to HP E1415 using HP
VISA instrument I/O Libraries:
int byte_count, file_handle;
char header_string[12], source_buffer[8096], null = 0;
file_handle = open( "<
filename>", OO_BINARY);
byte_count = read( file_handle, source_buffer, sizeof( source_buffer ) );
close( file_handle );
source_buffer[ byte_count ] = 0; /* null to terminate source buffer string */
sprintf( header_string, "%d", byte 1 ); /* note byt1for null byte */
sprintf( header_string, "%d%d", strlen( header_string ), byte_count);
viPrintf( e1415, "ALG:DEF ’ALG4’,#%s%s%c\n", header_string, source_buffer, null );
See the section "Running the Algorithm" later in this chapter for more on
loading algorithms from files.
Changing an
Algorithm While
it’s Running
The HP E1415 has a feature that allows you to specify that a given algorithm
can be swapped with another even while it is executing. This is useful if, for
instance, you needed to alter the function of an algorithm that is currently
controlling a process and you don’t want to leave that process uncontrolled.
In this case, when you define the original algorithm, you can enable it to be
swapped.
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> you specify the amount
of algorithm memory to allocate for algorithm <alg_name>. Make sure to
allocate enough space for the largest algorithm you expect to define for
Содержание VXI 75000 C Series
Страница 2: ......
Страница 16: ...16 ...
Страница 18: ......
Страница 30: ...30 Getting Started Chapter 1 Notes ...
Страница 32: ...32 Field Wiring Chapter 2 Figure 2 1 Channel Numbers at SCP Positions ...
Страница 44: ...44 Field Wiring Chapter 2 Figure 2 11 HP E1415 Terminal Module ...
Страница 54: ...54 Field Wiring Chapter 2 Notes ...
Страница 61: ...Programming the HP E1415 for PID Control 61 Chapter 3 Programming Overview Diagram ...
Страница 124: ...124 Creating and Running Custom Algorithms Chapter 4 Figure 4 2 Algorithm Operating Sequence Diagram ...
Страница 136: ...136 Creating and Running Custom Algorithms Chapter 4 Notes ...
Страница 152: ...152 Algorithm Language Reference Chapter 5 Notes ...
Страница 304: ...304 HP E1415 Command Reference Chapter 6 Command Quick Reference Notes ...
Страница 308: ...308 Specifications Appendix A Thermocouple Type E 200 800C SCPs HP E1501 02 03 ...
Страница 309: ...Specifications 309 Appendix A Thermocouple Type E 200 800C SCPs HP E1508 09 ...
Страница 310: ...310 Specifications Appendix A Thermocouple Type E 0 800C SCPs HP E1501 02 03 ...
Страница 311: ...Specifications 311 Appendix A Thermocouple Type E 0 800C SCPs HP E1509 09 ...
Страница 312: ...312 Specifications Appendix A Thermocouple Type E Extended SCPs HP E1501 02 03 ...
Страница 313: ...Specifications 313 Appendix A Thermocouple Type E Extended SCPs HP E1508 09 ...
Страница 314: ...314 Specifications Appendix A Thermocouple Type J SCPs HP E1501 02 03 ...
Страница 315: ...Specifications 315 Appendix A Thermocouple Type J SCPs HP E1508 09 ...
Страница 316: ...316 Specifications Appendix A Thermocouple Type K SCPs HP E1501 02 03 ...
Страница 317: ...Specifications 317 Appendix A Thermocouple Type R SCPs HP E1501 02 03 ...
Страница 318: ...318 Specifications Appendix A Thermocouple Type R SCPs HP E1508 09 ...
Страница 319: ...Specifications 319 Appendix A Thermocouple Type S SCPs HP E1501 02 03 ...
Страница 320: ...320 Specifications Appendix A Thermocouple Type S SCPs HP E1508 09 ...
Страница 321: ...Specifications 321 Appendix A Thermocouple Type T SCPs HP E1501 02 03 ...
Страница 322: ...322 Specifications Appendix A Thermocouple Type T SCPs HP E1508 09 ...
Страница 323: ...Specifications 323 Appendix A 5K Thermistor Reference SCPs HP E1501 02 03 ...
Страница 324: ...324 Specifications Appendix A 5K Thermistor Reference SCPs HP E1508 09 ...
Страница 325: ...Specifications 325 Appendix A RTD Reference SCPs HP E1501 02 03 ...
Страница 326: ...326 Specifications Appendix A RTD SCPs HP E1501 02 03 ...
Страница 327: ...Specifications 327 Appendix A RTD SCPs HP E1508 09 ...
Страница 328: ...328 Specifications Appendix A 2250 Thermistor SCPs HP E1501 02 03 ...
Страница 329: ...Specifications 329 Appendix A 2250 Thermistor SCPs HP E1508 09 ...
Страница 330: ...330 Specifications Appendix A 5K Thermistor SCPs HP E1501 02 03 ...
Страница 331: ...Specifications 331 Appendix A 5K Thermistor SCPs HP E1508 09 ...
Страница 332: ...332 Specifications Appendix A 10K Thermistor SCPs HP E1501 02 03 ...
Страница 333: ...Specifications 333 Appendix A 10K Thermistor SCPs HP E1508 09 ...
Страница 334: ...334 Specifications Appendix A Notes ...
Страница 346: ...346 Glossary Appendix C Notes ...
Страница 388: ...388 Generating User Defined Functions Appendix F Notes ...
Страница 438: ...438 Index Writing the algorithm 129 values to CVT elements 120 values to the FIFO 121 Z ZERO CALibration ZERO 194 ...