LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a program to incorporate ELVIS ,LV and Excel

Solved!
Go to solution

Hi.I am new to LabView.

I have to write a program to incorporate between Elvis and LV.This program is designed for first year students.Every student should create a test file in labview  containing a sin wave -DC offset etc ...then they should use the NI ELVIS oscilloscope to see the wave and plot the results on a test sheet.This test sheet(which should be designed in LabView)n should be self marked so when the students filled in the approprite parts the answers should be marked by the program .

From my basic knowledge I think I have to use Excel with LV .I have also use ELVIS as a DAQ device but I dont know how to start and how to use Excel ,also how to make a self marked system in labview.

Any help really appreciated.

 

0 Kudos
Message 1 of 18
(3,234 Views)
Solution
Accepted by topic author ethen99

Hi en99,

 

You should look at some of the training material online for some help getting started, for example:

 

http://zone.ni.com/devzone/cda/tut/p/id/7466  -  good starting guide for students.

 

http://digital.ni.com/manuals.nsf/websearch/348FFE6BA9C9771A8625748E004B5555   -  getting started with ELVIS

 

http://decibel.ni.com/content/docs/DOC-7332  -  example to put data in a spreadsheet

 

If you search on www.ni.com for "getting started" then the product there are many helpful guides and tutorials.

 

Let me know if you have any more specific questions about LabVIEW.

 

Kind regards,

Owen.S
Applications Engineer
National Instruments
0 Kudos
Message 2 of 18
(3,214 Views)

 

Hi Owen

Many thanks for your reply.I wish I had time to start from beginning ,unfortunately I have to do it as soon as possible.

 

 

I have made this sample vi to show what I need to do.

IMAG0013.jpg

 

This is the basic program 

students should first specify thier group then a wave automatically will be generated and they can observe the wave using NI Elvis Osciloscope then they should fill in the phase ,amplitude and frequency sections and then click Ok.The radio button is in off state so after clicking ok if the answer is correct it will illuminate like below

IMAG0014.jpg

 

What I could do up to now is

 

1.

using Simulate Signal and DAQ I could generate a signal in LV and see the generated signal using ELVIS OSC.This is a picture of generated signal.IMAG0011.jpg

 

As can be seen it is not a perfect sin wave and I dont know how can I fix the problem.When I use Front panel graph with the generated signal in LV ,the graph shows a perfect sin wave but when I use DAQ Assistant (analogue output) I cant get a perfect sine wave in Elvis.This is my first problem.

 

2.Also as can be seen is test program.when a student specify his/her group and fill in the wave detail parts the program should automatically read the cotrrect values from an excel file and compare student values with the correct values and then change the radio button state if the answer is correct.My first problem is how can I do this comparison process..secondly how can I read the correct values from the excel file.I could read values from excel using ReadfromSpreadsheet.vi but I don't know how can I have access to data of every column because I need to compare them one by one with the student values.

 

I have attached this test file to this post

and again sorry everybody for this long post.I know most of my question are very basic but undfortunately I am completely lost and I dont know how to start.Any help really appropriated 

 

  

0 Kudos
Message 3 of 18
(3,193 Views)

Did you take photographs of your monitor for a screenshot?

 

How are you running this VI?  It runs one time.  Please don't tell me you are running this by way of the Run Continuous button.

 

Your VI creates on cycle of a sine wave and sends it to the DAQ assistant which outputs that signal then stops.  When your VI runs again, it will repeat that all over again, but there is going to be a slight delay, partially because it needs to recreate the signal in the Simulate signal Express VI, but also because you are writing data out to a file which might taken longer to write then it takes for your sine wave to generate.

 

You really need to look at some online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

Also look in the Example Finder for DAQmx examples.  Particularly ones that mention continuous generation.

0 Kudos
Message 4 of 18
(3,183 Views)

I think that if you go to continuous sample mode, your sine wave will look better.

 

Without seeing your csv file, it's a little hard for me to understand. Is the group number in a column with these other values on the same row? If so, you could use the index array function to get this column and then Search 1D Array to find the group. That gives you the row to index out the other values.

 

p.s. You really don't have much choice except 'Starting at the beginning'. There is no existing example that does what you want and this forum isnot a code writing service. You'll have to write the code yourself and attach more than a whole bunch of disconnected contols and indicators.

0 Kudos
Message 5 of 18
(3,178 Views)

Many thanks for your help.I have started with the tutorials.They were really usefull.I could make a new program .It can read the valuse from the spreadsheet file and

 compare them with the user inputs then if the answer is correct or near the correct value the radio button starts to illuminate.

I have attached both the vi and the excel file.The only problem left is I would like to generate different type of waves for different groups.For example a sine wave for group 2,4,6 and square wave for group 1,3,5 .Using stimulate signal I can choose the signal type manually but in the actual program signal type had to be choosen automatically after choosing the group. Would you please help me how can I generate different type of signals?

 

 

Download All
0 Kudos
Message 6 of 18
(3,156 Views)

Don't use the Express VI.  There is a Basic Function generator on the Signal processing / Waveform generation palette.  You use an enum to choose what type of waveform you want.  So you just need a case structure or a select statement to choose the correct enum based on your data to feed into that.

 

You could also continue to use the different express VI's one for each waveform type, just place each one in its own case of a case structure.  Again using your data to select the correct case.

0 Kudos
Message 7 of 18
(3,150 Views)

And CLEAN UP that block diagram. Don't let students think that is a way LabVIEW programs should look.

 

Just a few minutes of work and I had this:

 

 

 

 p.s. What is the challenge in this exercise? All that has to be done is copy the data in the indicators to the controls.

Message Edited by Dennis Knutson on 06-12-2010 11:13 AM
0 Kudos
Message 8 of 18
(3,126 Views)
Many thanks guys.The control and indicator part was really easy Dennis but continuous generation and observe it on benchtop Oscilloscope was quite challenging.I have a question about  continuous generation .Now I can generate a wave on one of the output phisycal channels lets say ao-1 this wave has 45 degree phase shift.At the same time I would like to generate another continuous wave with 0 degree phase shift on another channel for example ao-0 to show student what is phase shift and to ask them measure the phase shift using benchtop Oscilloscope but I cant generate the second have.I have used the same block the same functions the same basic wave generator and I just changed the channel but it doesnt work.Would you please help me how it can be possible to continuously generate 2 waves on different  output channels
0 Kudos
Message 9 of 18
(3,059 Views)
Please post your latest VI.  Since you say you've got things working better now, but are having problems with new code you've added, it is kind of hard to help troubleshoot if the only thing posted is the OLD code.Smiley Wink
0 Kudos
Message 10 of 18
(3,055 Views)