Home » Developer & Programmer » Forms » Getting data in Forms from a weighing bridge through MSCOMM32.OCX (Form6i 32bit Windows XP)
Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #554053] Thu, 10 May 2012 02:48 Go to next message
Sporadic
Messages: 14
Registered: January 2007
Location: Faisalabad
Junior Member

Dear Oracle Gurus,

I want to get the data from a weighing bridge in Oracle Forms 6i, directly using comm port or serial port.
I am using MSCOMM32.OCX and importing its library, making functions, but couldnot get any solution, It gives me an Oracle Form Error FRM-41344: OLE object not defined for MSCOMMCONTROL in current record. On Clicking ok I got another forms error FRM-40738: Argument 1 to built in Get_OlE_Num cannot be Null.

I had tried to insert object by right clicking it, but the problem still reside.

I had searched this forum for MSCOMM32.OCX, getting data from serial port, CommHandler, MSCOMMCONTROL, etc. for the last week to get the solution. But I couldn't get any solution, I used the form from Manoj, I checked out the OTN Forum also, and google this issue, but failed to get the solution. My form is attached below. If anyone can give me the complete solution, with the form I shall be highly appreciate it, and will be thankful to him.

Please give me some suitable solutions.

Best Regards
  • Attachment: wt.fmb
    (Size: 312.00KB, Downloaded 545 times)
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #554064 is a reply to message #554053] Thu, 10 May 2012 04:12 Go to previous messageGo to next message
Littlefoot
Messages: 19711
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Now and then, I saw people discussing (or, at least, asking) a similar problem. Here are the search results. Review them and, possibly, broaden the search with new/different keywords.

As of myself - sorry, I never did that and can't provide any assistance.
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #554397 is a reply to message #554064] Mon, 14 May 2012 02:46 Go to previous messageGo to next message
Sporadic
Messages: 14
Registered: January 2007
Location: Faisalabad
Junior Member

Anybody please help, I am not able to getting the data.
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #554427 is a reply to message #554397] Mon, 14 May 2012 07:43 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
what error your getting and which weigting bridge you are using brand name did u confirmed wheither weight scale or what ever device able to pass data on comm/serial port




baba



Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #554444 is a reply to message #554427] Mon, 14 May 2012 09:41 Go to previous messageGo to next message
Sporadic
Messages: 14
Registered: January 2007
Location: Faisalabad
Junior Member

And finally, I am successful in getting data in the form from serial port and weigh bridge. This error was due to the serial port, is not available on my laptop (basically i was using usb to comm port converter), then I use some other desktop system having builtin serial port.
Then I was facing problem about bit rate, then I connected with hyper terminal, on it, it is also not sending the data, then i contacted vendor, he gave me exact bit rate, on which the weigh scale sending data on the serial port, setting all the parameters I got the data on the form.

Any body need help about it, can contact me on this forum.

Thanks all for helping me.
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #554458 is a reply to message #554444] Mon, 14 May 2012 12:11 Go to previous messageGo to next message
Littlefoot
Messages: 19711
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Cool. You are the first one who reported that he actually made it work. Congratulations!

If it is not a problem (and you have some time to spare), write a walkthrough and post it here. Doing so, we would be able to point people to your topic because - as I said - they DO ask such questions and there's no precise answer.
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #554677 is a reply to message #554458] Wed, 16 May 2012 08:09 Go to previous messageGo to next message
Sporadic
Messages: 14
Registered: January 2007
Location: Faisalabad
Junior Member

Yeah, It will be an honor for me to guide the person, who are feeling problem in this.

First I install MSCOMM32.ocx in windows/system32 folder.

Then Make is register with regsvr32 command.

Then open a new form, import Ole library from program menu.

All the procedures and functions are imported.

Then on layout editor, created an ole container, by double clicking I set the OLE class to Mscomm.comm1.lib

Then i right click on the ole object and add mscomm32.ocx control by inserting object.


Create a button, and create timer, (all coding is available in the form)

create a procedure to get the data from comm port, and call it in when-timer-expired trigger.

The most important thing, which kept me in problem was the attributes by which the weigh bridge sent the data to comm port.

This will be available on weigh bridge manual.

Anyways, before running the form, check the hyper terminal, whether it is getting the data from the weigh bridge.

It will also get the data on the same parameters, like bits per second, parity etc.

After confirmation, you can run the form, your form will also getting the data.

In case of problem, you can also share with me, and the form is attached in previous posts is the right form, it will get the data, only set the parameters according to the parameters of the weigh bridge.

