Example Code

Can I Dynamically Convert the

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

    Other

  • Digital Pattern Editor

Code and Documents

Attachment

Description

This example shows how to make a 'Halt' opcode behave as 'Keep_Alive' progromatically, when you have a Digital Pattern File (.digipat) where the last vector is 'Keep_Alive'; for example, if you are using the Keep Alive:Halt on keep_alive Opcode Property in LabVIEW to make it behave as an 'Halt' opcode. 

How to Use

There is no property in the Digital Pattern Driver available that allows you to convert the Halt opcode into Keep_Alive programatically. Instead, you'll have to manually change the Halt opcode to Keep_Alive in your Digital Pattern File (.digipat).

If you have too many DIGIPAT files, and it is infeasible to manually correct all of them, you could automate the process by using the Digital Pattern Compiler EXE, which is capable of decompiling binary DIGIPAT files to raw text DIGIPATSRC files and vice versa. After you have the text files, all that needs to be done is to use a string search and replace function (to replace "Halt" with "keep_alive") in the language you wish to automate this in and then recompile it back to DIGIPAT file using the Digital Pattern Compiler EXE.

Additional Information

The attached LabVIEW VI takes multiple pairs of DIGIPAT and PINMAP files as input and replaces 'Halt' with 'keep_alive' (or vice-versa) in the resulting DIGIPAT files.

Related Links

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.