10-22-2006 05:17 PM - edited 10-22-2006 05:17 PM
Message Edited by Maverick83 on 10-22-2006 05:19 PM
10-23-2006 12:44 PM
10-24-2006 05:39 AM
Hi Maverick,
2 Qestions
1) Why don't you use waveforms instead of dbl arrays ?
2) Why do you use the available sample property instead of a 100 constant ?
Kind Regards
10-24-2006 06:44 AM
10-24-2006 07:52 AM
OK
About 2D arrays and waveforms.
Actually a waveform is an array enriched with more information, initial time t0 and sampling time dt.
I prefer waveform because you never know when you need to perform a datalogging or a FFT but at that time you need t0 and dt and having them is better than looking desperately for them in your block diagram.
About your timing choice in the While Loop..
Well generally speaking is better to use a wait until or a wait until milliseconds multiple in order to leave CPU free from the while loop. This is especially true when you are dealing with User Interface. But when you call the HW with a DaqMxRead function the function automatically sleeps until all the samples you want (100 for instance) are available, making sw timing with Wait function pointless.
What you have done is particularly risky because you trust the PC timing, that offer no more than ms precision, when you can have HW timed precision in the order of 50ns.
As you say you are starting with LabView can I suggest you our courses?
http://digital.ni.com/worldwide/italy.nsf/sb/Customer+Education?OpenDocument&node=201399_i
Best Regards
10-25-2006 05:27 AM
10-25-2006 06:00 AM
I'm sure you're gonna love this one
http://zone.ni.com/devzone/cda/tut/p/id/3024
I suggest you to learn this design pattern called "sate machine" very well. You'd probably find it a bit complicated now. But tomorrow when you will need to change something in your Vi you will know that you've done the best choice.
Talking about your vi there is a very big error in the first frame of the flat sequence.
You are waiting the User in the while loop.
In these cases you must use a wait function, otherwise your cpu remains trapped in the loop doing nothing !
Try to check cpu load with and without wait function you will find an amazing difference.
About your measurement application I'm not sure you are going to measure the right temperature, you have to make some experiments and if you don't find a solution use ni.com to search application notes and the forum to find suggestions!
Kind Regards