Workers for LabVIEW
HomeDownload Follow ProjectAbout
  • Welcome to Workers for LabVIEW
  • What's New in v5.0
    • Upgrading to v5.0
    • New Features
      • Development Tools
      • Functional Changes
      • API Changes
      • Example Projects
      • Change Log
  • Fundamental Concepts
    • What is a Worker?
    • Important Terms
    • The Workers Main VI
      • Default Framework Cases
    • subWorker Types
    • Initialization Sequence
    • Shutdown Sequence
    • Priority Queue
    • Launcher VIs
  • Worker APIs
    • Overview
    • Local Requests
      • Creating Local Requests
    • Public Requests
      • Creating Public Requests
    • Public Requests w/Reply
      • Creating Public Requests w/Reply
    • Public Responses
      • Creating Public Responses
      • Registering Public Responses
    • Case Labels
    • Deleting API Items
  • Workers Tools
    • Workers Tools Menu
      • Create/Add Worker
        • Removing Workers
        • Creating Worker Templates
        • Troubleshooting
      • Workers Debug Server
        • Workers Application Manager
          • Right click menu
        • Worker Message Logs
          • Right click menu
        • Settings
        • Troubleshooting
      • Worker Call-Chain Viewer
      • Worker User Library
        • Config File Editor
      • RT Worker Convert
      • Public API Builder
        • Public Requests
        • Public Requests w/Reply
        • Public Responses
        • Override MHL Cases
      • Create Launcher VI
      • Create Worker Base Class
      • Change Inheritance
      • MHL Case Viewer
      • Change Worker Properties
    • Quickdrop Shortcuts
      • Show Private Data (Ctrl+0)
      • Create MHL Case tool (Ctrl+9)
      • Go To MHL Case (Ctrl+8)
  • Getting Started
    • Creating your first application
    • Example Projects
  • Legal
    • Disclaimer
    • Licenses
Powered by GitBook
On this page
  • Overview
  • Public Response Purpose
  • Public Response usage example
  • Public Response VI
  • Public Response VTD VI
  • Public Response Typedef
  • Public Response MHL Cases
  • Public Response Folders
  • Response Cases.ctl
  1. Worker APIs

Public Responses

Worker APIs

PreviousCreating Public Requests w/ReplyNextCreating Public Responses

Last updated 10 months ago

Overview

Purpose
Message Type
Icon Glyph
File Prefix

Send message to Caller from Worker

Asynchronous

rsp_

The images below are taken from the example project.

Public Response Purpose

A Public Response is a message that can be sent to a Caller from a Worker, however, the Caller must first to receive the Response message from the Worker.

Public Response usage example

The image below demonstrates the use of a Public Response VI sending a message from a MHL case of Worker B to a MHL case of Worker A. Worker B doesn't know which case of the Caller the Response message will be sent to. It is up to the Caller, when initializing Worker B, to register the Response message, providing the Caller's MHL case that will receive the Response message to Worker B.

Public Response VI

Data in

Message Priority

Show in Debugger?

Public Response VTD VI

Data in

Variant data that was sent along with the Response message.

Data out

The strictly typed data that was sent along with the response message. By default, this is a typedef that has the same filename as the Public Response VI.

Public Response Typedef

Public Response typedefs are created with the same icon and filename as their matching Public Response VI. Their purpose is to provide a custom container (cluster) for the data that will be sent along with the message to the Public Response's registered MHL case of the Caller.

Public Response MHL Cases

The MHL case that will receive a Public Response message exists in the Worker's Caller. A Caller must register to receive a Response message from a subWorker. The image below shows a MHL case in Worker A that will receive a Response message from Worker B. MHL cases that are created to receive a Response message will be added to the Worker's case structure section called --- RESPONSE CASES ---. To convert the data sent with the Response message to its specific data type, a Response VTD (Variant to Data) VI is used at the beginning of every registered Response MHL case.

Public Response Folders

Public Response VTD VIs are added to a Worker's Public API >> Response VTDs folder. Their scope is set to public because they are designed to be used from a Worker's Caller.

Response Cases.ctl

Every time a new Public Response is created with the Public API Builder tool, a Case Label string control will be added automatically to the Worker's Response Cases.ctl typedef. The image below shows all of the Case Label string controls that have been added to a Worker's Response Cases.ctl typedef.

Workers created in Workers 4.0 or before

The wiring shown in the <Initialize> MHL case above is automatically created for you in new Workers created in Workers 5.0. However if you are using Public Responses from a Worker created in Workers 4.0 or before, you will need to manually wire the Response Cases.ctl data into the Worker's Main Data Wire as shown in the image above.

A Public Response VI is required to be wired in-line with a Worker's , as shown in the block diagram image above. The Public Response VI will send a message to the Worker's Caller, IF the Caller has registered to receive the Response message.

Every Public Response VI filename takes the prefix: rsp_ (response). Every Public Response VI icon contains a pink glyph in its bottom-right corner. An example of a Public Response VI is shown below.

Data that will be sent along with the message. By default, this is a that has the same filename as the Public Response VI.

The of the message (default is Normal) can be set to either Low, Normal or High.

When this flag is TRUE, then meta-data about this message will be sent to the .

Every Public Response is created with a VTD VI. This VI is used by a Worker's Caller to convert the data sent with the Response message to its specific data type.

Every Public Response VTD VI filename takes the prefix: rspvtd_ (response variant to data). Every Public Response VTD VI icon contains a pink rectangular glyphin its bottom-right corner. An example of a Public Response VTD VI is shown below.

Public Response VIs created by the are added to a Worker's Local API >> Responses folder. Their scope is set to protected because they are designed to be used only from within the Worker that owns them.

A Public Response requires the name of the Caller's MHL case to be passed into the Worker through the Worker's Initialization Data.ctl. This process occurs when a Worker's Public Response is with the Worker's Caller.

Every new Worker and Worker base class (Workers 5.0 onwards) wires a Worker's Response Cases.ctl from a Worker's Initialization Data.ctl typedef to the Response Cases.ctl contained within the Worker's . Without this transfer of information to the Worker's Main Data Wire, the Public Response VIs won't have the required data to know which of the Caller's MHL cases to send the Public Response messages to.

priority
Workers Debug Server
Public API Builder tool
registered
typedef
Workers Fundamentals
register
Main Data Wire
Main Data Wire
A Public Response is a message that can be sent to a Caller from a Worker
Worker B : Main.vi - Public Response VI example
Worker B : rsp_Return Number.vi
Worker B : rspvtd_Return Number.vi
Worker A : Main.vi - registered Response MHL cases
Public Response folder structure within a Worker
A Worker's Response Cases.ctl, used to register a Worker's Public Responses with a Caller
Transferring a Caller's registered Response MHL Cases into a Worker.
This VI is placed in the registered Public Response MHL Case of the Caller.