none
ECG drawing and analysing program RRS feed

  • Question

  • Hi, for my coursework for a level computer science, I am wanted to create a program in visual basic in which I can draw and analyse drawings of an ECG. I have no knowledge of electronics and would be very grateful for any advice you could give me on how I would acquire the values I require to draw an ECG in visual studio, whether that be with an ECG capturing device or other means - thanks.
    Monday, August 6, 2018 2:52 PM

All replies

  • What have you done so far?

    You will need to get the specifications from the maker of the device you will record.
    Maybe it is serial communications via usb port and you call it to get the data in readings or it constantly outputs data that you monitor and record etc. If it plugs into a usb port then its most likely serial communications. There are lots of examples from past forum questions.

    You have to get that info from the device manufacturer. If you are lucky maybe they will have some code samples.  So go to the web site for the exact device.

    Once you have some data you need to record it somehow in vb code and then draw the data graph.

    I suggest the chart control to draw and interact with the graph.

    Here are some examples. You can see the charts are drawn from simple x, y  coordinate data. One example plots saved data and one receives new data and discards the old.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/e381f8b1-251c-4a32-94c6-b43f99cbb976/plotting-instantaneous-y-values-in-ms-chart?forum=vbgeneral

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/a3b81414-b541-4afb-83ee-655a98377629/line-chart-in-visual-basic?forum=vbgeneral

    Then, assuming you get this far, what will you do with the chart? How would a doctor use it? Zoom in? Scroll? Mouse click and display and etc?

    Try to outline the major steps and tasks. Don't try to completely solve the entire project yet. Just do one little step at a time. Build the project with small steps that connect and branch out into larger steps.

    If you go too far too fast you will get frustrated and confused.

    Make an outline, flow chart even, make a code outline and try to get some code to run in Visual Studio. Add to the code slowly and get each step of the code working and understood before moving to the next. Its much more fun that way if you can run the project and play with it. If you do too much you will never get your code debugged and running.

    :)

    Monday, August 6, 2018 3:21 PM
  • Thanks very much for your response, I will defiantly look into that if I can draw the ECG in my program.  However, my key issue is that I need some way of getting the voltage values for the ECG so that I can use those values for the x and y values on the graph I will draw, I am finding it really difficult to start even modelling my system without knowing how I would do this, as someone who has no idea what 'serial communications' even is I literally don't know where to start.
    Monday, August 6, 2018 4:34 PM
  • I have however looked into devices like 

    Heart Monitor AD8232 Board and similar devices that connect to an arduino board but still have no idea how to get actually mathematical values into the code e.g.

    the voltage for the P wave = 

    Monday, August 6, 2018 4:36 PM
  • I have however looked into devices like 

    Heart Monitor AD8232 Board and similar devices that connect to an arduino board but still have no idea how to get actually mathematical values into the code e.g.

    the voltage for the P wave = 


    Yup.

    I dont know I have not done it but I have seen others on the forum show others how and its the ardunio this and that. So I suspect someone will be along but they might be on vacation or something.

    But part of learning to program is learning where to look for answers and how to search. There are examples in the search box of this forum. Look at the most recent posts for adunio etc. Look up serial port etc.

    Do you have the device? Dont blow it up or something but I think you plug it in and then read the serial port of the computer with vb. I think you can use ... whatchacallit ... old printing thing...? I leave that part for others...

    You might post another question after some study how to read the adunio serial port ... this one is broad.

    When you want to draw the picture I can help.

    :)

    PS Make a simple one form project to read the serial port based on an example you find. Got to the ardunio web site or whatever I seem to recall forums and examples maybe not the exact one. If you cant get it then post the code example you have.

    PS When I say plug it in you will use the communication that the device supports. If it plugs into the USB port? uses some type of serial communication over the USB? or whatever. So its complicated and I don't really know all the details.

    Monday, August 6, 2018 4:50 PM
  • I have however looked into devices like 

    Heart Monitor AD8232 Board and similar devices that connect to an arduino board but still have no idea how to get actually mathematical values into the code e.g.

    the voltage for the P wave = 

    All of that will be in the specs of the board you choose.  Output will be either an analog voltage level encoded into a given bit-depth number, or a text value containing the information in a "human readable" format.  This will be entirely up to the hardware interface you select -EDIT- and potentially the firmware that you write for the microcontroller.  That's an important point, the hardware and interface to talk to the PC will likely be on you to code within the development environment of whatever microcontroller you use. -/EDIT-

    Personally I would suggest coming up with a different project for a computer programming course.  This project will contain a lot of external requirements just to configure and connect the hardware and interpret its output, none of which is really relevant to proving your knowledge as a PC software developer.  I'm afraid you will be creating a lot of extra work and time for yourself before you even begin to code the actual PC software on which you will be graded.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"


    Monday, August 6, 2018 5:13 PM
    Moderator
  • I have no knowledge of electronics

    This is not the place to get help with electronics.

    Another point that has been said but I will make more clear is that these forums work best when the question is specific. If you have the specifications for the device including how to get data from it but there is something specific you need help with then you will likely get good help. If you are trying to make a chart but there is something specific you are having difficulty with then you can ask about that. You need to decide what the program needs to do with as much detail as you can. Determine what commands you need to send and what data you need to receive; even if you don't know the details of how to do that you need to have a general idea at least. Decide what data is to be plotted. Write all the details then work on how to do specific things. If you look at the whole project then it will look too big and confusing.

    Start by describing what the program needs to do from a non-technical user's point of view.



    Sam Hobbs
    SimpleSamples.Info

    Monday, August 6, 2018 6:55 PM