LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

Saving two 1D array help

I am adding picture image and the labview program  vi I am trying to make workable. I am trying to save two array in 1 text file but actually it is coming in single column .1st row current 2nd row voltage. How can I get them on seperate column. Second thing I was trying is to get summation of all the current (i, j=i+1,K=j+1....) and plot the charge count. I have been trying lots of things but unable to find the write way. Any suggestion and help is highly appreciated.

Message 1 of 8
(3,958 Views)

Re: Saving two 1D array help

1.  There are usually End Of Line characters in instrument communications.  You need to remove those using Trime Whitespace.

2.  You need to use a delimiter of some kind.  If you are just saving to a text file, use a tab.

3.  You should open your file before your loop and close it after the loop.  This will eliminate a lot of overhead.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(3,946 Views)

Re: Saving two 1D array help

What's the point of the inner FOR loop? The final result, including the math after the loop, could be calculated from first principles from the scalar value and the value wired to N.

Why would you add 1 to the same value over and over more than 600 times in a row. Wouldn't once be sufficient? (True, the compiler will recognize loop invariant code and ignore the rube goldberg construct, but still.... Don't confuse the next programmer that has to work on this. :D)

Message 3 of 8
(3,924 Views)

Re: Saving two 1D array help

Could you please tell me how  can I add up each incoming current value recorded contuinuously, without defining any sampling no?

Message 4 of 8
(3,724 Views)

Re: Saving two 1D array help

@560092 wrote:

Could you please tell me how  can I add up each incoming current value recorded contuinuously, without defining any sampling no?

Just use a shift register to store your total.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 8
(3,721 Views)

Re: Saving two 1D array help

@560092 wrote:

Could you please tell me how  can I add up each incoming current value recorded contuinuously, without defining any sampling no?

Do you want to sum them, average them, or append them to an evergrowing array? What is a "sampling no"?

Message 6 of 8
(3,692 Views)

Re: Saving two 1D array help

HelloCRossRulz,

Thanks for the picture image. I have tried to modify my vi. Please have a look. I am using seperate vi for sourcing pulse voltage. This vi I am using for  measuring current data also for checking volatge fluctuation from the actual set value. But as of now only able to save current data over time. I also want to modify this for recording voltage fluctuation simultaneously  in a text file.

I have some rough estimation how much charge transfer I need for my process to stop the process. That is the reason I wanted to convert the current collected every 100 ms into no of charge and keep on adding incoming charges. The moment it will reach nearby value i.e. in the order of E+19 or E+20. I want to stop the process. (it usually takes 3 to 6 hour, based on sample size).

Please have a look at the present version. Now because of the 2nd while loop, only charge data is showing loop is not going back for collecting Current value. How do I correct?

Thanks

Message 7 of 8
(3,412 Views)
Solution
Accepted by topic author 560092

Re: Saving two 1D array help

Why the extra loop that will just run forever?  Put the shift register on your outter loop and get rid of that inner loop.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 8
(3,399 Views)