02-19-2009 08:47 PM
Hi guys,
I am trying to modify a program at work with LabVIEW, but I am only a beginner at it so I am having a few problems. Basically, it is a data acquisition program that gets it data from accelerometors. The data is read using the AI read function, output to an array and then plotted onto a waveform chart. I am trying to modify the program so that the data gets plotted on three seperate charts instead of one, becuase it was very hard to read before, with 25 channels on it. I thought I could do this by using an "array subset" function to split the 25 channels into 5,15,5 channels onto three seperate charts. For some reason this isn't really working too well, and I'm not really sure how to try and debug it. I have a background in C and MatLab and I know how to use those debuggers, but I am definitely struggling with LabVIEW. Could anyone tell me why my program isn't working or at least help me debug it somehow.
I have attached the program. The modifications that I have made are in the top right corner - the addition of the three "array subset" functions.
02-19-2009 10:23 PM
I can't test the code because I can't take data with this PC, but I'm pretty sure the problem is with your array indices -- the numbers are right, just hooked up to the wrong dimension.
Try this out.
02-19-2009 10:59 PM
DarkMarc uses LabVIEW 8.0, so he won't be able to open your 8.6 attachment.
If th indices are supposed to be switched, it might be easier to move the "transpose" operation elsewhere instead.
02-19-2009 11:03 PM
Yeah thats right I just checked, and I can't open the file because it's 8.6 😞 Although I can have a look at it when i get home because i have 8.6 at home.
I just realised that I think I may have done it wrong in my original file. I thought that array was 1 dimensional for some reason, but actually I think it's 2 dimensional so maybe thats why it's not working. However, I only really need to plot the latest row (updated 500 times a second) so perhaps I can just convert it to a 1 dimensional array. What do you guys think?
02-19-2009 11:07 PM
Am I correct in saying that the original array that is outputted from AI read has 25 columns, and grows by 500 rows every second?
02-20-2009 03:08 PM
DarkMarc86,
If I understand your program correctly, the values coming out of AI Read is a 2D array of doubles. One easy to check what type of data type is coming out is to click on the wire and press Ctrl + H to pull up the context help window. Also, a wire that is double lined is an array. The data type is determined by the color of the wire itself. For example, the color pink represents a string. Then you are using the for loop to extract each element in the array and performing some functions in them.
Since the scan rate is set to 500, you are getting 500 samples a second. So your conclusions of having 25 columns which grow by 500 rows in the original array every second would be correct. Since you transpose this array, it looks like 25 rows with 500 columns in them.
Hope this helps!
02-22-2009 05:01 PM
02-22-2009 05:59 PM
02-22-2009 06:01 PM
02-22-2009 06:02 PM - edited 02-22-2009 06:04 PM