Regards.






Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #554701 is a reply to message #554677] Wed, 16 May 2012 10:56 Go to previous messageGo to next message
Littlefoot
Messages: 19711
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Thank you!
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #580688 is a reply to message #554701] Tue, 26 March 2013 18:30 Go to previous messageGo to next message
CARLOSTHX
Messages: 5
Registered: March 2013
Location: Cancun
Junior Member
Hi everybody, i have same problem... when run the form at start show the FRM-41344 error, i download the wt.fmb file, but i can't read data from com1, please help me Sad
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #580705 is a reply to message #580688] Wed, 27 March 2013 02:02 Go to previous messageGo to next message
Littlefoot
Messages: 19711
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Did you follow Sporadic's instructions (dated 16 May 2012)?
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #580771 is a reply to message #580705] Wed, 27 March 2013 19:21 Go to previous messageGo to next message
CARLOSTHX
Messages: 5
Registered: March 2013
Location: Cancun
Junior Member
Yes i did, i think that the problem is my Windows 7 64 bits, because i run the same form on Windows XP 32 bits and it's OK without FRM-41344 error. But i can't read data from COM1, GROSS TextBox Item remains NULL.

Why?
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #580782 is a reply to message #580771] Thu, 28 March 2013 02:06 Go to previous messageGo to next message
Sporadic
Messages: 14
Registered: January 2007
Location: Faisalabad
Junior Member

change the parameters of the form according to the weigh bridge terminal and to that it is getting weight in Hyper Terminal.
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #583013 is a reply to message #580782] Wed, 24 April 2013 17:45 Go to previous messageGo to next message
CARLOSTHX
Messages: 5
Registered: March 2013
Location: Cancun
Junior Member
i did it! i did it! Laughing i'm not using mscomm32, i got it with java code, thank you my friends.
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #583022 is a reply to message #583013] Thu, 25 April 2013 00:03 Go to previous messageGo to next message
Littlefoot
Messages: 19711
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, congratulations! If possible, describe what you did and how so that someone else might benefit from your experience.
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #583699 is a reply to message #554444] Fri, 03 May 2013 03:41 Go to previous messageGo to next message
rk_2807
Messages: 1
Registered: December 2007
Location: LUDHIANA
Junior Member

hi dear, me need your help, can u attached your form for get weight from weighing scale.
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #586604 is a reply to message #583699] Fri, 07 June 2013 17:43 Go to previous messageGo to next message
CARLOSTHX
Messages: 5
Registered: March 2013
Location: Cancun
Junior Member
Sorry for the delay & my poor english! Well, first step: Create a java class using javax.comm, in my case i use the "$" protocol for my scale simulator. Then create a jar package with this class and import it in your form module.

Caution: you should have installed JDK 1.2.2 only, with other versions, not run Sad

I use forms 6i.


/**
 * Escribir un dato en el puerto COM15
 * @autor Carlos_Lucio Abril 11 de 2013
 */

import java.io.IOException;
//import java.io.OutputStream;
import java.io.InputStream;
import javax.comm.CommPortIdentifier;
import javax.comm.SerialPort;
import javax.comm.PortInUseException;
import javax.comm.NoSuchPortException;

public class Bascula
{
	public static String GetPeso() throws Exception
	{
		byte[] buffer = new byte[16];
		String peso=null;
		
//		OutputStream out = null;
		InputStream in = null;
	
       	SerialPort com15;
//     	String mensaje = "$\r\n";

			try
			{
				
				com15 = (SerialPort) CommPortIdentifier.getPortIdentifier("COM15").open( "Bascula Java", 500 );
				com15.setSerialPortParams( 2400, SerialPort.DATABITS_7, SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN );
 			

//				out = com15.getOutputStream();
	 			in = com15.getInputStream();

				do
				{

// 			   		out.write( mensaje.getBytes() );
    		
  		  			in.read(buffer);
// 		  			System.out.println( "Bandera"+in.available() );    	
  		  	    						
    				peso = new String(buffer,0,16);
    		
					
      		 	}while(!(((buffer[0]=='O'&&buffer[1]=='L')||(buffer[0]=='S'&&buffer[1]=='T')||(buffer[0]=='U'&&buffer[1]=='S'))&&(buffer[14]=='k'&&buffer[15]=='g')));

	       	
				in.close();
	       		com15.close();

			}
			catch( NoSuchPortException exc )
			{
				System.out.println( "El puerto COM15 no existe en el sistema... Error 01" );
				peso = "E01";
			}
			catch( PortInUseException exc )
 	   		{
  		   		System.out.println( "El puerto COM15 esta en uso... Error 02" );
  		   		peso = "E02";
   	   		}
       		catch( IOException exc )
     		{
    	 		System.out.println( "Error de I/O... Error 03" );
    	 		peso ="E03";
     		}
			
		return peso;
	}    

