02-20-2013 07:40 AM
Hello,
i have some troubles reading a in DLL created spreadsheet in LabVIEW. The DLL is written in C++.
I'll quickly dexcribe what the VI in the screenshots are doing:
For DLL_INIT=false the VI first measures some values (LabVIEW) and exports them into a initialization-DLL.
The DLL takes these values and does some calculation und then writes the measured values and the new calculated values into a csv-file called "filtered_values" and a file "filtered_values_complete".
so i have two files like this after initialization:
1.0000000000; 1.0000000000; 18.8991610737; -3.2940000000; 0.0060000000; 0.9000000000; 6.5806287097; -3.2940000000; 1.0000000000; 0.0000000000; 1.0000000000; 0.0000000000;
So from now on DLL_INIT = true.
For calculation the next step i read the "filtered_values"-file (LabVIEW), calculate the new values and write them back in filtered_values(DLL)
And in the "filtered_values_complete"-file i'll allways read the Input of the DLL first, so that i can check afterwards, if the DLL got the rigth values from the step before and then add the calculated values.
For i>0 the initialization has been done:
- the VI reads the spreadsheet "filtered_values" and decomposits the 1-D array into its single values
- The Last seven Values of the spreadsheet were exported into the dll plus five new measured values.
- This DLL does again some calculation
- then it overwrites the "filtered_values"-file and adds a new line to the "filtered_values_complete"
This migth be a bit confusion so a quick example, afer five steps it loooks like this:
filtered_values:
5.0625000000; 1.0000000000; 18.9300200447; -3.2870000000; 9.7320000000; 0.8997597592; 5.9159054233; -2.6533532901; 1.0000000400; 0.0000000000; 0.8078703403; 0.0000000000;
filtered_values_complete:
1.0000000000; 1.0000000000; 18.8991610737; -3.2940000000; 0.0060000000; 0.9000000000; 6.5806287097; -3.2940000000; 1.0000000000; 0.0000000000; 1.0000000000; 0.0000000000;
2.0625000000; 1.0000000000; 18.8330081064; -3.2940000000; 9.7270000000; 0.9000000000; 6.5806287097; -3.2940000000; 1.0000000000; 0.0000000000; 1.0000000000; 0.0000000000;
2.0625000000; 1.0000000000; 18.8330081064; -3.2940000000; 9.7270000000; 0.8999399568; 6.4077416273; -3.1451829134; 1.0000000100; 0.0000000000; 0.9480589053; 0.0000000000;
3.0625000000; 1.0000000000; 18.7932988441; -3.2870000000; 9.7280000000; 0.8999399568; 6.4077416273; -3.1451829134; 1.0000000100; 0.0000000000; 0.9480589053; 0.0000000000;
3.0625000000; 1.0000000000; 18.7932988441; -3.2870000000; 9.7280000000; 0.8998799074; 6.2394046705; -2.9768465052; 1.0000000200; 0.0000000000; 0.8988158138; 0.0000000000;
4.0625000000; 1.0000000000; 19.0445703499; -3.2870000000; 9.7320000000; 0.8998799074; 6.2394046705; -2.9768465052; 1.0000000200; 0.0000000000; 0.8988158138; 0.0000000000;
4.0625000000; 1.0000000000; 19.0445703499; -3.2870000000; 9.7320000000; 0.8998198333; 6.0754981785; -2.8129479844; 1.0000000300; 0.0000000000; 0.8521305805; 0.0000000000;
5.0625000000; 1.0000000000; 18.9300200447; -3.2870000000; 9.7320000000; 0.8998198333; 6.0754981785; -2.8129479844; 1.0000000300; 0.0000000000; 0.8521305805; 0.0000000000;
5.0625000000; 1.0000000000; 18.9300200447; -3.2870000000; 9.7320000000; 0.8997597592; 5.9159054233; -2.6533532901; 1.0000000400; 0.0000000000; 0.8078703403; 0.0000000000;
So thats pretty much what the VI does and this works fine until some point when the VI just doesnt read anymore the spreadsheet and x =! y? turns to true.
Most times it happens when the csv-file has about 1200 lines
Does anybody know why this happens?
Best Regards
Stefan
Solved! Go to Solution.
02-20-2013 08:06 AM
Why do you need a DLL to write to a *.csv file?
02-20-2013 08:12 AM
Hi,
i dont need the DLL to write to a file, i need it because the algorithm which does the calculation of the new values, which yes are later written back to the csv-filve, is written in c++ and way to complex to implement it in labview...
br
stefan
02-25-2013 04:13 AM
Hi,
figured out, that the error occurs somewhere completely else; the thread can be closed
br
stefan