Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Real time Application (work in Windows, communicate via usb)

Status
Not open for further replies.

adwnis123

Full Member level 4
Joined
Jun 19, 2014
Messages
214
Helped
0
Reputation
0
Reaction score
1
Trophy points
18
Activity points
1,737
Hello,

I want to build an application that would show data in real time by reading a sensor from usb. I also need to make buttons so as to give commands to the sensor. The application should work on Microsoft Windows.What programming language should I use?

Thank you
 

Hi,

"Real time" says nothing.
Measuring and displaying room temperature every half an hour is "real time".
Online 3D video rendering is "real time", too.

You need to give a lot more information.

Klaus
 
Ok, I need to read data from the sensor every 10s and give commands to the sensor instantly.
 

There are several programming languages which can build a Windows application. Is there one you have prior experience with? It's likely you can locate a version which makes it easy to open an application window, talk USB, accept mouse input, keypresses.

Consider using the programming environment which Microsoft recommends, because they are likely to cooperate with each other. The developer resource websites seem to favor C++, Visual Studio, and DirectX. (You may need to spend money at some point.)

Does your project require extensive complicated routines? Calculations, graphs, disk access, etc.? You need to make sure everything you want to do can be done in that programming environment.

Scripting is a language which is worth a look because it allows a novice to perform powerful tasks. Example, I have used ThinBasic. It's a scripted version of BASIC which works directly with Windows. It creates windows and messages using the same routines as reside in the OS. Thus I can make my program behave like a commercial Windows application. I have not tried USB communications with it, however.
 
There are several programming languages which can build a Windows application. Is there one you have prior experience with? It's likely you can locate a version which makes it easy to open an application window, talk USB, accept mouse input, keypresses.

Consider using the programming environment which Microsoft recommends, because they are likely to cooperate with each other. The developer resource websites seem to favor C++, Visual Studio, and DirectX. (You may need to spend money at some point.)

Does your project require extensive complicated routines? Calculations, graphs, disk access, etc.? You need to make sure everything you want to do can be done in that programming environment.

Scripting is a language which is worth a look because it allows a novice to perform powerful tasks. Example, I have used ThinBasic. It's a scripted version of BASIC which works directly with Windows. It creates windows and messages using the same routines as reside in the OS. Thus I can make my program behave like a commercial Windows application. I have not tried USB communications with it, however.


Yes I want to display graphs, and make disk access. I know C,Java,Python. Now I will learn C++ as you suggested.
 

Hi,

You need to specify your "real time" requirements.

Let's say you want to build a regulation loop with 50 calculations per second.
Every 20ms there is a new input..and every 20ms you need to calculate a new output value.
For the regulation loop to be stable it is not allowed to use buffers that stores lets say 10 input values that can be processed delayed.
It means if another process takes 100ms full processing power, then 5 input values are stored in the buffer and processed afterwards...within the next few milliseconds.

But for displaying a graph....or storing data...the buffer and a delay of 100ms or even longer is no problem...as long as no data gets lost.

The first solution..to process every incoming data within 20ms...I assume is not possible with Windows. (At least I wouldn't rely on it)

The second solution...to buffer the incoming data..and process all incoming data within lets say every 500ms may be possible with Windows.

Klaus
 

https://www.codeblocks.org is a free open source editor (IDE) for C or C++ and uses the free GCC compiler.

https://www.wxwidgets.org is a C++ library that lets developers create applications for Windows, Mac OS X, Linux and other platforms with a single code base. This will have the plugins for buttons, graphs, etc

https://wiki.codeblocks.org/index.php/Using_wxWidgets
beginner's quick reference for setting up wxWidgets with Code::Blocks in Windows.

**broken link removed**
This may help with USB support.

******************************

https://www.python.org/
free python

https://www.jetbrains.com/pycharm/download/#section=windows
PyCharm Community Edition python editor (IDE) is totally free and open-source, available under the Apache 2.0 license.

https://docs.python.org/3/faq/gui.html
What platform-independent GUI tool kits exist for Python? All free.

**broken link removed**
PyUSB aims to be an easy to use Python module to access USB devices. Free
 

The language you should use is the one you are already comfortable with.
research shows that language difference is functionally irrelevant in none vertical market
applications except in the development time, security, efficiency and bug areas.
Issues arise when you change technologies -the change being the cause of problems.

Use something "new" just because you think you "should" and you will spend more time
developing and debugging than using a language you "feel" is less "appropriate."

Some languages do have advantages over others but that seems to be totally
overridden by the issues of familiarity in practice.

If you know C use C.
If you know pascal use pascal.
if you like C++ use that.
If you're daft enough you could even use java.

Most popular "wisdom" turns out to be old wives tales.
 

https://www.codeblocks.org is a free open source editor (IDE) for C or C++ and uses the free GCC compiler.

https://www.wxwidgets.org is a C++ library that lets developers create applications for Windows, Mac OS X, Linux and other platforms with a single code base. This will have the plugins for buttons, graphs, etc

https://wiki.codeblocks.org/index.php/Using_wxWidgets
beginner's quick reference for setting up wxWidgets with Code::Blocks in Windows.

**broken link removed**
This may help with USB support.

******************************

https://www.python.org/
free python

https://www.jetbrains.com/pycharm/download/#section=windows
PyCharm Community Edition python editor (IDE) is totally free and open-source, available under the Apache 2.0 license.

https://docs.python.org/3/faq/gui.html
What platform-independent GUI tool kits exist for Python? All free.

**broken link removed**
PyUSB aims to be an easy to use Python module to access USB devices. Free


I get this error on codeblocks but file is not protected. What is wrong? (see photo)
 

Attachments

  • 1.jpg
    1.jpg
    178.4 KB · Views: 95

I get this error on codeblocks but file is not protected.

Did CodeBlocks successfully save your program at least once? It may want to do this as a safety measure, in case your code were to cause a system crash.

Did you navigate to a particular folder when saving it?
Did you change settings so the file or folder is invisible?
Did you change anything about the folder's location?
Did you change the filename?
Did you change its permissions?
Etc.
 
Ok, I fixed it. But now it does not find the wx/setup.h library!!! Is there a way to install devc/c++ inside wxWidgets, so I can use it?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top