Getting Started
This page walks through creating a first Triarc process and running it from a top level VI. It assumes that you know the LabVIEW queued message handler pattern and have used LabVIEW classes.
Install the Framework
Install the Triarc Framework VI Package with VI Package Manager. The package installs:
- the framework library
TF.lvlibinvi.lib\Astemes\Triarc Framework, with palettes, - the Triarc Framework Test Suite (see Testing),
- IDE integration: menu items under Tools » Triarc and right-click menu items for processes in the project window,
- the framework error codes (see Error Handling).
Create a Process
- Open or create a LabVIEW project.
- Select Tools » Triarc » Add Framework Library to Project to add
TF.lvlibto the project. - Select Tools » Triarc » New Triarc Process.
In the dialog, select the parent class, enter a name for the process and select the folder to save it in.
The parent can be
Process,View,Application, or any process class already in the project. - The tool creates the class, overrides
Handle Messages.viand adds the class to the project.
Add an API VI
Other code talks to a process only through its API VIs. Right-click the process class in the project window and select:
- Generate API VI... to create a VI that sends a message to the process. Enter the message name in the dialog.
The tool creates the API VI and adds a case for the message to
Handle Messages.vi. - Generate Getter... to create a VI that reads a field of the private class data through a request.
- Generate Setter... to create a VI that writes a field of the private class data through a message.
The generated VIs use the dual-mode pattern described in Handling Messages: called from outside the process they send a message, and called from inside the process loop they do the work.
Implement the behavior in the case of Handle Messages.vi that handles the message.
The Handle Messages.vi is the only place where the class data may be unbundled and bundled.
Keep the Default case calling the parent method, so that messages defined by the parent classes are still handled.
Run the Process
A top level VI uses a process like an instrument driver:
- Create the process object (a class constant) and call
Init.viwith a name. - Optionally configure an error handler with
Set Error Handler.viand log handlers withAdd Log Handler.vi. - Call
Start.vi. The VI returns when the process is running. - Call the API VIs of the process.
- Call
Stop.vi. The VI returns when the process has finished. - Call
Clear.vito release the resources allocated byInit.vi.
For an application with more than one process, create an Application, initialize each process, and add it with Add Process.vi.
The application then starts, stops and clears its processes for you.
See Application.
Next Steps
- Read Process to learn the process lifecycle.
- Read Best Practices before the application grows.
- Look at the examples in astemes-triarc-examples.
- If you use an AI coding agent, point it at the Agent Guide.