I do not want to learn Windows programming

Status
Not open for further replies.

vdaniel

Full Member level 4
Joined
Oct 8, 2004
Messages
204
Helped
8
Reputation
16
Reaction score
0
Trophy points
1,296
Activity points
2,157
Dear Colleagues,

Maybe, somebody of you passed the same way and found solution.
I am experienced hadware and softwate designer. During recent 30 years I have a lot of projects completed. I used Intel, then Atmel AVR, now Fujitsu FR and Philips LPC2100 microcontrollers. But the last program for PC I have wtitten in far 1992 under the blessed DOS. When I work with the microcontrollers or under the DOS, I can concentrate mainly on the problem itself. But now I try to switch to Windows, I every time stick, because I have to spent most part of the project time on the Windows details, not on the problem itself. Maybe I hame too old for new things?
I have DOS programs which still work, but, unfortunately, many modern computers do not support more COM and LPT ports, only USB, and I cannot more use DOS. I tried to find USB drivers do simulate COM or LPT under the DOS, but in vain.
Please, I am asking ONLY people who have the same experience! Which is the shortest and easiest way to adapt my software to the modern computers. Is the Windows learning inevitable?

Thank you,
Varuzhan
 

Hi,
Almost the same situation here. Unfortunatelly I cannot see how to port DOS apps under new environments. The easiest way I have found under the windows environment ( I do not like it either, but it is inevitable) is to use USB interfaces like FT232 or FT245, depending on app., and to make the app in VB. Take a look at www.ftdichip.com . You can use these chips with serial port drivers (case in which you can use any app. which uses the com port) or with a .DLL driver (this is for higher speeds and for BitBang modes), which is easy to use under VB. There are also code examples on that site. I have used it with success to a wide range of projects, MCU (51, avr, pic, smartcards) interfacing and programming, FPGA programming and interfacing, etc.

/pisoiu
 

It depends of qwhat you want to do.

1. of course you may also use linux instead of windows for developing purposes

2. which kind of software do you mean? Developing some embedded software components residing within a microcontroller does not need the knowledge of some interface (LPT, COM) specific things.

When u want to rely on (and use) operating system features like multitasking, or security against crash of your application, then you have to use the offered libraries and functions of the OS.

For communication to an external device, EACH OS needs some file descriptors, handles, some FOPEN and FCLOSE statements etc.

If you do need not all thes stuff, what speaks against some Chjaracter BASED old DOS application, where you simply use statements like "out Port xyz, Value qq). There will be no ressource conflict, as your application is the only one which will use the ressoruce.

So think about the things you want to achieve. To put a nail int a wall needs no project management (as it is an easy task), and also to do some "quick and dirty" software hack to reach some external device for test purposes might be possible.

The more complex your project is, or the more reliable it should work, you have to learn someting about dependencies to other components and th OS which is managing the whole stuff.
 

Great thanks for answers.

First about www.ftdichip.com and VB. Yes, I agree, this is a shortest way for
simple, microcontroller interfacing programs. I have recently passed this way.

But the main program, which about I speak, is a huge real time 2.5 axis CAM program
for milling, laser cutting and engraving. There is a lot of C code for different format
input files like dxf, dxb, pixel to vector converter and so on. It took several months
of design and then many years of maintenance and modernization. Customers
like it for reliability and easy to use. Nobody needs another program running
simultaneously, so I take a whole control on ports (I have versions for both
LPT and COM). The interface part for such approach takes no more than 2-3%.
But now some customers want to run it on laptops, which have only USB
for communications. And they want to run it under Windows, not Linux.
Sure in the case of the VB usage, I can keep only old algorithms, but not the
implementation code.
Waiting for new suggestions,

Varuzhan
 

Doesn't seem to be a very difficult job. What pisoiu said: the FTDI chips provide an easy bridge between USB and RS232. You have a real physical RS232 port which will be connected to your present hardware. The only work to do is porting your interface routines from DOS style to windows style (in pure C). The FTDI drivers provide virtual COM ports, looking the same as real COM ports in windows. I think it's much easier using the few windows functions for accessing COM ports than using DOS functions and taking care of all the hardware dependencies. Cheer up - i thing it's easier than it looks like.


Mik (no glue of windows GUI programming :wink: )
 

Thank you Mik,

Maybe really it is not so difficult as it seems to be.
Then more questions for whole community.
1. Is there available on the net a samble code for Windows under simple C,
not MFC and other refaerence materials for a quick start.
2. How can I from my code manage the PC resourcec, for example, to disable most activities, except of timer, keboard, mouse and other system resources and again enable them on the program end?

Thanks,

Varuzhan
 

Hi.
You don't need to use FTDI chips. Download a win32 library to direct access to ports under w9x/nt.

**broken link removed**[ProgramID=3548]

Good luck!
 

Ok, but how to do, if the PC has only USB, no LPT, no COM?

Varuzhan
 

Adapter needs a driver. It only simulates the COM port. You cannot work
directly with such virtual port, as with real one. Unfortunately there are not
drivers for DOS

Varuzhan
 

vdaniel said:
Ok, but how to do, if the PC has only USB, no LPT, no COM?

Varuzhan
I see. Sorry, I didn't pay an attention to that fact.

vdaniel said:
Adapter needs a driver. It only simulates the COM port. You cannot work directly with such virtual port, as with real one. Unfortunately there are not drivers for DOS
Varuzhan
I have USB<->RS232 cable now. I can install it and try to send data to the virtual COM port from a command line or batch file. If it works, will that result be suitable for you?
 

I have done this experiment already. No success/

Varuzhan
 

vdaniel said:
Adapter needs a driver. It only simulates the COM port. You cannot work
directly with such virtual port, as with real one. Unfortunately there are not
drivers for DOS

I forgot that your software is an DOS application.

I think that you could create Windows version of your app - is this the esiest way for running on modern PC with RS232-USB interface.
Just re-develop your serial communication routines for working with windows and recompile application with some 32bit win compiler. Only knowlege that you must have is the serial port accessing in windows.

Of course if in your app exist modules (except of serial comm) that talking directly to PC hardware in 'DOS manner',then moving to windows may be problematic.

How do you accessing serial port in your app? Is impossible creating windows version?
 

vdaniel said:
I have done this experiment already. No success/

Varuzhan
It's very suspicious. I have just finished my test and it was OK.
I am working under Win XP Pro. I installed Prolific USB-to-Serial Comm Port. It appeared as COM3. Then, I connected it to COM1 through a common RS232 cable (I only changed 2nd and 3rd pins on one head of cable) and ran a simple terminal program on COM1.
From the command line I typed "copy test.txt com3" and got that file onto COM1. Using of batch file was also successful.
I tried to send data in both directions and everything was OK.
 

u can check www.codeproject.com which has many windows serail projects/library including virtual com. use them as template then add your data processing code.
 

Dear colleagues, as this thread become a DOS COM USB I will start a new dedicated one,

Thanks for answers,
Varuzhan
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…