12-29-2008 01:35 PM
I got close with this subVI but it does not perform as expected. My logic was to 1st initialized arrays with sequence, then the event structure for many different cases. The object is to read in a 2D .cal file to 2 1D arrays. Cells can be manually changed by typing into the entry box then clicking the load button. Slider determines with cell in the index. Certain sequences of events work i.e.
1) Get cal file
2) move slider
3) type x entry box
4) load x value
Other sequences of events make the VI unresponsive, i.e.
1) type x entry box
2) load x value
Can some kind soul point me to the error of my ways?
Walt Donovan
Solved! Go to Solution.
12-29-2008 01:50 PM
First look only:
You need to wire the 1D arrays across ALL event cases, else they clear.
12-29-2008 02:09 PM
Thanks much. That was an easy solution and one that I missed while trying to debug. Does this code look at all reasonable? I have been studying and studying.... Many hours since I last asked a question on this forum. I have better insight on the workings of LV than last time but any guidance whatsoever is vastly appreciated. There are a few things about this VI that seemed odd to me but were the only way I knew to accomplish the desired tasks. 1) I used indicators, not controls for the two 1D arrays. Did this because it is necessary to load these arrays in full or part using three different methods - from file, manual entry, and the capture button which will poll an analog channel of the DAQ board.
Another thing that seemed strange was to build invisible dummy controls to have indicators attached to the entry controls. I thought that it would be bad practise (maybe not work at all) having loose ended controls in an event case even though they didn't really cause a subsequent event to occur. They just took the number and waited for the "Load" button. Are these methods viable programming practise or just a half-witted way for this programmer to get a job done?
12-29-2008 02:21 PM
A few more comments.
You are doing things way too complicated, here is a quick rewrite.
(Overall, I don't like the mechanics at all. Why can't you just use a 2D array control and enter data directly and leave out everything else?)