Build and download external routines, Update an existing external routine, Create multi-threaded external routines – Rockwell Automation 1789-L10_L30_L60 SoftLogix 5800 System User Manual User Manual

Page 130

Advertising
background image

130

Rockwell Automation Publication 1789-UM002J-EN-P - December 2012

Chapter 7

Develop External Routines

Build and Download External
Routines

Before you build an external routine, make sure that RA_ExternalRoutines.h is in
the include path for the project. Then, follow these steps.

1. Build the project.
2. Map the external routines into a project.
3. Download the project to a SoftLogix controller.

The external routine DLL is downloaded as a part of the
project download.

Update an Existing External
Routine

To update an existing external routine do the following.

1. Edit the source code in Visual Studio software.
2. Rebuild the project.
3. Re-map the external routines into a project.

If you re-map one function from a DLL, all of the other functions that you
use from the same DLL are also re-mapped. When a DLL is re-mapped, a
re-verification is done on all of the routines that reference the DLL.
Routines that reference a DLL different from the one re-mapped are
unaffected by this process.

4. Re-download the project to the SoftLogix controller.

The external routines must be re-mapped and the project must be re-downloaded
to the controller for the changes to be made in the SoftLogix controller.

Create Multi-threaded
External Routines

The following example shows an external routine that creates threads to do the
majority of the processing. Consider using this approach when the amount of
time required to execute is large enough that it causes a watchdog fault in the
controller. Applications that have disk I/O or, as in the following example, play
*.wav files, are created in this manner.

The following example also shows how to synchronize the threads with the
controller so that they can react properly to changes of state in the controller.

Advertising