01-28-2010 11:25 AM
hi,
i have been trying to do this for a long time. i just never learned how to make it work. can someone please guide me?
i have this program with many many local variables and i know that this forum absolutely hate LOCAL VARIABLES.
I want to program this the right way, so can you guys please help take a look at my code and see what i can do in order to REMOVE local variables if possible?
01-28-2010 11:39 AM
Hi krispiekream,
this forum sometimes "hates" local variables, but for sure it hates VIs with a blockdiagram size of roughly 30 times the screen size (right now I'm sitting at a notebook with a 1280×800 screen!)!!!
Even then it would help when all those 20+ subVIs and custom controls were included in the upload (atleast I stopped the loading progress after ~20 clicks on "ignore"). And you have been told a lot of times before what to do to enhance your VIs ![]()
Good luck!
01-28-2010 11:45 AM
GerdW wrote:
(atleast I stopped the loading progress after ~20 clicks on "ignore"). And you have been told a lot of times before what to do to enhance your VIs
You should be glad you did. It went on for a lot more than 20.
The main problem you have: race conditions. I stopped counting on how many race conditions you have. And, as GerdW has noted, this has been mentioned many times before.
01-28-2010 11:46 AM
One way to improve this would be to group related individual controls into clusters, create an object with Get and Set methods, put the cluster into an object and use the object instead of local variables throughout the program
Serge
01-28-2010 12:14 PM
01-28-2010 12:30 PM - edited 01-28-2010 12:35 PM
yeah. I have been told before in the past about this. but i never seems to do it right.
i tried grouping them instead of global local variables.
those are not my concerns though. i think those are too late to fix now. i dont want to redo the whole program.
i dont see any race conditions from here?
can you point out some?
i have like over 200 subvis in this program. its going to be hard for me to include all of them.
i want to do know what i can do to the control local varibles (meaning the buttons) and the indicator local variables.
serge, i think i already started the clusters going, but i dont know how to handle the buttons. if the value change from "True to False" my program doesnt work really well in that sense. i think its race condition?
about the size of the block diagram. i mentioned before in the past that i want to make it 1 screen size, but someone told me in this forum that not to worry about fitting it in 1 screen, worry about making it work without breaking anything. as of right now, i am 99% sure that its working. (i dont see any race conditions that is that critical?)
01-28-2010 12:54 PM
@krispiekream wrote:
i dont see any race conditions from here?
can you point out some?
You're not looking hard enough.
Here's one: The adv button. You have local variables in which you write and read. Aaaaaaaaaaaallllllllll the way over to the right you are reading that value. However, inside the loop to the left of this there's an instance where you write to the variable. Thus, the read can and will likely occur before the write. There's no control over when those variable are read to stop that loop.
01-28-2010 01:05 PM
okay.
i think i might see where you are coming from.
but i think i handled that correctly.
the adv button will end the loop if it is pressed with the stop and etc.
of if the loop is still running, without anyone interupping it. it will get to the "end case"
here are some pictures.
this is what i mean by wanting to get rid of local variables.
i have a 12mb test.llb files how do i attach it it? ni forum doesnt seems to allow me to zip it.
01-28-2010 01:16 PM
01-28-2010 01:23 PM
does this work?
i split up the zip file to 2.88mb each.
i think there is a file size limit of 5mb
can you rename test01.zip to test.z01
can you rename test02.zip to test.z02