05-12-2009 10:30 AM
05-13-2009 06:07 PM - edited 05-13-2009 06:08 PM
Tino
I had some extra time today so I went through your code and made some changes that should fix your problems make a few improvements.
1. The primary reason your data getting all of the bad values is that you had the DAQmx Create Task, Start Task and clear Task inside of your main loop. So evey cycle you were deleting your old task and creating a new one. Instead You should create and start the task before the loop, and clear the task and report errors after the loop finishes. You want to report the error outside the loop otherwise if there is an error you willbe stuck in a loop until your timer runs out. I also added an error status check in the loop, so if there is an error it will exit the loop then report the error.
2. You had a large structe using the split signals and several dynamic data conversions that was overkill. Based on the output to the front panel it looks like the purpose was to tellif the value was greater than zero for a given signal. I use 1 single greater than zero node then use an array of booleans. I had to make the indicators quite large so they would match the graph but the interface is very simple. It is not exactly equivilant but I think it achives the same goal with alot less code.
3. I made a few organizational changes to the front panel that make the UI a little easier to use.
4. Lastly, once you set all of the default settings (CJC,Therm type) like you want go to Edit>>Make current values default so everytime you open this program it will allready be initialized.
Let me know if you have any questions.
-Hunter
05-14-2009 10:14 AM
05-14-2009 01:39 PM
05-15-2009 04:03 PM - edited 05-15-2009 04:03 PM
Go to the example Finder (Help>>Find Examples) and do a search for select signals and open up the select signals example VI.