08-04-2009 06:04 AM
I'm new to Labview and to learn Labview I've written some examples.
I'm using the newest version of Labview 8.6.1 under Windows XP.
One of my exercises is a prime sieve a la Erasthotenes (Erastothenes ?).
For this I took some code formerly written in Visual Basic and also Matlab und transformed this into Labview.
Now I have the problem that I`m not able to eliminate the used local variables.
Without variables I could not get this to run. (Sorry for my bad english).
See the attachment.
Is there someone who is able to eliminate the variables ?
Short explanation:
The algorithm starts with 3 as the first prime numer and 2 as the first divider.
The divisors are tested till the square root of the dividend.
Is a number is prime it is used as new divisor.
Solved! Go to Solution.
08-04-2009 06:21 AM
You must use that in Labview is called shift registers. In Labview you must think data flow. Much the same way as in electronic circuits. And your frames is not needed if the data flow is done correctly. That is in most cases.
Take a look on my modification
08-04-2009 06:48 AM
08-04-2009 06:57 AM
GerdW wrote:Hi,
here's a version with shift registers and without locals...
Gerd you must give this person a chance to explore and learn Labview. How can he/she do that then you solve all the homework
08-04-2009 06:59 AM - edited 08-04-2009 07:02 AM
And another solution:
Ton
08-04-2009 07:02 AM
Hi
What Gerd also did was to remove the Sequence Structures. In LabVIEW no node or structure can execute before all it's inputs have arrived, so you didn't really need them since the flow logic in LV gives you the sequensing for "free".
Best Regards
David
NISW
08-04-2009 07:12 AM
Thanks to all of you.
Hey man, you are all very fast.
I will check the different versions, maybe tomorrow.
At the moment I'm trying to program a vector signal generator with Labview.