LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

request for review

hello,
i have started working on labview recently and have tried out to solve the prime factors challenge
 
please go throught the attached design for the prime factors challenge.
 
awaiting your comments
vijay
Download All
0 Kudos
Message 1 of 8
(3,357 Views)

Vijay

Congratulations for making a working program. 🙂

We have seen your other post, but a code review is difficult because there are many things that are overly complicated and convoluted and should be done quite differently. For example you do entire loops to duplicate fuctions that are already part of labVIEW. I probably won't have time during the next few day to look at it in detail.

In the meantime, learn about shift registers. Also you use way to many unneeded local variables. You don't need a single one! Try to get rid of the sequence structure and wire everything together instead of teleporting data between nodes using locals.

Then of course are the purely mathematical aspects of your approach. You do way (way!) too many trial divisions, many more than actually needed. First in each prime check, the again in the main code. Over and over again. All trial divisions with numbers larger that half the input are also not necessary.

To make the code really fast, try to e.g. implement the Sieve_of_Eratosthenes. It will be orders of magnitude faster than what you are doing.

0 Kudos
Message 2 of 8
(3,344 Views)
hello alten,
thanks for your comments. ill try to reduce the unnecessary locals and calculations as you told and get back if possible
 
with regards
vijay
0 Kudos
Message 3 of 8
(3,329 Views)
Why are you using DBL as your datatype?  Only intergers can be prime, by definition.   I would use U64 (or U32 if you do not have version 8.0).
0 Kudos
Message 4 of 8
(3,319 Views)

hello jason,

thanks for your comments,

actually i dint think of it that much ill c to it now

 

with regards

vijay

0 Kudos
Message 5 of 8
(3,301 Views)

Hi

        I upgraded from Labview 8 to Labview 8.6 but I am unable to run some of the vi's which used to run before. I get a message that it is unable to find "Digital Single Write.vi" and "Digital Group Config.vi". How do I get this going?

thanks

 

Message Edited by kks on 04-28-2009 02:18 PM
0 Kudos
Message 6 of 8
(2,911 Views)

Hi kks,

 

why do you hi-jack an old thread instead of creating your own?

 

Do you use old (traditional) DAQ routines? The names of the vi seem to imply this. Some of those old functions aren't supported anymore...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(2,905 Views)

Hi GerdW,

  Nothing intentional. I did it and then I went back to delete it to post as a new thread it wouldn't let me do it. Thanks for your reply

The DAQ routines are part of a vendor supplied package and they are 5 years old now. The system was running fine until I upgraded to new Labview8.6. I am trying to install  Traditional NI-DAQ (Legacy) Version for Windows 2000/XP to see whether it would help.

thanks

 

0 Kudos
Message 8 of 8
(2,896 Views)