Jump to content

Help with Arrays


Recommended Posts

Hi, sorry I know that this question is probably very basic but I am new to LabVIEW and still figuring it all out. How would I go about building an algorithm tha will take the values from a 2-D array and integrate them (I need to integrate current with respect to time). Should I use a for loop or while loop?

Link to comment

QUOTE (sbev001 @ Jun 1 2009, 10:26 AM)

Hi, sorry I know that this question is probably very basic but I am new to LabVIEW and still figuring it all out. How would I go about building an algorithm tha will take the values from a 2-D array and integrate them (I need to integrate current with respect to time). Should I use a for loop or while loop?

My guess would be a for loop, unless you want to stop at a particular value or something special like that. You need to know the format of the 2d array as well. If you put a 2d array into a for loop it will automatically index on each row. If you have a column for time and a column for value it you may not even need a for loop at all. Look at the Index array function to get all the data from a particular column (assuming you have the data organized like this). There's a palette for doing integration in the Mathematics palette you can look at (but you may not have access to this palette depending on the type of LabVIEW package you have.

Spend some time and poke around. Ctrl-H gives a pop-up help and usually more help if you click on the link in the pop-up help.

Bruce

Link to comment

QUOTE (sbev001 @ Jun 2 2009, 12:26 AM)

Hi, sorry I know that this question is probably very basic but I am new to LabVIEW and still figuring it all out. How would I go about building an algorithm tha will take the values from a 2-D array and integrate them (I need to integrate current with respect to time). Should I use a for loop or while loop?

this is a simple example on how you can do an integrate from values within a 2d array, assume that 1st row is timming data, 2nd row is data. the dt is constant in this case so i dont need a loop structure.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.