1. Devices names....

Good morning programmers , Good Morning America ,

the weather is fine , the temperature is high.... , the shares went up...

just started the system and see the huge CON... take coffee black and...

start to think about new magic concepts of prgramming in Euphoria!

Ok. At the time i am only a beginner of Euphoria and Programming. But i hope that all topics will help others beginners indeed.

I am reading the topic "File and Device Handling" from the Beginners Guide Euphoria.

There are the following names for devices: ( All on the DOS based - little older hardware technique )

CON - Console (screen) AUX - Auxilary serial port COM1 - Serial Port 1 COM2 - Serial Port 2 PRN - Parallel Printer NUL - Non ecisting Device.

OK. I have Euphoria 4.0

My question :

What are the actual Device Names for up to date PC Ports like : USB Port 1 , USB Port 2 , etc.

Yes , i have the complete tutorial of Euphoria.

To search the complete book for theese topics is a little bit cumbersome as a beginner.

Thanks for your efforts.

Hans

Thank you Chris ,

i understand.

I have heared about special "interface programmers"

They do nothing more than interface programming.

To transfer data from one mode to another.

The data transfer to a usb device is such the same i have realised from your posting.

Thanks

Hans

new topic     » topic index » view message » categorize

2. Re: Devices names....

Hi

Unless you are using an old DOS computer (not a dos box or console window), these are mostly irrelevant nowadays. The exception is CON which will output to the console.

CON usually = 1 so puts(1, "Hello\n") = puts(CON, "Hello\n") will print hello to the console, or the screen on a DOS computer.

File input and output is handled by open(), close(), seek, and so on, with printf() and puts() handling the actual file writing, and read(), read_file(), get() and gets() handling the rwading (other functions exist)

Direct access to the serial and parallel ports is available up to XP, but AFAIK isn't above this.

Access to the USB ports is unavailable on all windows machines, and reuires the use of specific drivers / DLLs to access specific items of hardware.

My advice - ignore this for now, port handling is a subject all to itself, and concentrate on writing a few simple programs.

ChrisB

new topic     » goto parent     » topic index » view message » categorize

3. Re: Devices names....

han45 said...

What are the actual Device Names for up to date PC Ports like : USB Port 1 , USB Port 2 , etc.

USB completely changes the way raw devices are accessed from software. We can no longer use simple COM1/COM2 names, etc. unless the USB driver creates virtual serial (or parallel) device within the system.

In order to communicate with raw USB devices, you would have to use either WinUSB (built into Windows XP or higher) or libusb (cross-platform, third-party) or some other similar library.

-Greg

new topic     » goto parent     » topic index » view message » categorize

4. Re: Devices names....

ghaberek said...
han45 said...

What are the actual Device Names for up to date PC Ports like : USB Port 1 , USB Port 2 , etc.

USB completely changes the way raw devices are accessed from software. We can no longer use simple COM1/COM2 names, etc. unless the USB driver creates virtual serial (or parallel) device within the system.

In order to communicate with raw USB devices, you would have to use either WinUSB (built into Windows XP or higher) or libusb (cross-platform, third-party) or some other similar library.

-Greg

I have written a library that works with FTDI USB serial port devices, which I plan to release one of these days...

new topic     » goto parent     » topic index » view message » categorize

5. Re: Devices names....

Names like CON, PRN, and NUL were created a long time ago to facilitate access to these ports from the command line and batch files. This was possible because these devices were very simple and programmers could expect they would behave in a predictable way. These names were maintained in Windows for compatibility, but not the preferred way of communication. USB ports are much more complex and could not be accessed by such simple methods. Thus, no such names were ever defined.

A big problem with USB ports is that they can be used for a mouse, keyboard, printer, disk drive, and a wide variety of other devices. And the user is able to change this at any time. Each has their own specific requirements for use. And there is no simple way a program can detect what device is connected.

In a modern OS programs normally access devices without the need to know how or where they are connected to the computer. The OS manages all the complicated details of ports and such.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu