06-18-2013 08:21 AM
Sorry for what may seem to be a fundamental question: I want to specify where an Analog channel ends up in the data file, column wise. Right now I'm dealing with 4 channels, 0,1,2,3 and the data file acquires them in columns from left to right, 0,1,2,3.
I want to be able to switch 2 and 3 as they are written to the file, using a control on my FP. So..0,1,3,2. I'm using "write to measurements" and my signals are voltages. Any ideas?
Solved! Go to Solution.
06-18-2013 08:40 AM - edited 06-18-2013 08:42 AM
If you have three separate waveforms, you can combine them using Build Array as follows:
If you acquire all waveforms as an N-dimension array (i.e. from the same analogue input task) you can index the array and proceed as above.
Edit - point being, it's the order in which the array of waveforms passed to Write to Measurement File is built that determines the order in which they'll be saved in the output.
06-18-2013 08:47 AM
where would I implement that in my code? Right before they're sent to the writetomeasurements.vi?
06-18-2013 09:04 AM
Anywhere between generating the waveforms and saving them to the LVM file would do, seeing as elsewhere you search your waveform array for the channels you want to work with and the order is not important.
06-18-2013 09:18 AM
Another lesson learned. I'll try this! Thanks!
06-18-2013 09:29 AM
A couple of other points from a quick look at your code:
- Your DAQ initialisation is inside the while loop. You only need to set this up once, outside the while loop.
- Hide labels on the front panel rather than making them blank. This way you can still read them on the block diagram.
- Wean yourself off dynamic data as soon as you can. There's an unnecessary convert to dynamic data type and build XY plot. You can do the same with the arrays of doubles, bundling into a cluster and then wiring to an XY graph.
- Be careful of code creep. You've got a relatively simple VI which spans about eight screens on the block diagram. This makes following code a little difficult. Using a few simple techniques, such as using sub VIs and/or a different system architecture, you can do the same in a manner that's far easier to follow.
Don't worry about the last point - you'll get there in the future 🙂
06-18-2013 09:55 AM
Thank you for the pointers, I've only been doing this for a 2-3 months but these forums are giving me incredible insight!
06-27-2013 12:59 PM
How exactly do I use a non-dynamic data type for my waveforms?
06-30-2013 09:25 PM
Hi glskinner,
You can use a cluster instead of a dynamic data type. Please take a look at the following document and it should show you what you can do to build a waveform out of an array.
Using the Waveform Data Type in LabVIEW