|Download Help (Windows Only)|
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.
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:
|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.|
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.