	public static void main( String args[] )
   	{
		String pesaje;
		try
		{
			pesaje = GetPeso();
			System.out.println( "Cadena de caracteres desde el puerto COM15: "+pesaje);
		}
		catch ( Exception e )
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
	}
}


Thank you for all
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #586672 is a reply to message #586604] Sun, 09 June 2013 06:50 Go to previous messageGo to next message
Littlefoot
Messages: 19711
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Thank you very much!
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #588745 is a reply to message #586672] Thu, 27 June 2013 21:04 Go to previous messageGo to next message
anil_mishra.2010@yahoo.com
Messages: 3
Registered: June 2013
Location: India
Junior Member
I want to get data from weighbridge in oracle form 6i but I have no any idea please help me.
Regards,
Anil
  • Attachment: wt.fmb
    (Size: 316.00KB, Downloaded 134 times)
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #588747 is a reply to message #588745] Thu, 27 June 2013 23:57 Go to previous messageGo to next message
Littlefoot
Messages: 19711
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I believe you'd get an idea if you read the whole discussion. Two members reported they managed to do that, described what they did, provided some code, so - how come all of these made you say "no idea"?
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #588777 is a reply to message #588747] Fri, 28 June 2013 05:36 Go to previous messageGo to next message
anil_mishra.2010@yahoo.com
Messages: 3
Registered: June 2013
Location: India
Junior Member
Dear Sir,

Please tell me the solution of my question that how can I get data from weighbridge in to oracle form.
Please tell me all steps & also tell me that where I shall have to change the parameter.
I request you to kindly tell me your mobile no to get support.

Thanking you,

With best regards,
Anil
anil_Mishra.2010@yahoo.com

[Updated on: Fri, 28 June 2013 05:38]

Report message to a moderator

Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #588783 is a reply to message #588777] Fri, 28 June 2013 06:33 Go to previous messageGo to next message
cookiemonster
Messages: 11089
Registered: September 2008
Location: Rainy Manchester
Senior Member
anil_mishra.2010 wrote on Fri, 28 June 2013 11:36
I request you to kindly tell me your mobile no to get support.


Do you really think anyone here is going to give out their phone number to a random stranger on the internet?
Not going to happen.

If you want someone at the end of the phone to offer support hire a contractor.
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #588847 is a reply to message #588783] Fri, 28 June 2013 17:51 Go to previous messageGo to next message
CARLOSTHX
Messages: 5
Registered: March 2013
Location: Cancun
Junior Member
Hi Anil! i can help you, but only if you are patient because i don't speak english very well, i'm from mexico Wink. Well man, tell me your problem and let me analize it.

I resolved my problem using java code, the form that you attached for me was useless, note: only in my case.

So,first step download this:

1.- ECLIPSE 1.0 (IDE for java)
2.- Virtual Serial Ports Emulator (if the scale or weighbridge its away from your work of place) this program let to you simulate a COM1 serial port (virtual) for your tests.
3.- JDK 1.2.2 release 17
4.- Uninstall all JDKA, JRE, Java versions in your developer machine

Well man, first use the java code in previous messages, i uploaded my solution, for my particular case: one scale machine that get the weigh throuhg the RS232 cable, when the PC send '$' character ($ protocolo), some scales the information that you have to send to the PC -> wheigh machine may be the some string for example "C0", "F0" anyway, you have to read the technical user for to know your scale Wink

When you can run the java program with the right information then make a jar file with the java classes and import it in your oracle forms 6i. Befero ensure that the environment variables are setting.

CLASSPATH:
;C:\orant\TOOLS\COMMON60\JAVA\IMPORTER.JAR;C:\Proyectos\JAVA\javax_comm\comm.jar;C:\Proyectos\JAVA\javax_comm\rt.jar;C:\Proyectos\JAV A\javax_comm\Bascula.jar;

PATH:
C:\orant\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Program Files\Intel\DMIX;C:\Program Files\Intel\Services\IPT\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\orant\jdk\bin;C:\Program Files\JavaSoft\JRE\1.2\bin\classic;C:\jdk1.2.2\bin;

In many forums there are more information about this point, because my poor english i can't deep on it.

Now, go to Forms and import the java class (FILE.jar) was you created.

And automatically Forms make the Program Units in your Module.fmb.

I hope I have been helpful my comments

I can not give my mobile phone by being personal but if you give me your email I can add you to skype.

