LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert square wave to sinc wave

Solved!
Go to solution

@keni wrote:

First of all, thank you tbob. I don't know what's going on your program. To be honest, I am lost now. Isn't there any simple way to connect my program with your EKG generator program?


First of all, you need to learn Labview.  If you don't you will never be able to understand my code and you will never be able to complete your project.  I did the hard part for you.  Now you need to do the rest.  Its your project, not mine. 

 

My code has comments in it (the green text boxes) that explain what each section does.  Get familiar with the functions that are there.  Use the Context Help to read about what they do.  Take the free online tutorials on NI's website.  Do the legwork first, then you will be able to complete this project. 

 

There is no easy way to simply connect my program to anything you have.  Your program doesn't do anything but generate a signal and write it to a file.  The project isn't simple.  So start learning Labview. 

 

Don't post anything until you have written some decent code and need help with it.  Dennis has told you the next step.  You have to do it yourself.

- tbob

Inventor of the WORM Global
0 Kudos
Message 51 of 61
(1,421 Views)

How can I generate continuous square wave? Why am I not getting EKG signal?

0 Kudos
Message 52 of 61
(1,397 Views)
0 Kudos
Message 53 of 61
(1,396 Views)

Because you did not wire the output of the DAQ Assistant correctly - not all like the simulated example. Convert the evil dynamic data to a 1D DBL array outside the loop and wire the array in - just like the simulated example.

0 Kudos
Message 54 of 61
(1,386 Views)

Your DAQ Assistant was set up for a range of -10 to 10 volts and for differential input.  I would bet that both of these settings are wrong.  You need to set the DAQ according to the signal you are expecting to read.  Please study Labview and the functions you intend to use before you try to use it.  You have already taken a lot more of our time than the normal person does.

If you won't bother to help yourself, we won't bother to help you either.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 55 of 61
(1,371 Views)

I'm sorry to bother you guys, but I still can't get continuous graph. It stops at 1000 like in the picture. I thought I could make it continuous putting a loop outside, but it just repeats the same pattern.

Download All
0 Kudos
Message 56 of 61
(1,351 Views)

Graphs are not continuous. They discard the old data and display the new with each iteration. As long as you keep seeing new data, there is no problem.

 

You seem to be willing to accept a 1 second delay between the pulse and the ekg signal being generated.

0 Kudos
Message 57 of 61
(1,343 Views)

Instead of a waveform graph, use a waveform chart.  In the strip chart mode, it will not clear every loop iteration.

 

Change your DAQ Assistant to acquire more slowly.  I think I remember that your input was around 1 Hz (920mS cycle is close to 1 Hz).  Reading at 10 Hz sample rate should be fast enough for a 1 Hz signal.

- tbob

Inventor of the WORM Global
0 Kudos
Message 58 of 61
(1,329 Views)

Thank you guys for your help. One more question, which DAQ will be better to use in this project and why?

0 Kudos
Message 59 of 61
(1,280 Views)

I believe that you should be using a card that supports an AO Start Trigger and a card that supports hardware timed analog output such as the 621x boards. I already told you what that would give you. No need to acquire the pulse signal. No need to search a waveform array for some transition. No need to use a loop to output the analog signal point by point. No need for all the code you already have. much, much better synchronization between the pulse and the analog output. If you had this sort of DAQ card from the beginning, all of your problems would have been solved in just a couple of posts and some simple code.

 

Understanding the differences between software (what you have now) and hardware triggering is really an instrumentation fundamental.

0 Kudos
Message 60 of 61
(1,268 Views)