04-19-2020 04:20 PM
@altenbach wrote:
- You can convert your data to a array of points and use "interpolate array" to find the Y for an arbitrary x-value (make sure the x values are non-descending, of course)
Here's how that could look like.
04-19-2020 04:24 PM - edited 04-19-2020 04:32 PM
@eallder wrote:
I got the wires to work to the Lumens per Ohm file express, but the file is only writing data for one x and one y value (the final one),
We cannot debug images, especially when express VIs and dynamic data are involved. These are completely opaque! For example we have no idea how the "to dynamic data" and express VIs are configured. Also, it makes no sense to create a 2D array of 1D CDB and DBL arrays.
Did you see my solutions above?
04-19-2020 04:36 PM
I think it would be better to have an Excel file of all the slopes and lumen values like I have for the Lumens vs. Ohms....then I can just look up the value I want to get. Also, there is no way that the slope at 6 Lumens is 93.5163 as shown on your VI screenshot. Something isn't right.
04-19-2020 04:45 PM - edited 04-19-2020 04:46 PM
It's at 4 lumes and I did not check your original formula, just blindly used your math. Here's zoomed into the sensitivity graph:
(Make sure to check all units, etc.)
04-19-2020 04:51 PM - edited 04-19-2020 04:51 PM
@eallder wrote:
I think it would be better to have an Excel file of all the slopes and lumen values like I have for the Lumens vs. Ohms....
USe my code and give the file a *.txt extension. Later right-click the file...open with ... excel. Excel will know what to do.
(If you want a native excel file output, form the 2D array correctly and make sure the "toDDT" and express VIs are configured correctly. I can't help you with that because I don't even have excel installed)
04-19-2020 04:51 PM
Point taken. Here is the VI....it's essentially exactly the same as the one you showed.
04-19-2020 04:56 PM
You did not attach the subVI. Of course your file only contains resistance and lumens. It does not contain any derivative (I thought that's the "sensitivity")
04-19-2020 05:19 PM
The only subVI is the one I made out of your code for running the calculation involving the sine function. The Lumens vs Ohms write-to-file (top one) seems to be working fine. It's the other one I'm having issues with. I'm running the output from the derivative calculations (sensitivity) to it.
04-19-2020 05:20 PM
I wasn't aware that the subVI wouldn't automatically attach when I attached the VI.
04-19-2020 05:39 PM - edited 04-19-2020 05:45 PM
As I said, I cannot test because I don't have excel, but if you look at the 2D array right before you convert to dynamic data, all data is there as two rows. Are you sure you are later opening the correct file as configured in the express VI? Maybe you are opening a similarly named stale file from earlier instead? Also be aware that if the file is already open in excel, LabVIEW will not be able to write to it.
Your lumens are between about 0 and 8, so why are you entering 50 to get the interpolated sensitivity value? That's way outside your range. Maybe you copied the B control. Make sure to redefine the default value to something reasonable before saving (right-click...data operations...make current value default... save VI).
Of course for the sensitivity, you are only sending a single scalar to the file. Build a 2D array from the same 1D array inputs currently also wired into the "index and bundle cluster array"). Just branch the wire. Alternatively, create a single file with three columns.