From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logic to save as excel

Hello Guys,

I am working on one project and i am stucked with saving excel 

where i am working on DAQ project for 8 testing machine and data is saved in excel for every test and for every test we have order number

right now i can save excel  

Problem is saving ...

All Testing is running parallel and for different testing we have different order number and i want to save excel in the name of test order number.

Machine1 = Test order N0. is 12345 data saved in 1st column

Machine2 = Test order N0. is 12344 data saved in 2nd column

Machine3 = Test order N0. is 12345 data saved in 3rd column

Machine4 = Test order N0. is 12348 data saved in 4th column

Machine5 = Test order N0. is 12845 data saved in 5th column 

Machine6 = Test order N0. is 33345 data saved in 6th column

Machine7 = Test order N0. is 22345 data saved in 7th column

Machine8 = Test order N0. is 33345 data saved in 8th column

 

As u can see above for different test some times we have different test order number or some times same test order number

 

Some times the conditions are different may be all test orders numbers are unique numbers or all test order numbers are same.

CONDITIONS

1. If i want to save machine1 and machine1 test order number is different than other 7 machine test order number and i need to save excel with only first column and remaining column should be empty.

2. if machine1, machine3 and machine5 has same test order number so i want to save excel with only 1st, 3rd and 5th column data and remaining 2nd, 4th, 6th, 7th and 8th column should be zero and all machine2, 4, 6, 7 and 8 datas should saved in respective test order number.

 

so Please help me to solve this problem 

Looking forward for your support 

have a nice day 

 

Kind Regards

Vinay

(vinaygowdamech5@gmail.com) 

 

 

0 Kudos
Message 1 of 13
(2,740 Views)
0 Kudos
Message 2 of 13
(2,717 Views)

RSTLV where are you?

 

Vinay,  where is the attempt that you have a problem with?

 

What error occurs? When? What does your code produce in the file?  What is missing from the mythical file? 

 

So, I did ask my actual 8 ball.   Yes, I do consult my 8-Ball ... It is a physical thing without simulation abstraction 

 

 

It reported " It is decidedly so"

 

So, that clears everything up.

 

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 13
(2,716 Views)

I'm not sure what you want.  If you are only doing one round of tests, I interpreted your query as wanting the following (for the data you presented), where "Result" is the result of the test:

Tests.png

Is this what you want?  What if there are multiple rounds of tests?  Note that you can easily save a "blank" entry if this is the format you desire ...

 

Bob Schor

Message 4 of 13
(2,710 Views)

Hello Bob_Schor,

your understanding is right and thanks for replay

I have attached VI which will give some more clear picture for you.

I have done for three machine saving excel (means not exactly saveing excel but only logic if I crack this logic saving part is easy) and its working fine now but is there any other way to do this for 8 machine excel save logic 

means what ever the test order number whould be the program has to compare the test order numbers among 8machinne test order number and if it found any test is running with similar numbers the excel has to save first in tat number and remaining test has to save under with respective Test order number.

 

please replay back for any clarification

have a nice day

 

Kind regards

vinay  

 

0 Kudos
Message 5 of 13
(2,656 Views)

