I am writing an FPGA application where I acquire data from a unit under test (UUT). The PXI-7842R digitizes 3 groups of signals:
1. an analog voltage monitor
2. 5 digital signals connected to the analog inputs (connector pinout limitation) and converted to Boolean values
3. 11 digital signals connected to digital inputs
That's a total of 1 analog input and 16 digital inputs. I want to show them on the same graph, so I used a mixed signal graph.
To avoid reconfiguring the mixed signal graph every time I open the application, I wrote a subVI to programmatically format the graph. I pass in a reference to the Mixed Signal Graph indicator and try to adjust it to look how I would like. The indicator was built up as a cluster of 1 analog waveform, 2 digital waveform busses of 5 signals, 1 digital waveform bus 3 signals, and 3 individual digital waveforms. The subVI is called inside the Host VI using a case statement controlled by the "First Call" function. Then the Host vi reads out a U32 from the Target-to-Host DMA FIFO, formats the data in the proper order, and bundles everything into a Mixed Signal indicator. When trying to format the graph programmatically I am getting some invalid property errors that seem to depend on state. Unfortunately, the properties documentation seems to be pretty spotty for the errors I'm getting. The attached subVI goes through the following sequence:
1. Configure the shared x-axis and shared properties (IgnoreAttributes, ShowBusseswithLines)
2. Configure the analog plot area Y-scale (top plot, area 0? documentation is spotty on this point)
3. Configure the digital plot area Y-scale (area 1?)
4. Name the digital busses (3 total, should be numbered 0-2).
5. Name the plots
Steps 1-3 complete correctly, but I get an error when trying to set the Active Bus to 0 --> "Error #1077, Invalid Property (Active Bus)".
I tried setting the Active Plot to 1 before configuring the bus, and I get the same error.
But then sometimes if I rerun the Host VI without changing anything, the subVI completes correctly (although the Y-scale area becomes huge and blank). The only way I can remove the errors is to set the for loops to iterate 0 times, let the host VI run a couple of cycles, stop the host VI, remove the 0 constants, and rerun. Then there are no property errors.
I then tried creating an Mixed Signal constant with the correct sequence of empty plots and used it to set the MixedGraph::Value property at the beginning of the subVI. Now Error #1077 occurs at the Active Plot node before the Active Bus node. The trick before about setting the iteration constants to 0 doesn't help when the value property gets an initial value.
Here are my questions:
1. Does the ActivePlotArea property need to be set to use ActivePlots or ActiveBusses, or is that property only for sizing and moving the plot areas?
2. Does the ActiveBus property need ActivePlot to be set first? i.e., if I have ActivePlot=0 (for the analog plot), will the ActiveBus property always fail?
3. What else is required for the ActiveBus property call to function?
4. Why does the subVI fail the first time but succeed on subsequent calls without being initialized yet fails every time after being initialized (unless for loops are set to 0 and subVI finishes once)?
5. Since I am showing a plot legend, I don't want the digital signal names to show up again in the Y-scale area. How do I hide the names but allow the plot area to extend all the way to the plot legend instead of leaving a huge area of wasted white space?