Home » Developer & Programmer » Forms » who dares to give the solution
who dares to give the solution [message #86182] Tue, 07 September 2004 06:58 Go to next message
fanni
Messages: 96
Registered: March 2004
Member
hi every body

i am using mscomm component for reading data from COM PORT connected with a weigh scale.

i have got placed the MSCOMM ocx in my form (of FORMS 6) and have imported its packages

containing all its methods and events.

i got all it functions and procedures but i found only this piece of code under events

package .

--------------------------------------
PACKAGE BODY MSCOMMLib_MSComm_1_EVENTS IS
-- The Events Package:

PROCEDURE /* OnComm */ EVENT1(interface OleObj) IS
BEGIN
 null;
END;
END;
---------------------------------------

whereas i imported the events package for MSCAL.calendar. Its events package shows a

detailed list of events.

How i'll capture different events for mscomm component e.g port open, port close, input ,

output etc.

Moreover i am unable to understand that how ON-DISPATCH-TRIGGER trigger will be used for

MSCOMM.

If any body has idea about it. Please  give me a hint.
I need it on urgent basis.
farhan ashraf
Re: who dares to give the solution [message #86184 is a reply to message #86182] Tue, 07 September 2004 22:08 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
Try this code:

1. Open form
2. Import "MSCOMMLib.MSComm" interface. ( "Program"/"Import OLE Library interface". In OLE importer selected: OLE Classes "MSCOMMLib.MSComm" Method package "IMSComm" )
3. Write the following code:
-- -----------
DECLARE
ovS OleVar;
s varchar2(100);
BEGIN
:item('block3.comport').OCX.MSCOMMLIB.MSCOMM.COMMPORT := 1;
:item('block3.comport').OCX.MSCOMMLIB.MSCOMM.Settings := '9600,N,8,1';
:item('block3.comport').OCX.MSCOMMLIB.MSCOMM.PortOpen := 1;

-- :item('block3.comport').OCX.MSCOMMLIB.MSCOMM.OUTPUT := 'TEST';
s:='ATDP;'||chr(13); -- command for modem
MSCOMMLib_IMSComm.OUTPUT( :item('block3.comport').interface, TO_VARIANT(s) );

:item('block3.comport').OCX.MSCOMMLIB.MSCOMM.InputMode := MSCOMMLIB_CONSTANTS.comInputModeText ;
s:=null;
WHILE s is null LOOP
ovS:=MSCOMMLib_IMSComm.INPUT( :item('block3.comport').interface );
s:=VAR_TO_CHAR( ovS );
END LOOP;

Message( s );
END;

HTH
Regards
Himanshu
Re: who dares to give the solution [message #311933 is a reply to message #86182] Mon, 07 April 2008 07:54 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
hi dear i treid your sample code mscomm pls can u explain me
i wrote this code on when button pressed -trigger
when i run this form and clicked on button error message was there "ole not defined for comport" and one more thing pls clear that things i would be very thankful to u. this sample code which u have pasted in a forum how its works wheither its bringing data in a text file or anyother procedure kindly explain these things because i want to read data from serail either in a oracle table or in a text file pls help me to do that

thanks

owaisuzair2007@yahoo.com

Re: HI DEAR [message #312646 is a reply to message #86182] Wed, 09 April 2008 09:18 Go to previous messageGo to next message
mughal_raja
Messages: 10
Registered: April 2008
Location: italy
Junior Member


HI CAN U HELP ME TO READ DATA FROM SERIAL PORT AND SAVING INTO TABLE OR INA TXT FILE I RED YOUR CODING ITS QUITE USEFUL BUT I NEED THE FULL DETAIL HOW TO RECEIVE DATA INTO THE TABLE

THANKING
RAJA
Re: HI DEAR [message #312829 is a reply to message #312646] Wed, 09 April 2008 20:20 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
To other people, look at http://www.orafaq.com/forum/mv/msg/100493/312441/67467/#msg_312441

David
Re: who dares to give the solution [message #556326 is a reply to message #86182] Fri, 01 June 2012 16:50 Go to previous messageGo to next message
ieteeman
Messages: 1
Registered: June 2012
Location: Cairo
Junior Member
Himanshu

Please Explain That Code

Regards...
Re: who dares to give the solution [message #556328 is a reply to message #556326] Fri, 01 June 2012 17:22 Go to previous message
cookiemonster
Messages: 13925
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'm afraid Himanshu hasn't visited this site since 2005, so you're unlikely to get an answer from him.
Previous Topic: Not entering into a block(non-database block)
Next Topic: READ DATA FROM EXCEL
Goto Forum:
  


Current Time: Fri Jul 05 22:16:17 CDT 2024