Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Read/Write USB with MFC NE 3.1?
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



Report this thread to moderator Post Follow-up to this message
Old Post
Paul H
03-27-04 03:59 AM


Re: Read/Write USB with MFC NE 3.1?
"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 ?

Report this thread to moderator Post Follow-up to this message
Old Post
Richard
03-27-04 03:59 AM


Re: Read/Write USB with MFC NE 3.1?
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

Report this thread to moderator Post Follow-up to this message
Old Post
Thane Hubbell
03-27-04 03:59 AM


Re: Read/Write USB with MFC NE 3.1?
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>...
> 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



Report this thread to moderator Post Follow-up to this message
Old Post
Paul H
03-27-04 03:59 AM


Re: Read/Write USB with MFC NE 3.1?
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 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.

Report this thread to moderator Post Follow-up to this message
Old Post
Howard Brazee
03-27-04 03:59 AM


Re: Read/Write USB with MFC NE 3.1?
Hi 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.



Report this thread to moderator Post Follow-up to this message
Old Post
Paul H
03-27-04 03:59 AM


Re: Read/Write USB with MFC NE 3.1?
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 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
...

Report this thread to moderator Post Follow-up to this message
Old Post
Howard Brazee
03-27-04 03:59 AM


Re: Read/Write USB with MFC NE 3.1?
I 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>... 

Report this thread to moderator Post Follow-up to this message
Old Post
Thane Hubbell
03-27-04 03:59 AM


Re: Read/Write USB with MFC NE 3.1?
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.  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
...



Report this thread to moderator Post Follow-up to this message
Old Post
Paul H
03-27-04 03:59 AM


Re: Read/Write USB with MFC NE 3.1?
Paul 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


Report this thread to moderator Post Follow-up to this message
Old Post
Donald Tees
03-27-04 03:59 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:04 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.