LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simplify VI that is recording a rate but is currently using too many shift registers

Solved!
Go to solution

I have a VI that was made by the director of scary movie, so beware, this VI is a nightmare!...or at least to me it is.

 

Background:

I have 20 pans and I have a water level sensor that outputs a voltage from 0-5 Volts. By knowing the volume of the pans, I calibrated the output to be in gallons. The real output I need is a volumetric flux, which is gallons per minute per square foot. We are currently achiving this by using a VI that a summer intern made (See attached). It works well, but it is just so messy and hard to clean up and expand. The plan is to have 100 pans total and I don't want to copy paste this code 5 more times!

 

Questions:

-How can I collect a rate  differently? If you notice on the calibration subvi attachement, the rate is calculated manually knowing how fast the loop is going in the main VI. I don't know if this is the best way

-Can I get rid of the shift registers some how?

-Is there a way for me to combine the  calibration subVIs so that I don't have to have one subvi for each channel?

 

Thanks in advanced! 

Download All
0 Kudos
Message 1 of 20
(2,983 Views)

@Pepi123 wrote:

I have a VI that was made by the director of scary movie, so beware, this VI is a nightmare!...or at least to me it is.

 

Background:

I have 20 pans and I have a water level sensor that outputs a voltage from 0-5 Volts. By knowing the volume of the pans, I calibrated the output to be in gallons. The real output I need is a volumetric flux, which is gallons per minute per square foot. We are currently achiving this by using a VI that a summer intern made (See attached). It works well, but it is just so messy and hard to clean up and expand. The plan is to have 100 pans total and I don't want to copy paste this code 5 more times!

 

Questions:

-How can I collect a rate  differently? If you notice on the calibration subvi attachement, the rate is calculated manually knowing how fast the loop is going in the main VI. I don't know if this is the best way

-Can I get rid of the shift registers some how?

-Is there a way for me to combine the  calibration subVIs so that I don't have to have one subvi for each channel?

 

Thanks in advanced! 


 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 2 of 20
(2,952 Views)

Hi,

I'm not sure I see your message. All I see is a copy of what I wrote, was this by mistake?

0 Kudos
Message 3 of 20
(2,936 Views)

It would be much more helpful to upload the actual VIs; the limited screenshots don't show enough of what you are trying to do. Most likely you could simplify this by making better use of arrays.

0 Kudos
Message 4 of 20
(2,921 Views)

OK, that's weird.  I know I know I typed a response but all that went out was quoted text.

 

It would help more if you attached your code (VIs) instead of pictures.  Only being able to see a picture of part of the block diagram makes it impossible to figure out what's going on.

 

The things you're wanting to do should be fairly straight forward unless there are things that I can't see that could complicate it.  I really need to see your code.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 5 of 20
(2,911 Views)

It looks like this could easily be handled by a 2d array and a for loop. One shift register, and the for loop calls whatever blue subvi that is with the iteration + 1 wired in.  But, without the code, I have no way of knowing if that will actually work.

 

-M

Message 6 of 20
(2,898 Views)

Are all 1D arrays the same lenght? In this case you could use a single 2D array in a shift register. If done right, the code will not change, even if you have 1000 rows later.

To process, autoindex on a FOR loop and wire 'i' to the blie terminal of the subVI.

 

What is the point of taking a subset starting with element zero. That's a No-op.

 

Please attach the actual code. We cannot debug an image.

0 Kudos
Message 7 of 20
(2,882 Views)

Hi all,

I will attach the actual code in a few minutes. There's some propietary information that I need to remove before uploading. I'll be right back

 

EDIT:

Ok guys, please see VI's attached. The VI that I need help with is "AWC - Commercial Main VI - Rev0" and the messy part it's towards the bottom.

 

I have been cleaning up this VIs and making subVIs for a few months now (time on and off) but I can't seem to get a grasp on how to minimize the big shift register mess.

 

Maybe some background on myself might help? I'm a ME but I have been using LabView for easy project for the last 2 years. I took Core 1,2,3 class of LabView so I guess I know enought to be dangerous and to get myseld into trouble. I don't practice as much as I would like to and that's probably why I'm stuck with this big mess.

 

I will also accept any other tips that anybody has offer in any other part of the VI. I can also clarify any parts of the VI if that helps.

 

Thanks,

Pepi

0 Kudos
Message 8 of 20
(2,870 Views)

Looking at this, each of those arrays are 1d of size 10. You should easily be able to dump them in to a 2d array and then run it through a for loop, exactly like I explained above.  It is a simple solution 🙂

 

-M

0 Kudos
Message 9 of 20
(2,840 Views)

@BowenM wrote:

Looking at this, each of those arrays are 1d of size 10. You should easily be able to dump them in to a 2d array and then run it through a for loop, exactly like I explained above.  It is a simple solution 🙂

 

-M




Hi M,

 

I read your first comment and it seems like an easy solution, but I'm having trouble executing what you're suggesting. I'm going to spend the afternoon playing around with arrays and a for loop and see if I can get something to work. I always get confused when it comes to arrays and different dimensions, so bare with me. 

 

Can you clarify what you mean when you say " each of those arrays are 1D of size 10" Which array?

0 Kudos
Message 10 of 20
(2,823 Views)