Code Comments
Programming Forum and web based access to our favorite programming groups.Where can I read about doing I/O on one of the USB ports of my PC? (using Micro Focus COBOL Net Express 3.1) Thanks, Paul
Post Follow-up to this message"Paul H" <NospaMphobergNospaM@att.net> wrote > Where can I read about doing I/O on one of the USB ports of my PC? (using > Micro Focus COBOL Net Express 3.1) If it is a USB memory card then it may appear to the system as a disk drive which can be read and written simply by using an appropriate file name. If it is something else then why do you want to write a device driver in Cobol ?
Post Follow-up to this messageI'm curious as to what you want to do to the USB port. Mostly devices have drivers that obscure this level and you don't care. I think I may know how to do this but I'm interested in a little more information first. "Paul H" <NospaMphobergNospaM@att.net> wrote in message news:<6Ua3c.148777$Xp.602126@attbi_ s54>... > Where can I read about doing I/O on one of the USB ports of my PC? (using > Micro Focus COBOL Net Express 3.1) > Thanks, > Paul
Post Follow-up to this messageI want to use the USB cable to my cell phone to upload and download names, phone numbers, and whatever else is accessible using "AT" commands. Years ago when I needed to access serial ports to talk to modems, from MF Cobol, I had to write an assembly language routine to deal with the port. I hope things have improved since then. Thanks, Paul "Thane Hubbell" <thaneh@softwaresimple.com> wrote in message news:bfdfc3e8.0403082250.15fbfbbd@posting.google.com... I'm curious as to what you want to do to the USB port. Mostly devices have drivers that obscure this level and you don't care. I think I may know how to do this but I'm interested in a little more information first. "Paul H" <NospaMphobergNospaM@att.net> wrote in message news:<6Ua3c.148777$Xp.602126@attbi_s54>... > Where can I read about doing I/O on one of the USB ports of my PC? (using > Micro Focus COBOL Net Express 3.1) > Thanks, > Paul
Post Follow-up to this messageThis is a job for the operating system. The application shouldn't need to know that type of detail about where it is writing to. The application should j ust write to a file on a drive. That works when I write to my USB memory card. Some old operating systems have trouble with it though and I have to make sure that the card is mounted before I boot up. But newer operating systems handle this seamlessly.
Post Follow-up to this messageHi Howard, That sounds good to me. How should I refer to it in my COBOL program? I find no reference to "USB" in my manuals. Most of my computers have more than one USB and serial ports. Thanks, Paul "Howard Brazee" <howard@brazee.net> wrote in message news:c2kmct$45o$1@peabody.colorado.edu... This is a job for the operating system. The application shouldn't need to know that type of detail about where it is writing to. The application should just write to a file on a drive. That works when I write to my USB memory card. Some old operating systems have trouble with it though and I have to make sure that the card is mounted before I boot up. But newer operating systems handle this seamlessly.
Post Follow-up to this messageOn 9-Mar-2004, "Paul H" <NospaMphobergNospaM@att.net> wrote: > That sounds good to me. How should I refer to it in my COBOL program? I > find no reference to "USB" in my manuals. Most of my computers have more > than one USB and serial ports. The USB memory card is just another drive. How do you refer to it from you r OS? On my Windows machine I call my memory card by a drive letter. I plugged in my memory card to my card reader at work and noted that it crea ted a drive I:. I was able to drag files to I:, and take that memory card hom e and read it there (the drive letter at home was different). So I created a batch file to automate copying files to my memory card. Th e first part of it is at the end of its post. The only thing special in it i s a check to make sure that the drive is plugged in. Plug in your card. See what drive letter it is. Drag a file to it. Rea d that file. Now write your CoBOL program. Open the file by drive letter and name. Do status checking to make sure that the I/O worked correctly. CoBOL doesn't care what medium it is on. (It is DASD - but beyond that you don't care). .BAT code segment follows rem backstick.bat rem %userprofile% = "C:\Documents and Settings\brazee" DIR I: 2>NUL | FIND /I "DIR" >NUL @If ErrorLevel 1 echo "no Drive I: found" @If not ErrorLevel 1 echo "drive I: found" @If ErrorLevel 1 goto :Finale :Continue erase "c:\floppy\bookmark.htm" < C:\Belfry\y erase "c:\floppy\bookmarks.html" < C:\Belfry\y erase "C:\floppy\opera*.adr" < C:\Belfry\y erase "C:\floppy\*.bak" < C:\Belfry\y erase "C:\floppy\bookmarks.mozilla" < C:\Belfry\y erase "C:\floppy\firebird\*.*" < C:\Belfry\y erase "C:\floppy\opera\*.*" < C:\Belfry\y xcopy "%USERPROFILE%\brazee\mphshb0w.slt\bookmarks.html" "c:\floppy\firebird\*.*" /K/Q xcopy "%USERPROFILE%\Application Data\MailwasherPro\*.*" "c:\floppy\MailwasherPro\*.*" /K/Q < c:\belfry\a Xcopy "C:\Documents and Settings\brazee\Application Data\Opera\Opera\profile\*.*" C:\floppy\opera\*.* /K /Q < c:\belfry\a ...
Post Follow-up to this messageI think Windows API calls are the way to go here. Suggest you search MSDN.COM for "serial communications". "Paul H" <NospaMphobergNospaM@att.net> wrote in message news:<GZf3c.155766$Xp.627934@attbi_ s54>... > I want to use the USB cable to my cell phone to upload and download names, > phone numbers, and whatever else is accessible using "AT" commands. Years > ago when I needed to access serial ports to talk to modems, from MF Cobol, I > had to write an assembly language routine to deal with the port. I hope > things have improved since then. > Thanks, > Paul > > "Thane Hubbell" <thaneh@softwaresimple.com> wrote in message > news:bfdfc3e8.0403082250.15fbfbbd@posting.google.com... > I'm curious as to what you want to do to the USB port. Mostly devices > have drivers that obscure this level and you don't care. I think I > may know how to do this but I'm interested in a little more > information first. > > "Paul H" <NospaMphobergNospaM@att.net> wrote in message > news:<6Ua3c.148777$Xp.602126@attbi_s54>...
Post Follow-up to this messageSorry to miss-lead you, Howard. I will be using a USB cable to connect to a cell phone, not to a memory device. I want to read and write names, phone numbers, and any other accessible data in the phone. While, when I plus a digital phone memory card reader into a USB port, it immediately shows as a memory device, when I plug the phone in, it is ignored. If I could access it as any file type - byte-stream or whatever, that would be terrific. But I don't see how. I believe I need to be able to do my own I/O to that port. Send my own command strings to the phone and read replies. Any help would be appreciated. Maybe I can buy a driver from someone? Thanks, Paul "Howard Brazee" <howard@brazee.net> wrote in message news:c2ksp6$bqr$1@peabody.colorado.edu... On 9-Mar-2004, "Paul H" <NospaMphobergNospaM@att.net> wrote: > That sounds good to me. How should I refer to it in my COBOL program? I > find no reference to "USB" in my manuals. Most of my computers have more > than one USB and serial ports. The USB memory card is just another drive. How do you refer to it from your OS? On my Windows machine I call my memory card by a drive letter. I plugged in my memory card to my card reader at work and noted that it created a drive I:. I was able to drag files to I:, and take that memory card home and read it there (the drive letter at home was different). So I created a batch file to automate copying files to my memory card. The first part of it is at the end of its post. The only thing special in it is a check to make sure that the drive is plugged in. Plug in your card. See what drive letter it is. Drag a file to it. Read that file. Now write your CoBOL program. Open the file by drive letter and name. Do status checking to make sure that the I/O worked correctly. CoBOL doesn't care what medium it is on. (It is DASD - but beyond that you don't care). .BAT code segment follows rem backstick.bat rem %userprofile% = "C:\Documents and Settings\brazee" DIR I: 2>NUL | FIND /I "DIR" >NUL @If ErrorLevel 1 echo "no Drive I: found" @If not ErrorLevel 1 echo "drive I: found" @If ErrorLevel 1 goto :Finale :Continue erase "c:\floppy\bookmark.htm" < C:\Belfry\y erase "c:\floppy\bookmarks.html" < C:\Belfry\y erase "C:\floppy\opera*.adr" < C:\Belfry\y erase "C:\floppy\*.bak" < C:\Belfry\y erase "C:\floppy\bookmarks.mozilla" < C:\Belfry\y erase "C:\floppy\firebird\*.*" < C:\Belfry\y erase "C:\floppy\opera\*.*" < C:\Belfry\y xcopy "%USERPROFILE%\brazee\mphshb0w.slt\bookmarks.html" "c:\floppy\firebird\*.*" /K/Q xcopy "%USERPROFILE%\Application Data\MailwasherPro\*.*" "c:\floppy\MailwasherPro\*.*" /K/Q < c:\belfry\a Xcopy "C:\Documents and Settings\brazee\Application Data\Opera\Opera\profile\*.*" C:\floppy\opera\*.* /K /Q < c:\belfry\a ...
Post Follow-up to this messagePaul H wrote: > Sorry to miss-lead you, Howard. I will be using a USB cable to connect to a > cell phone, not to a memory device. I want to read and write names, phone > numbers, and any other accessible data in the phone. While, when I plus a > digital phone memory card reader into a USB port, it immediately shows as a > memory device, when I plug the phone in, it is ignored. If I could access > it as any file type - byte-stream or whatever, that would be terrific. Bu t > I don't see how. I believe I need to be able to do my own I/O to that por t. > Send my own command strings to the phone and read replies. Any help would > be appreciated. Maybe I can buy a driver from someone? > Thanks, > Paul > MarshalSoft have drivers, or you can use the API as Thane suggested. Donald
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.