LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Check out this program I made in LabVIEW!


Ben321 wrote:

So I'm still unsure of how he was using the shift register.

 

I've only had this program for 1 to 2 weeks so I'm unfamiliar with a lot of it.


Well, don't make wild functional assumptions based on "names". Next time you are wondering why a "ring control" is not circular. 😄

 

Here is the help blurb on shift registers. Everything is well documented, so its just a matters of looking it up. 🙂

 

In this particular case, the shift register contains the image across iterations. How else would we be able to process the image data between iterations of the loop. WIthout the shift register, you would need to read the file with every iteration of the loop so it can be displayed (or do some other useless song and dance, e.g. with local variables). In my code, the file is read once and the data place in memory (=the shift register in this case). It will stay there until you read in another file. File IO is expensive.

0 Kudos
Message 21 of 24
(804 Views)

Ok I've remade the program now, and it is more efficient. It doesn't use the exact same set up as some of the suggestions I've received, but it seems to achieve the same level of efficency (not reloading the image and redrawing it during EVERY itteration of the program's while loop). It does reload the image each time it redraws it, but it does this ONLY when something is changed so that it needs to redraw it. It isn't CONTINUOUSLY reloading and redrawing it. I've attached the VI of my latest copy of the program.

0 Kudos
Message 22 of 24
(771 Views)

You should really only read the file once and keep it in a shift register. Reading from the HD is very expensive. Imagine somebody is using a laptop on batteries and the HD goes to sleep. Every time the user changes a controls, the HD needs to possibly spin up again.

 

At this point you should also have a look at the LabVIEW style guide. Is particular you should limit the number of wire bends and eliminate wires that flow right-to-left. These things make the code harder to read and debug.

 

Also have another look at my example, for example there is a primitive for "not a path" which is less clutter. You should also rename the radiocontrol items to something intuitive. This way the cases are labeled more logically.

0 Kudos
Message 23 of 24
(769 Views)

Ok. I've finally made a version that doesn't read from the harddrive evertime an operation is performed. It only loads the file once for each time I load a new file. And it only redraws the picture when a change has been made to the settings of how the image should be displayed.

 

I've attached a copy of the latest version of the VI to this message .

0 Kudos
Message 24 of 24
(736 Views)