Saludos!!!
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #588850 is a reply to message #588847] Fri, 28 June 2013 20:19 Go to previous messageGo to next message
anil_mishra.2010@yahoo.com
Messages: 3
Registered: June 2013
Location: India
Junior Member
Respected Sir,
First I want to give you lot of thanks for immediate reply.
Now I have to ask you, that you have written that----
----------------------------------------------------------------------------------------------------------------------------
first step download this:
1.- ECLIPSE 1.0 (IDE for java)
2.- Virtual Serial Ports Emulator (if the scale or weighbridge its away from your work of place) this program let to you simulate a COM1 serial port (virtual) for your tests.
3.- JDK 1.2.2 release 17
4.- Uninstall all JDKA, JRE, Java versions in your developer machine
----------------------------------------------------------------------------------------------------
CLASSPATH:
;C:\orant\TOOLS\COMMON60\JAVA\IMPORTER.JAR;C:\Proyectos\JAVA\javax_comm\comm.jar;C:\Proyectos\JAVA\javax_comm\rt.jar;C:\Proyectos\JAV A\javax_comm\Bascula.jar;

PATH:
C:\orant\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Program Files\Intel\DMIX;C:\Program Files\Intel\Services\IPT\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\orant\jdk\bin;C:\Program Files\JavaSoft\JRE\1.2\bin\classic;C:\jdk1.2.2\bin;
--------------------------------------------------------------------------------------------------------------------
Now, go to Forms and import the java class (FILE.jar) was you created.
And automatically Forms make the Program Units in your Module.fmb.
----------------------------------------------------------------------------------------------------------------

Respected Sir,
My question is that...

>>>In the first step after the downloading ECLIPSE 1.0 (IDE for java)
,Virtual Serial Ports Emulator (if the scale or weighbridge its away from your work of place) this program let to you simulate a COM1 serial port (virtual) for your tests.,JDK 1.2.2 release 17 & unistalation of all JDKA, JRE, Java versions from our developer machine what I have to do?

>>>Where & how I use the java code of previous messages? because I have no complete knowledge about java.


>>>>>>How to set the ..
CLASSPATH:
;C:\orant\TOOLS\COMMON60\JAVA\IMPORTER.JAR;C:\Proyectos\JAVA\javax_comm\comm.jar;C:\Proyectos\JAVA\javax_comm\rt.jar;C:\Proyectos\JAV A\javax_comm\Bascula.jar;

PATH:
C:\orant\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Program Files\Intel\DMIX;C:\Program Files\Intel\Services\IPT\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\orant\jdk\bin;C:\Program Files\JavaSoft\JRE\1.2\bin\classic;C:\jdk1.2.2\bin;

How I create java class (FILE.jar) and import the java class (FILE.jar).

What & where code/sql have to write on the form 6i.

I am using windows 7,32bit & our system is of Dell company in which there is no any COM1 serial port.

My Email Id is : anil_mishra.2010@yahoo.com
How I contact to you?
Once again please mention all the step by step & if it is possible please send me your form with java class which you have designed for self.

I hope you will help me till the solution of my problem.

Thanking you,
With best regards,
Anil





Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #607852 is a reply to message #554444] Wed, 12 February 2014 11:32 Go to previous messageGo to next message
Osamaosama8
Messages: 2
Registered: February 2014
Location: asdccc
Junior Member
Dear SR,
Is it Work with you?, Could you please Share your .Fmb File
my Email :Support@iteline.com
Thanks.
Re: Getting data in Forms from a weighing bridge through MSCOMM32.OCX [message #611727 is a reply to message #607852] Tue, 08 April 2014 02:45 Go to previous message
usmanajaz
Messages: 1
Registered: April 2014
Location: Karachi
Junior Member
Dear All,

I am facing the similar issue when trying to capture the weight in oracle form 6i it show me the error (100503 : Non Oracle Expression) then i debug the form found that the function in PACKAGE BODY MSCOMMLib_IMSComm given the error. I have also test in real time.

FUNCTION PortOpen(interface OleObj) RETURN NUMBER IS
my_new_value NUMBER;
BEGIN
my_new_value := Get_Ole_Num(interface, 20); this is creating the problem...
return my_new_value;
End;


--Kindly explain the reason for this issue and also suggest the fix for that issue.
Thanks,
Usman
Previous Topic: Passing DATA_PARAMETER in Oracle Reports 10g from Oracle Forms using RUN_REPORT_OBJECT
Next Topic: Save Images in Database From Forms - Download it Here
Goto Forum:
  


Current Time: Fri Oct 31 23:47:35 CDT 2014

Total time taken to generate the page: 0.06789 seconds