Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using MSComm controls

Status
Not open for further replies.

alchemy

Programmer
Oct 12, 2000
9
NZ
Has anybody used the MSComm control in PowerCobol. I can get/set all the control properties except "Input" & "Output", which is what the control is realy about. [sig][/sig]
 
Ok, with a little digging I found that the data type for these two properties is Variant and Cobol won't support this type. I am currently looking at wrapping the MSComm control in a VB ocx but would still like connemts from anybody how can.
[sig][/sig]
 
Alchemy,

I hear you! I have been trying to get MSComm and Greenleafs OCX for simple serial communications to work for about a week now. With Greenleafs OCX commX, I have been able to send data streams to a serial port with success, I'm finding it a little tougher to read data from the RX buffer though. I can remove the data by using "readstring" but have found no way yet to move the data into a variable. Still working on this issue... I have flipped-flopped back and forth using MScomm etc... Would like to know how your testing goes with MSComm. I use V5 Power Cobol from Fujitsu.
Thanks
[sig][/sig]
 
Success! GreenLeaf's OCX commX is working great now. I can use COBOL to send and receive data from serial ports!!!
 
RASI,
Thanks for the tip, I am downloading CommX as I type this. I tried to make an ActiveX control, using VB5 but ran into some problems.

BTW we are using POW4.2 and are looking at going to 5, it it worth the shift?

Thanks

Alchemy
 
Alchemy,

Yes, I would move up to V5. Are you under software maintenace with Fujitus? If yes, this should be free. Also, visit There are patches to V4.2 to fix problems such as (Slow typing in text boxes using the tab control etc). This sample code may save you some dev time..

ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 returnvalue pic s9(5) comp-5.
01 ibuffer pic x(8192) value "success !".
01 obuffer pic x(8192).
PROCEDURE DIVISION.
INVOKE PortCtl1 "Open" RETURNING ReturnValue
move 1 to "LocalEcho" OF portctl1
INVOKE PortCtl1 "WriteString" USING ibuffer RETURNING ReturnValue
INVOKE PortCtl1 "ReadString" USING by value 9 RETURNING obuffer
move obuffer to caption of cmstati
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top