LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing complex data types between top level webVIs in LabVIEW NXG using JSON

Hi there,

I am currently using LabVIEW NXG Web Module to create a remote user interface for clients to use to view data collected and processed by a LabVIEW 2020 program. My problem is in the frontend alone (at this stage). I have four top level WebVIs which can be moved between with hyperlinks and data must be passed between these VIs for a dynamic display. My issue focuses on the first three VIs.

The navigation works as follows: Open.webvi <-> Main.webvi <-> Sub.webvi

My first pass (Open.webvi <-> Main.webvi) works. The data retrieved in the first page (using Systemlink) returns a string which I pass into the Main.webvi which uses two .gvi subVIs to turn the string into multiple arrays and cluster arrays. I had previously done the data processing and THEN passed the complex data types into Main.webvi however the data never made it into Main despite the .gvi s  passing out the right data. Web NXG has limitations for gtype control display and so I assumed this extended to connector pane data passing and remedied my issue by passing in the simple string and then processing that. This now works.

The next pass (Main -> Sub) doesn't work however. Within Main (which runs in a loop in Open and then contains a loop which waits for user input from Main web page) Sub runs in yet another loop which is only triggered when it receives input from the user. This input is used to sort data into the segments the user wants to see. I've tested the selection process and determined the selection process is working. The data that needs to be passed to Sub is two 1D arrays of clusters. The clusters are .gtype and so as per my working assumption that the lack of front panel support for the controls extends to connector pane data communication I decided to convert my arrays to a cluster which I convert to JSON string and pass into Sub. This doesn't work. I've done a bunch of debugging and determined that the JSON string that the conversion function outputs is successfully unpacked by the code in Sub (this worked by capturing the JSON output and feeding it into Sub as a constant and running Sub in isolation), however as soon as I try and run everything together it (starting at Open -> Main -> Sub) the JSON string is simply not passed through and comes into Sub empty (determined with use of an indicator).

I really have no clue what is wrong - I get no warnings or errors from anything either. I decided to create a simplified version of my issue in NXG to go along with my question, and in a frustrating turn of events the data pass that is meant to emulate Open -> Main (which works in the real program) doesn't work in my simplified program. I am completely stumped and would greatly appreciate any assistance anyone could offer. I've attached a .zip of the simplified program and images of the program too. Thanks in advance!

Izzy

0 Kudos
Message 1 of 1
(907 Views)