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
Summary of Contents for VXI 75000 C Series
Page 2: ......
Page 16: ...16 ...
Page 18: ......
Page 30: ...30 Getting Started Chapter 1 Notes ...
Page 32: ...32 Field Wiring Chapter 2 Figure 2 1 Channel Numbers at SCP Positions ...
Page 44: ...44 Field Wiring Chapter 2 Figure 2 11 HP E1415 Terminal Module ...
Page 54: ...54 Field Wiring Chapter 2 Notes ...
Page 61: ...Programming the HP E1415 for PID Control 61 Chapter 3 Programming Overview Diagram ...
Page 136: ...136 Creating and Running Custom Algorithms Chapter 4 Notes ...
Page 152: ...152 Algorithm Language Reference Chapter 5 Notes ...
Page 304: ...304 HP E1415 Command Reference Chapter 6 Command Quick Reference Notes ...
Page 308: ...308 Specifications Appendix A Thermocouple Type E 200 800C SCPs HP E1501 02 03 ...
Page 309: ...Specifications 309 Appendix A Thermocouple Type E 200 800C SCPs HP E1508 09 ...
Page 310: ...310 Specifications Appendix A Thermocouple Type E 0 800C SCPs HP E1501 02 03 ...
Page 311: ...Specifications 311 Appendix A Thermocouple Type E 0 800C SCPs HP E1509 09 ...
Page 312: ...312 Specifications Appendix A Thermocouple Type E Extended SCPs HP E1501 02 03 ...
Page 313: ...Specifications 313 Appendix A Thermocouple Type E Extended SCPs HP E1508 09 ...
Page 314: ...314 Specifications Appendix A Thermocouple Type J SCPs HP E1501 02 03 ...
Page 315: ...Specifications 315 Appendix A Thermocouple Type J SCPs HP E1508 09 ...
Page 316: ...316 Specifications Appendix A Thermocouple Type K SCPs HP E1501 02 03 ...
Page 317: ...Specifications 317 Appendix A Thermocouple Type R SCPs HP E1501 02 03 ...
Page 318: ...318 Specifications Appendix A Thermocouple Type R SCPs HP E1508 09 ...
Page 319: ...Specifications 319 Appendix A Thermocouple Type S SCPs HP E1501 02 03 ...
Page 320: ...320 Specifications Appendix A Thermocouple Type S SCPs HP E1508 09 ...
Page 321: ...Specifications 321 Appendix A Thermocouple Type T SCPs HP E1501 02 03 ...
Page 322: ...322 Specifications Appendix A Thermocouple Type T SCPs HP E1508 09 ...
Page 323: ...Specifications 323 Appendix A 5K Thermistor Reference SCPs HP E1501 02 03 ...
Page 324: ...324 Specifications Appendix A 5K Thermistor Reference SCPs HP E1508 09 ...
Page 325: ...Specifications 325 Appendix A RTD Reference SCPs HP E1501 02 03 ...
Page 326: ...326 Specifications Appendix A RTD SCPs HP E1501 02 03 ...
Page 327: ...Specifications 327 Appendix A RTD SCPs HP E1508 09 ...
Page 328: ...328 Specifications Appendix A 2250 Thermistor SCPs HP E1501 02 03 ...
Page 329: ...Specifications 329 Appendix A 2250 Thermistor SCPs HP E1508 09 ...
Page 330: ...330 Specifications Appendix A 5K Thermistor SCPs HP E1501 02 03 ...
Page 331: ...Specifications 331 Appendix A 5K Thermistor SCPs HP E1508 09 ...
Page 332: ...332 Specifications Appendix A 10K Thermistor SCPs HP E1501 02 03 ...
Page 333: ...Specifications 333 Appendix A 10K Thermistor SCPs HP E1508 09 ...
Page 334: ...334 Specifications Appendix A Notes ...
Page 346: ...346 Glossary Appendix C Notes ...
Page 388: ...388 Generating User Defined Functions Appendix F Notes ...