LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I count events falling into three categories?

Solved!
Go to solution

Hello everyone,

 

   My name is Sean Cummings. I am very new to Labview and this is my first post on the forum. I work for a testing facility dealing with automotive components. I run test cells and build parts. I recently commissioned a new test cell at our location which came from another one of our facilities. The test cell impacts axles. The Labview program we use to run the cell was created by one of our few programmers. He is extremely busy and works in another facility so I have taken it upon myself to learn more about Labview and try on my own to make improvements to the software. I plan to attend some of the Core Labview classes if I find that I enjoy working with the software (so far i do).

 

   Currently the program is mostly manually controlled. Data paths and controls such as speed are commanded by the operator. There is a 4 second automated cycle in which the Labview VI commands clutches to initate the impact and aquires data from 3 load cells and a speed sensor. Once this cycle is complete the operator must click a button to open a call by reference subvi. The subvi analyzes the impact data and displays a graph as well as several calculated data points. The operator is then required to open an excel spreadsheet and manually enter the data. I created the spreadsheet with conditional formatting to show the operator whether the impact event was within the acceptable range and to track impacts over target, in target range, and under target. Currently each part runs 400 impact cycles and the operator must transfer 6 data points for each impact. In the next couple weeks we will be testing parts going 1640 impact cycles. We need a better solution to make the process more efficient.

 

   My original thought was to have the subvi populate the excel spreadsheet automatically. After several days of trial and error I was able to speak to a programmer from another facility who explained to me that excel was not not a text based software and my methods would not work without the Labview excel toolkit.

 

   I then talked to the engineers within my company and they agreed with me that the excel spreadsheet was not necessary if Labview could track the impact events internally. I then set to work trying to create counters and indicators to track the impact events. For this to work I only need to look at one number. This number is the Total Output Torque from the impact event. I created 3 boolean indicators on the main VI. One for impacts over target, one in range, and one under target. I also created 3 corrosponding indicators to show counts for each. I also need an indicator showing total impact events, and an indicator showing valid impact events (the sum of in range and over target).  I use a control for the target . The range is + or - 5% from target. I have done my best to research and try to do this myself, but I can't quite get it right. I am using while loops to count. I encounter problems with multiple counts for the same event. I would also like to trigger the counters at the same time and not have separate stop commands for each.

 

   For this to be effective I will probably have to make these functions a subvi. I would need them to initiate when the call by reference "analysis" subvi is called and stop when it stops so maybe they can just be part of that subvi.  I need the indicators and control for target to be on the main UI. I also need a button to reset the counts when impact direction and target is changed.

 

   I apologize for any misuse of terminology. I also apoligize if my program is a mess. This is all very new to me and I'm trying to learn as much as possible. Thanks you all in advance for your help.

 

   -Sean-

 

 

0 Kudos
Message 1 of 17
(3,523 Views)

The LabVIEW classes are good, but before doing that, I'd suggest looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

Why do you have 3 loops operating in parallel?  I think you should only have one loop.  Inside of that, determine yoru conditions.  Then have 3 shift registers and update whichever one is appropriate.  If you multiply your value by 100, you can have a single case structure with the cases.   ....95,  95...105, 105.....

0 Kudos
Message 2 of 17
(3,513 Views)

Your VI will not work, because of dataflow issues. The three while loops all spin like crazy millions of times per second, operating on the same data over and over again (since the terminal is before the loops, a later change will not propagate into the loop).

 

All you need is a single loop with the control inside. Use a shift register containing an array of three elements and incremenet the appropriate element depending on the value of the control. Use an event structure to go to the next test.

0 Kudos
Message 3 of 17
(3,511 Views)

Depending on various details, it is not difficult to get LabVIEW to open an Excel Workbook, go to a specified Worksheet, and insert data into the Sheet.  You want to use the Report Generation Toolkit for this, which now comes bundled into Core LabVIEW 2014 (in earlier versions, it was an add-on).

 

I realize that right now you are concentrating on the logic of "getting the data".  Once you have that figured out (I strongly urge you to get used to writing sub-VIs to do basic steps, so that you can "see at a glance" what the program is supposed to do (if you make an Icon for each sub-VI, which could be a simple as a colored box with a name, like "Check Impact", that identifies its function), think about what/how you want to write with Excel.  Of course, if another format works better for you, that's also fine ...

 

BS

0 Kudos
Message 4 of 17
(3,499 Views)
Solution
Accepted by topic author SeanCummings31

Here's a quick draft that would classify an impact and keep counts in a shift register. See if it makes sense to you. Maybe you can re-use some of the ideas in your actual application.

(I assume that results are always positive)

 

(You did not include your typedefs, so I had to disconnect them).

 

 

 

 

Download All
Message 5 of 17
(3,496 Views)

It sounds like your company has some experience with LabVIEW.  Does this mean you have access to a SSP account?  If so, you should look at taking the self paced courses to pick up some of the basics.  You can do that for free and see if you're enjoying it before heading to a class with an instructor.

0 Kudos
Message 6 of 17
(3,478 Views)

Wow! Thank you guys for the quick response and pointing me in the right direction!

 

Altenbach, your example does exactly what I need! 

 

Moving forward I should be able to reference the actual total torque number from the call by reference subvi and have the event structure initiate based on the change of that number correct?

 

I tried something like this already and for some reason when I add a terminal to the terminal pane on the subvi it does not show up on the main vi. I can only imagine this is because the sub vi is "call by reference". The subvi already outputs an indicator to the front panel of the main vi called "total torque". This is inside a case structure so I don't know how to reference it for the subvi which you created.

 

Again, I just want to say I am very thankful I am for the help. I am not here looking for free programming help. I am here asking questions because I truly want to learn. I know I will have to spend a lot more time reading tutorials and practicing basics. This program was just given to me last minute and I'm doing my best. Usually I am very resourceful and can find solutions on my own. This one was just over my head. Thank you.

 

  -Sean-

Download All
Message 7 of 17
(3,474 Views)

 We do not have any Labview programmers at my facility. The program for this test was written by someone at another facility in Canada. He has made the trip down here (Michigan) a couple times to help me, but he is extremely busy writing new tests and he can't spend enough time with me.

 

  He does have more than one license for Labview, but I'm sure he is not supposed to just give me full access to one. I am using a trial version of labview on my personal computer to learn as much as I can in a short period of time. If I determine that Labview programmings is something I really would like to persue then I will discuss the options with my employer.

0 Kudos
Message 8 of 17
(3,468 Views)

Could you repost your VI's saved for LV2013?  I would like to take a look, but I only have 2013 here.



0 Kudos
Message 9 of 17
(3,445 Views)

Fair enough.  If you do end up picking up LabVIEW, it'll come with the SSP and those free self paced courses.

 

You'll find that the forums like helping posters like you.  The more you try to work with your program rather than expect free help, the more people are willing to help.  Welcome to the forums.

0 Kudos
Message 10 of 17
(3,440 Views)