LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scientific calculator using LabView?

I have to design a scientific calculator using labview program by next week. Can anyone help me please? thank you
0 Kudos
Message 1 of 12
(9,319 Views)
Are you using windows?

You can actually programatically use the built-in windows calculator, which can be scientific, and you don't have to program it.

You use ActiveX objects to use it.

Mark
Message 2 of 12
(9,319 Views)
I definitely think the ActiveX idea is the best you have if this is due in one week. I am attaching a linear algebra calculator VI I found which may help you out, although I don't know exactly what functionality you are looking for. Hope this helps.
J.R. Allen
0 Kudos
Message 3 of 12
(9,319 Views)

It's been 11 years now since I posted my LabView Scientific Calculator (Casio) back in 2003 without sample VI. Shame! I just found the VI's I wrote 11 years ago and now would like to share this to all who will find this VI usefull. If you have any question please feel free to email me at muligo@hotmail.com. You are free to share, modify and add more functions, formulas, conversions or anything you may think to make this application usefull.

Message 4 of 12
(7,467 Views)

Joel_Mulig,

 

Thank you for sharing your code. 

 

Some suggestions:

1. Refactor it to use the Event structure which was either not yet available or very new in 2003.

2. Refactor it to use a state machine architecture.

3. Eliminate local variables.

4. Eliminate sequence structures.

5. Eliminate Formula Nodes.

6. Add Dcoumentation to the VI Properties.

7. Create custom icon.

8. Enlarge the panel and buttons so the text is more legible. Screens tend to be much larger than they were 11 years ago.

 

Lynn

Message 5 of 12
(7,456 Views)

Hi Lynn,

 

Thanks for your inspiring and constructive feedback. It's a shame after 11 years I left the LabVIEW programming. You're feedback inspires me to get back to LabVIEW and trying to understand how to eliminate local variables maybe by using event structure which is new to me, eliminate sequence maybe by using state machine or case structure. For the formula nodes I'm not quite sure what other easy ways to process an equation. Still I'm trying to understand why we need to avoid all these conventional methods maybe because of memory issues. Anyway for the last 10 years I was heavily involved on EMC compliance testing to AS/NZ, EU, FDA, FCC, CISPR and other Emmisions and Immunity Standard for this reason I was left behind on doing LabVIEW programming. The last LabVIEW version I did is 7.1. Thanks for your inspiring and constructive feedback.

 

Cheers,

Joel

Message 6 of 12
(7,396 Views)

Joel,

 

You have certainly been busy enough that we can excuse you for not staying up to date with improvements to LV and programming techniques!

 

The calculator project is actually a good framework for learning about these things because so many of the changes are relevant and the product is sufficiently straightforward that it is easy to tell if things are working.

 

As you work through those challenges, please post the questions that stump you. You will find many people here willing to help.

 

Lynn

Message 7 of 12
(7,379 Views)

@Joel_Mulig wrote:

 

Still I'm trying to understand why we need to avoid all these conventional methods maybe because of memory issues. 


Let me try to help a little.  At the end of the day most developers only care about if it works, because their boss only cares about if it works.  But what should matter to you just as much (or more) is if a new developer can pick up your code, understand it, and make changes quickly.

 

Having many Local Variables, and native Global variables make code hard to follow, and hard for a new developer to follow the code.  This is because things are happening all over the place, and it is hard to know why a control value changes mysteriously.  So what do you do?  Right click the control and say find all local variables.  When you come up with a list of more then 3 or so you tend to get confused and loose track of where all the writes are taking place.  And in many cases it isn't needed.  Why use a local variable when the data is on a wire near by for a read?  These types of development tend to make race conditions where you are writing to the variable in multiple locations at the same time and the output can't be known.  People try to over come this by using sequence structures...

 

Sequence structures are almost never needed.  Proper data flow means doing something only after all inputs are available.  If you are using wires, instead of local and global variables, then you know the value on the wire, where a local maybe changing all the time.

 

Polling is again, almost never needed.  Why have a loop running looking at the UI?  Did a user click a button?  Is my mouse over a control?  Did the user click a drop down?  Did the window resize?  Just make an event structure to handle these things.  Your VI can literally be idle, having the highligh execution on will show no data flow.  There are rare occasions where you do need to poll.  Things like read a serial port every 500ms.  In these cases you can set the timeout of the event structure.

 

State machines help with all of these.  With a state machine you have defined flow like a sequence structure, but you can choose to end mid sequence, or add steps before completing, or reuse states for other purposes.  State machines also generally have a big cluster in a shift register holding values that you can keep from one case to another.  These can be used like variables updating as you need, but without the race condition issue of a local in multiple loops.

 

Conclusion, it makes code easier to follow, easier to understand, and easier to modify.  While the boss might not care much about it, I care a great deal about it.  The needs of the program will change, and they will change often, and in ways you can't predict, so prepare for change with well designed and documented code.

 

EDIT:  Oh and LLBs aren't used much anymore.  For code distribution you can used a packed project library, or a LabVIEW Library in a zip.  It adds depth, virtual folders, and name space updates so you can have a VI named "Read.VI" but in memory the name is "My Cool New File IO Stuff::Read.VI"

 

Double EDIT:  That is extreamly impressive for a VI writen in 6.0, I hope you were proud.

Message 8 of 12
(7,338 Views)

Helo sir,

I want to make program of scientific calculator using labview but not using windows calculator (activeX objects). Is it possible sir? Please guide me for this.

Thanks

0 Kudos
Message 9 of 12
(7,167 Views)

komalsoni201227 wrote:

I want to make program of scientific calculator using labview but not using windows calculator (activeX objects). Is it possible sir? Please guide me for this.


Yeah it's possible.  Did you even read the thread?  There are actual examples of people doing it in this thread.  What have you tried?  What are you having problems with?

0 Kudos
Message 10 of 12
(7,136 Views)