- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was wondering if there is a special set of routines for that.
Would one use an OPEN of the USB port, or READ statements to get the raw bytes in,
or is something special needed?
Is this even possible using Fortran 2003?
Maybe an article broaching that subject is out there already?
Thanks; Bill S.
Would one use an OPEN of the USB port, or READ statements to get the raw bytes in,
or is something special needed?
Is this even possible using Fortran 2003?
Maybe an article broaching that subject is out there already?
Thanks; Bill S.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Windows virtualizes USB and similar storage devices so they may be accessed in exactly the same manner as disk drives. From fortran, use the complete path name to the device as the filename, ie
OPEN (unit=unit_id, file='e:\myfile.ext',...)
OPEN (unit=unit_id, file='e:\myfile.ext',...)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What type of external device is this? Indeed, for a USB disk drive it is just another drive, but for anything else (say, a GPS receiver or scanner), access through a device driver will be needed. Unless it appears as a named drive or device in Windows, you won't be able to just open it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In this case, it is a MIDI keyboard sending bytes over thru the USB port.
Anyway, as you said, ir's not referenced like a file on a disk drive, it's a stream of raw data.
The same would be true if it were, for example, a GPS receiver.
It isn't clear how the Fortran compiler would reference the device driver involved, although I can find out WHAT that is - - -
Maybe someone has posted an article or has a test example I could look at?
Thanks; Bill
Anyway, as you said, ir's not referenced like a file on a disk drive, it's a stream of raw data.
The same would be true if it were, for example, a GPS receiver.
It isn't clear how the Fortran compiler would reference the device driver involved, although I can find out WHAT that is - - -
Maybe someone has posted an article or has a test example I could look at?
Thanks; Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you need to talk to the driver, you'll be making Win32 calls, not Fortran I/O. I suggest that you look at the MSDN documentation on interfacing with devices.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page