03-08-2007 10:32 AM
03-09-2007 03:43 AM
Hi Matt,
I've taken a look at your vi and I can spot some problems related to your Data Acquisition code, where you are getting the wiring error.
The wiring error is occuring because you are trying to wire an output which is a 2D array of data to Scalar data controls.
I'm not 100% sure what you are acquiring data from, or which channels on that device. But on the front panel you have selected 'Dev1/Port0' as the physical channel to acquire from - which is a digital port on a DAQ device. The vi's you are using on the block diagram have been set up to acquire analog data?
So, if you are acquiring from analog channels, how many channels are you acquiring from? The 'DAQmx Read.vi' is polymorphic, so from the selector label you can choose how many channels and how many samples you are reading. Currently you have this set to read multiple samples from multiple channels, which is why you have a 2D array of data as your output. If you aren't reading these channels, then reselect from the polymorphic selector and you may get a scalar result out.
Either that or you need to re-think the way you are displaying the data - for instance if it is multiple channels, then perhaps you need multiple controls on the front panel to display this data.
If however you really are acquiring from a digital port, then you need to re-work your DAQmx code so that it uses the appropriate instances of the polymorphic vi's to acquire the data.
The best thing to do would be to look at the examples that ship with LabVIEW to work out your data acquisition away from your main application, so that you can see the data representation you are getting back. Then you can work this into your current app, and then work out the design of your front panel appropriately.
Other than that, the code looks ok.
I hope that helps, let me know if you have any questions.
Regards
Hannah
NIUK & Ireland
03-10-2007 05:38 AM
thanxs for the help, no doubt i will be needing some more for the rest of the system but that was a great start.
cheers Matt