LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to eliminate local variables ?

Solved!
Go to solution

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.

0 Kudos
Message 1 of 7
(3,077 Views)

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



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 7
(3,070 Views)
Solution
Accepted by topic author HansWerner

Hi,

 

here's a version with shift registers and without locals...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 7
(3,056 Views)

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 homeworkSmiley Very Happy


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 7
(3,045 Views)

And another solution:

 

 

Ton

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Message Edited by TonP on 08-04-2009 02:02 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 5 of 7
(3,040 Views)

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

0 Kudos
Message 6 of 7
(3,035 Views)

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.

0 Kudos
Message 7 of 7
(3,028 Views)