Dear Vinay,

     My first advice is to "throw away that picture".  You still haven't answered my question about whether you are doing one test, or many tests, but that doesn't matter, really.  The picture that you should pay attention to is a combination of the table you made (showing the 8 machines and the tests each did, but not the results) and the (Excel, but that doesn't matter, either) table that I made.

 

     How did I make my table?  I started with Machine 1, and its test.  I wrote down the Test (which I know is unique, because it's the First One), and made an entry in Machine 1's column.  I also "mark" Machine 1 as "done" (I can do that in a variety of ways).

     Now, I want to check each (other) machine to see if they have the same test.  If No, I write a "blank entry", and if Yes, I write the Result (and mark that Machine as "Done", also).  Since I'm doing this in order, everything lines up and I have written Line 1.

     Now I'm ready for Line 2.  I again go Machine to Machine.  If the Machine is "Done" (like Machine 1), it's a Blank Entry.  When I find the first Machine that isn't "Done", I put its Result in its Column and its Test in the Test Column (just like I did with Machine 1).  Now I process the remaining Machines, looking for duplicate Tests (and either writing "blanks" or Test Results, marking those Machines as Done).

     I keep doing this, writing more lines as the number of Machines that haven't been entered keeps shrinking.  When there are no more Machines to be Done, I'm finished!

 

     Try this with your data, and you'll see how it work.  It's basically a loop with three steps:

  1. Skip over "previously-done" Machines until you find the first "undone" on.
  2. Save Test Number of this Machine.  Mark Machine as Done.
  3. Do remaining Machines, checking if their Test matches the Test Number.

 

     Many algorithms (in LabVIEW and other computer languages) fit the pattern of "Do the following over and over until you are done".  If each time you loop, the problem gets smaller (as this does), you know it will finish.  Many times, you can state what to do simply (as we did), maybe having to remember a little bit each loop (as we did).

 

     There are a number of "loops" here (key "loop" words are "until", "while", "do".

 

     Do a Pencil/Paper run through your data example, then try it in LabVIEW.  

 

Bob Schor

0 Kudos
Message 6 of 13
(2,642 Views)

Hello Mr Bob Schor,

The test is running many time continuously all day 

And we are doing 10 test for every samples and i want to save the excel with test order number as show in the excel sheet bellow 

protocol.JPG

 

The test order number i will specify in the front panel of program at every block of test inputs at front panel as string input  

 

and test is running parallel by different people

for example if person 1 is running test M1,M3,M5 under 12345 test order number and the same time person 2 running M2,M4,M6 under 112233 test order number and person 3 is running M7 and M8 under 223344 test order number.

when all test is completed the person will click save button and M1,M3,M5 test has save under 12345 test order number making remainig 5 test to zero in excel and M2,M4,M6 test under 112233 test order number making remaining test to zero at excel and M7, M8 test under 223344 test order number making other test to zero at excel 

 

hope you understand

let me know for any clarification

 

Thanks 

vinay 

 

0 Kudos
Message 7 of 13
(2,625 Views)

@Vinaygowda wrote:

Hello Mr Bob Schor,

The test is running many time continuously all day 

And we are doing 10 test for every samples and i want to save the excel with test order number as show in the excel sheet bellow 

protocol.JPG

 

The test order number i will specify in the front panel of program at every block of test inputs at front panel as string input  

 

and test is running parallel by different people

for example if person 1 is running test M1,M3,M5 under 12345 test order number and the same time person 2 running M2,M4,M6 under 112233 test order number and person 3 is running M7 and M8 under 223344 test order number.

when all test is completed the person will click save button and M1,M3,M5 test has save under 12345 test order number making remainig 5 test to zero in excel and M2,M4,M6 test under 112233 test order number making remaining test to zero at excel and M7, M8 test under 223344 test order number making other test to zero at excel  


And the answer is -- no, I do not understand at all.  This seems to be completely different from the problem you posed earlier.

 

Again, forget about Excel.  [I'm going to suggest that, in fact, you really forget about Excel, but that's a different discussion ...].  As I see it, you have the following things to keep straight:

  • Machines, numbered 1-8.  There seem to be 8 of them, but this number might change.
  • Tests, each with a unique (I hope) number.  There are who-knows-how-many-of-them.  It is unclear if every Machine will be subjected to every Test.  It is not clear if any test will be run more than once (not counting "repetitions", next point.
  • Repetitions.  In this Post, you seem to show a Test (unnumbered, so how do we know which test?) begin run multiple (10) times.  Is this true for all tests?  Do you want to collect the individual results?  Are all the Tests in the series run at the same time, by the same Tester, under the same conditions?
  • Tester.  Different people run different tests.  Is this important?  Does a Test get run (see Repetitions) by two or more people regularly?
  • Time.  Are all the Tests run more-or-less at the same time?  Is Time important, i.e. does it matter if Machine 1 does Test A then Test B, while Machine 2 does Test B then Test A?  Should the Time of the Test be noted?

One thing in your original Post and in the just-preceding one is the desire to group Machines and Tests together (but the preceding Post seems to group Machines and Repetitions of an unspecified Test together, with none of the "blanks" that seemed important in the Original Post).

 

I'm beginning to think that you should not worry, at the present, with the "Final Grand Format", but concentrate on getting all of the Test Data saved, with sufficient Identifiers that someone skilled at bringing a collection of individual Test Results into a DataBase and then designing Queries and Reports to provide the kind of (complex? Query-based?) presentations and analyses that you seem to want but haven't been able to clearly specify.

 

Bob Schor

0 Kudos
Message 8 of 13
(2,617 Views)

Dear Bob_Schor,

I think I am only confusing you adding more questions to you

ok forget all thing discussed earlier

I Drafting same question but in simpler way as bellow point

1. I have 8 individual string

2. The string may be any thing (word or number) as show bellow

      1=ABC1           5= CACC

      2=ABB1            6=ABC1

      3=AAB3            7=FD12

      4=BBCD           8=ABB1 

3. I need to compare the string within 8 string to check which are all identical and which are all same

4. As shown above 1,6 & 2,8 strings are same I need output as bellow

     ABC1 = 1,6

     ABB1 = 2,8

     AAB3 = 3

     BBCD = 4

     CACC = 5

     FD12 = 7

5. So we will get 255 combinations as I attached excel

6. we can achieve this by logical gate but is there any simpler way to do this

 

looking forward for your support

have a nice day

 

Thanks

vinay

 

0 Kudos
Message 9 of 13
(2,586 Views)

In my first Reply to you, I showed you what I thought you wanted in Excel (for a single set of tests for your 8 machines), and in my second Reply, I told you how I did this, simply by iterating through the 8 test/machine pairs, writing a new line for every unique test ID until all 8 test/machine pairs have been written (it will take from 1 to 8 rows in the Spreadsheet, depending on how unique or duplicative the tests are).  In other words, the While loop to output the entire test set will loop at most 8 times (if every Machine does a different Test).  Extremely simple logic.

 

I do not intend to write this code for you.  You write the code (if you can't, then you need to hire someone who knows LabVIEW, or you need to invent the time to learn it yourself).  If you get stuck, post your code (attach all relevant VIs -- if you are using LabVIEW Project, then compress the Folder holding the Project and its VIs and attach the resulting .ZIP file).

 

Bob Schor

 

 

0 Kudos
Message 10 of 13
(2,580 Views)