Reading data from Serial port: Exception 305500 Un-handled [message #415724] |
Wed, 29 July 2009 01:02 |
RNSidhu
Messages: 8 Registered: July 2009
|
Junior Member |
|
|
Hi All,
I am trying to implement the requirement of reading data from serial port using the code posted on this forum under the topic serial. I am encountering exception 1305500 Un-Handled exception on hold := ole2.get_num_property(CommHandle,'PortOpen');
I actually need an example to retrieve data from port .
Please provide some example.
Regards
RNSidhu
|
|
|
|
Re: Reading data from Serial port: Exception 305500 Un-handled [message #415968 is a reply to message #415950] |
Thu, 30 July 2009 00:26 |
RNSidhu
Messages: 8 Registered: July 2009
|
Junior Member |
|
|
Hi,
I have searched the forum with Serial and CommHandle , but everywhere i see that they encountered Exception 305500 Un-handled but there is no resolution posted for this .I want to know how its been resolved as i am facing the similar problem .
Below is the code i am using :
Declare
CommHandle ole2.obj_type; -- to hold the interface pointer
hold number;
NUM1 number;
string1 Varchar2(2000);
string2 OleVar;
Begin
CommHandle :=
forms_ole.get_interface_pointer'block3.OLE_CONTROL6');
Message(CommHandle);
OLE2.SET_PROPERTY(CommHandle, 'CommPort', 1);
--Num1:=OLE2.GET_num_PROPERTY(CommHandle, 'Commport');
/* try to close COM2, in case it was open for some reason.
0 = FALSE, -1 = TRUE*/
begin
OLE2.SET_PROPERTY(CommHandle, 'PortOpen', 0);--port open
exception
when others then
Message('Port is open');
end;
-- Set device to 9600 baud, no parity, 8 data, and 1 stop bit.
OLE2.SET_PROPERTY(CommHandle, 'Settings', '9600,N,8,1');
-- Open the port. 0 = FALSE, -1 = TRUE
OLE2.SET_PROPERTY(CommHandle, 'PortOpen', -1);
hold := OLE2.GET_num_PROPERTY(CommHandle, 'PortOpen');OLE2.set_PROPERTY(CommHandle,'InBufferSize',1200);
OLE2.SET_PROPERTY(CommHandle, 'InBufferCount', '0');
Exception
When Others Then
Message(SQlcode||sqlerrm);Message(SQlcode||sqlerrm);
End;
The colored statement : GET_NUM_PROPERTY is throwing exception : -3055500 Un-Handled exception.
Please provide me with the solution as to how to read the data from serial port resolving this exception and which property to retrieve to ge the data from the port ?
Regards
RSindhu
|
|
|
|
Re: Reading data from Serial port: Exception 305500 Un-handled [message #416018 is a reply to message #415975] |
Thu, 30 July 2009 03:28 |
RNSidhu
Messages: 8 Registered: July 2009
|
Junior Member |
|
|
Hi David
Thanks for the reply. Yes i have gone through the code present in the form using that only i have written the code.
I have used message and pause also and it throws exception at this line only for 'GET_NUM_PROPERTY'.
Actually it throws this exception whenever i get the value of the property that has been set.
I have gone through the links you have posted but i couldnt get much from them .Mostly examples posted deal with the Excel sheet , pdf etc , so couldnt understand much.
I am using the same form module posted by manoj, it's also throwing exception if i un comment the particular line referring to 'GET_NUM_PROPERTY' .
Kindly provide inputs.
Best Regards
RSidhu
|
|
|
|
Re: Reading data from Serial port: Exception 305500 Un-handled [message #416182 is a reply to message #416150] |
Fri, 31 July 2009 00:41 |
RNSidhu
Messages: 8 Registered: July 2009
|
Junior Member |
|
|
Hi David,
I have gone through these examples but everytime i get exception when i retrive value for the property set. I have removed the multiple setting of 'PortOpen' but still the exception is same when i retrieve value in hold:=OLE2.GET_num_PROPERTY(CommHandle,'PortOpen');
i am not able to check the value of hold because when i get the valeu in this variable it throws exception 305500 Un-handled and comes out.Please advice , Is there any problem in my Forms 6i or its installation , anything else which is required. I have the MSCOMM1 and had used it.
Regards
Roohie
|
|
|
|
|
|
|