Jump to content
Sign in to follow this  
Keith Chambers

Very Frustrated, don't laugh @ me :(

Recommended Posts

Hi Guys,

I sure hope one of you can help me.

I'm a university student and I am really new to labview (6.1).

I have a current source (input) and powermeter (output) both connected via GPIB. I've read the manual for them both and most of the labview manual also.

I set up a simple laview goes like this:

Sequence 1

write a set to initialize the 2 instruments: works fine.

Sequence 2

I get the start, stop and stepsize values for the current source in milliAmps (e.g. 0mA-20mA, stepsize=.5mA) and use this to set up a while loop, basically:

(while start+(#steps x stepsize) < stop, run loop)

LOOP: inside this loop I have three sequences,

1) right the current (mA) value to the current source,

2) read the actual current value from the current source, and

3) read the power reading from the powermeter

These last two are wired to the edge of the loop as SGL values.

This all seems to work just fine.

Problem is I want to take these two paired outputs (2 per loop cycle) and output them as a set of paired data I can load into Excel.

I have tried the build array (inside and outside the loop) and tried the build cluster from these wires etc.. I've changed indexing on/off, basically everything I can think of.

I just want to take these two output from each loop cycle and make them a 2xn array where n is the number of loops. Everything I try just gives me the last set of data (last current, last power) and that's it. I know there has to be a simple way to do this. Please help me. I want to do it the simplest way. I want to add it to the array as I go, one pair of data at a time. I don't care if it's in an array, a cluster or whatever. Just want the data out.

Lastly, after the loop in sequence 2, I have

Sequence 3

turn off current source, etc..

I am attaching the VI so you can see what I'm talking about. Sorry this is so long. I hope I gave the info needed for you to help me.

Thanks so much. Great forum.

Sincerely,

Keith Chambers

P.S. I'm very open to critisism and advice as I am REALLY new at this.

Sorry I have to ask this question; I'm sure I'll feel stupid when I get the answer, but I've look and just don't see it and tried it everyway I can think of so please, please help me if you can!

Download File:post-10-1082844130.zip

Share this post


Link to post
Share on other sites
Problem is I want to take these two paired outputs (2 per loop cycle) and output them as a set of paired data I can load into Excel. 

I have tried the build array (inside and outside the loop) and tried the build cluster from these wires etc.. I've changed indexing on/off, basically everything I can think of. 

I just want to take these two output from each loop cycle and make them a 2xn array where n is the number of loops.  Everything I try just gives me the last set of data (last current, last power) and that's it.  I know there has to be a simple way to do this.  Please help me.  I want to do it the simplest way.  I want to add it to the array as I go, one pair of data at a time.  I don't care if it's in an array, a cluster or whatever.  Just want the data out.

Well, the key is that you need a 2D array of data to feed into the spreadsheet write function. I've attached an image that shows you the solution. Hopefully you can grow back most of the hairs you pulled out. :P

As far as general coding practice, there is much that needs improvement (sequence structures... ouch!). When I have more time I will upload an improved version so you can see another approach.

post-10-1082866684.gif?width=400

Share this post


Link to post
Share on other sites

Michael,

Thanks so much the helpful and fast reply. It's about 12:00 midnight here (Louisisana) and I just left the lab. I'll be back at it tomorrow and I'll implement your suggestion.

:yes: :worship:

Thanks again!

~Keith

Share this post


Link to post
Share on other sites

Dear Michael,

I changed it per your instructions. Works as expected.

I would have msgd sooner but I still have a number of "issues" getting the data and instruments synced and measuring in the right range.

You're probably laughing about how bad that coding was! Some was inherited and the rest bootstrapped. My Professor keeps telling me to do it "Manually" for now.

Can you suggest any books and other sources to help me learn this (labview) faster?

And of course I'd love all the critisms/suggestions you or any of the others here on the board would be kind of enough to make.

But in the mean time, I think I can make it work well enough to compete with the "manual" option (now that it's saving data ;) , so...

.... Thanks again! I really appreciate it.

Keith Chambers

Share this post


Link to post
Share on other sites

Dear Keith,

I think the subject of good wiring rules is already well documented in all the forums but to my disappointment still not enough known (just got an instrument driver, Instrument price ~15'000$, and the code makes me cry!).

- A good book is "LabVIEW Grphical Programming" from Gary W. Johnson and Richard Jennings, Mc Graw Hill books

- Also good resources are the LTR (www.ltrpub.com) especially Volume 7, Number 1 and 2: main Topic "Rules to Wire By". a list of 44 rules of things to do and not to do in LV.

- NI site to go further:

http://digital.ni.com/public.nsf/3efedde43...07?OpenDocument

Didier

Share this post


Link to post
Share on other sites

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.

Sign in to follow this  

×
×
  • Create New...

Important Information

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