Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Handling a Data Set and Transferring Data to the Next Process

NI InsightCM™ SDK Help

Edition Date: July 2017

Part Number: 375191C-01

»View Product Info
Download Help (Windows Only)

Parent Topic: Allowing Data to Flow between Processes in a Specific Order

To handle data sets as part of the Dataflow Script, processes must contain code to evaluate and handle ProcessDataFlowBlock messages, which the Dataflow Script API uses to transfer data sets from one process to the next.

What to Use

  • Parse Dataflow Block VI
  • Get Next Dataflow Process VI

What to Do

In the process VI you added to the Dataflow Script, create the following block diagram to handle a ProcessDataFlowBlock message, and then transfer the data set to the next process. Customize the gray sections for your unique programming goals.

Convert the data set from the previous process, which the Dataflow Script API stores as variant data, to its original format as a cluster with specific elements.
The message-handling case must be the exact name of the ProcessDataFlowBlock message.
Evaluate whether the data set contains the type of data the process requires. In this example, the code compares the name of the data group that produced the data set to an array of data group names that produce the appropriate type of data. For example, the array might contain only data groups that produce waveforms. You can define criteria like this in the Initialize case of the process and bundle it into the process configuration cluster for use whenever the process handles this type of message.
Create process-specific code that operates on the data set. This code might manipulate, analyze, or log the data, and then bundle it back into the original, required format. The format is a LabVIEW cluster with the following contents:
  • DataGroup—A scalar string that specifies the name of the data group whose channels produced the data. This name is part of the device configuration.
  • Waveforms—An array of the waveforms acquired from channels in the data group. Note that the waveforms are stored as data value references, meaning you must use an In Place Element Structure to access the waveform data. For more information, refer to Reading and Writing Waveforms in Dataflow Script.
  • Map—A point value map whose name is the data group name and that contains various properties related to the acquisition, as well as any single-point measurements. The map contains values from the time when a process sent the original data set to the first process in the Dataflow Script.
To transfer the data set to the message queue for the next process in the Dataflow Script, call the GetNextProcess Module VI and pass the data cluster to it. The Dataflow Script API looks up which process is next in order based on the value of the process name input. If the current process is the final process in Dataflow Script, the API closes references to the data and does not send a message.

Tips and Troubleshooting

  • To add a process to the Dataflow Script, initialization code must first set the process name within the ordered list of processes.
  • Ensure that processes that receive a ProcessDataFlowBlock messages always call the GetNextProcessModule VI. Otherwise, the CompactRIO device might run out of memory.

Examples

In the NI InsightCM SDK reference code, refer to IntializeDFScript.vi in the labview\vi.lib\addons\InsightCM\Devices\Shared\Application directory for an example of adding processes to the Dataflow Script.

Related Information

Setting the Processes in the Dataflow Script

Sending a Data Set to the First Process in the Dataflow Script


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit