LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write a program that returns the capital when you type in the name of a country

Solved!
Go to solution

Can somebody please help me in solving this problem. I am trying this from last three days. Please let me know what am I doing wrong.

Download All
0 Kudos
Message 1 of 29
(8,294 Views)

The various online training (free to students) likely takes a day or less to complete.  You probably could have started with that.

 

Here are some free training links if you are interested:

 

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide 

Learn NI Training Resource Videos

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required

 

That being what part of the problem are you struggling with?  Write down the steps to the problem and solve each of them one at a time.  And looking at your assignment document it seems the instructions are mostly broken up into the steps you need anyway.  So which one are you haveing problems with?

Message 2 of 29
(8,276 Views)

Without your "database" file "countries.csv" it is hard to check, though all you have now is a loop to autoindex through your entire data, as fast as it can loop. If you turn on "highlighting" (the little light bulb in the tool bar at the top of the diagram side) it will slow down execution and let you see the data. We won't do your homework, but if you make attempts and have specific questions you

will probably get help.

 

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 29
(8,267 Views)

A search on the forums might return a good example.

 

Most posters will not open a *.docx file.  Too many virus possibilities and not everyone has MS Office.  We also do not do "Homework"  But, if you ask a specific question, we will be more than happy to answer it.


@anny321dum wrote:

Can somebody please help me....let me know what am I doing wrong.


What isn't working?  You asked a general question.  


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 29
(8,265 Views)

Thank you very much for your reply. I appreciate it. I am struggling with part 1. I will really appreciate if you can help me out. 

0 Kudos
Message 5 of 29
(8,212 Views)

@anny321dum wrote:

Thank you very much for your reply. I appreciate it. I am struggling with part 1. I will really appreciate if you can help me out. 


What is part 1.1?  Again, ask a specific question!


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 29
(8,205 Views)

Again without the example csv file it is hard to know but it looks like this part you mostly have done.  You have a cluster on the FP you just need to make it an array of this, and then autoindex out of the for loop to the indicator.

 

  1. Create a vi that reads in the data and returns a cluster array. a. On the front panel create a cluster with fields “UN Code”, “ISO 2”, “ISO 3”, “Country”, and “Capital”.
  2. Reads in the data using the “Read from Spreadsheet” vi. Using a for-loop with auto-indexing, take the data from each row of the csv file and put it into the cluster using the “bundle by name” element.
  3. Create an indicator that is an array of clusters and put the clusters created in each iteration of the for-loop into the array, again using the auto-index feature of the for-loop.
  4. To make it usable as a sub-vi, wire the file-path and the cluster array to the terminals on the icon. Edit the icon’s appearance. It’s typically pretty easy to put some descriptive text on it. Input (Control) terminals should go on the left and output (indicator) terminals should go on the right.
  1. Create a vi that searches the cluster-array for a particular country. This vi should have two inputs: a string for the country name and the cluster-array. The output will be the cluster for that particular country. a. You can use a while-loop with auto-indexing to search for the correct country. You can compare strings using the comparison operators. You will need to use the unbundle by name elements as well.
  2. This is a brute force search method since it does not take into account that the list is alphabetized, but there aren’t that many countries so it’s still pretty fast. If you would like to use a more sophisticated search method, go for it.
  1. Create a top level vi that allows a user to find capitals until they get bored. The search vi should be placed in a while loop so that the user can continually search without having to restart the vi. Place a stop button on the front panel to quit the program. Within the while-loop place a wait vi; this slows down the loop so that it doesn’t use all the cpu time. If the wait is 100ms or so, you won’t even notice. a. Use a shift register to keep track of the previous value of the Country entered. When the country is changed by the user run the search vi to find the capital. To do this, you will place a case structured within the while loop. The main while loop / case structure combination is very common in Labview top level vis.
  1. Document your vi
Message 7 of 29
(8,200 Views)

Wow. That is a lot of information for a general question.  'nuff said


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 29
(8,192 Views)

I need help for part 1>(c). That is the only one where I need help. Thank you for your reply.

0 Kudos
Message 9 of 29
(8,180 Views)

This is what I have done so far.

0 Kudos
Message 10 of 29
(8,176 Views)