Home » Developer & Programmer » Forms » how to get weight in oracle forms from weighment machine (win xp, oracle 8i, forms 6i)
how to get weight in oracle forms from weighment machine [message #334282] Wed, 16 July 2008 01:24 Go to next message
goharshamke@yahoo.com
Messages: 14
Registered: July 2008
Junior Member
Hello!

how to get weight in oracle forms from weighment machine

Help and oblige

Khalid Gohar
Re: how to get weight in oracle forms from weighment machine [message #334286 is a reply to message #334282] Wed, 16 July 2008 01:44 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Didn't you ask this some while back?
I recognize the level of detail in your question..
Re: how to get weight in oracle forms from weighment machine [message #334297 is a reply to message #334286] Wed, 16 July 2008 02:15 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
That's what I thought, but IP addresses are different.
Re: how to get weight in oracle forms from weighment machine [message #334344 is a reply to message #334286] Wed, 16 July 2008 04:48 Go to previous messageGo to next message
goharshamke@yahoo.com
Messages: 14
Registered: July 2008
Junior Member
I could not found any solution please help
Re: how to get weight in oracle forms from weighment machine [message #334360 is a reply to message #334344] Wed, 16 July 2008 05:11 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
How is this machine connected to your workstation?
How can you get data in other applications? For example, can you see the data in Notepad or vi?
Barcode-scanners work like a keyboard when attached to a computer; I can't tell from your exhaustive problem description how your machine works.
Re: how to get weight in oracle forms from weighment machine [message #334441 is a reply to message #334360] Wed, 16 July 2008 09:03 Go to previous messageGo to next message
goharshamke@yahoo.com
Messages: 14
Registered: July 2008
Junior Member
there is weighment scale which shows weight of vehicles on its own screen. I want to get this weight into my oracle forms application.
Re: how to get weight in oracle forms from weighment machine [message #334469 is a reply to message #334441] Wed, 16 July 2008 11:32 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There's a weighing machine.
It has a scale and displays the result on the screen.
You can read these numbers using your own eyes.

Is the weighing machine capable of sending the result elsewhere, or is the screen its only output device?

If the latter, you're probably out of luck.

If there is a way to read the result (wireless transmission, a serial cable which can be connected to your keyboard, etc.), there might be a way to do that.

So, what's the rest of your story?
Re: how to get weight in oracle forms from weighment machine [message #334473 is a reply to message #334441] Wed, 16 July 2008 12:10 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
goharshamke@yahoo.com wrote on Wed, 16 July 2008 16:03
there is weighment scale which shows weight of vehicles on its own screen. I want to get this weight into my oracle forms application.

You are not a developer, are you? No problem if you are not, but better tell that upfront because the answers you might get would differ.
Re: how to get weight in oracle forms from weighment machine [message #334722 is a reply to message #334469] Thu, 17 July 2008 15:01 Go to previous messageGo to next message
goharshamke@yahoo.com
Messages: 14
Registered: July 2008
Junior Member
A serial cable can be connected to our computer to get data.

Problems is how to get the data on weighing scale into our computer in oracle forms.
Re: how to get weight in oracle forms from weighment machine [message #334728 is a reply to message #334722] Thu, 17 July 2008 15:18 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There's no doubt that you can connect a cable to one of serial ports on your computer. Question is whether you can connect the other side of the same cable into the weighing machine?
Re: how to get weight in oracle forms from weighment machine [message #334731 is a reply to message #334722] Thu, 17 July 2008 15:24 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Forget about Forms for a while.
Get to the manufacturar of the scales and ask him how to communicate with the beast. Do NOT mention Forms, as he will most probably don't know how to do it.
Ask him how to get the results into a textfile or as if it was read from a keyboard.
Re: how to get weight in oracle forms from weighment machine [message #335011 is a reply to message #334728] Sat, 19 July 2008 06:43 Go to previous messageGo to next message
goharshamke@yahoo.com
Messages: 14
Registered: July 2008
Junior Member
computer and weighing scale can be connected through serial cable.
Re: how to get weight in oracle forms from weighment machine [message #335026 is a reply to message #335011] Sat, 19 July 2008 11:23 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
That was not what we asked.
How can you get data from the machine into (eg) Notepad/vi?
Re: how to get weight in oracle forms from weighment machine [message #538692 is a reply to message #335026] Mon, 09 January 2012 01:29 Go to previous messageGo to next message
usman goraya
Messages: 9
Registered: December 2011
Junior Member
Hi,

I have the similar requirement. Currently a com port is attached with my computer and weight is being interfaced from weighbridge. Now I have been able to interface it to my oracle customized form through a c+ program geting the weight on to a text file and my customized form is designed tto pick the weight from that text file. But this process is very basic and I want to refine it. we are using oracle forms 10g and form is integrated in EBS R12.1.2

BR
Re: how to get weight in oracle forms from weighment machine [message #538696 is a reply to message #538692] Mon, 09 January 2012 01:35 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You managed to get a value into a text file - that's great!

Quote:

But this process is very basic and I want to refine it

Does it work correctly? You know what Murphy says ... don't fix what ain't broken.

Anyway, it is difficult to say anything if you don't tell us how that "very basic" process looks like and the way you'd like to "refine" it.
Re: how to get weight in oracle forms from weighment machine [message #538697 is a reply to message #538696] Mon, 09 January 2012 01:38 Go to previous messageGo to next message
usman goraya
Messages: 9
Registered: December 2011
Junior Member
we are still in development mode, it does work correctly but I want that form can read it directly through port.
Re: how to get weight in oracle forms from weighment machine [message #538699 is a reply to message #538697] Mon, 09 January 2012 01:44 Go to previous messageGo to next message
usman goraya
Messages: 9
Registered: December 2011
Junior Member
I will brief you on the basic version:

Weight is interfaced from weighbridge on to host through a com port, a c+ programe captures that weight and writes it onto a text file, at the customized form (integrated with EBS R12.1.2) I have made a get weight button which the user clicks and the weight is picked from that text file on to our form.

Now, my requirement is to bypass that text file somehow and get the weight directly on to my customized form

BR
Re: how to get weight in oracle forms from weighment machine [message #538896 is a reply to message #538699] Tue, 10 January 2012 04:59 Go to previous messageGo to next message
usman goraya
Messages: 9
Registered: December 2011
Junior Member
an earlier response would be highly appreciated.
Re: how to get weight in oracle forms from weighment machine [message #538931 is a reply to message #538896] Tue, 10 January 2012 07:34 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Sorry, but I wouldn't know how to do that directly.
Re: how to get weight in oracle forms from weighment machine [message #539040 is a reply to message #538931] Wed, 11 January 2012 00:46 Go to previous messageGo to next message
usman goraya
Messages: 9
Registered: December 2011
Junior Member
I have heard that there is a solution for this in JAVA, anyone think so?
Re: how to get weight in oracle forms from weighment machine [message #539049 is a reply to message #539040] Wed, 11 January 2012 02:43 Go to previous messageGo to next message
Littlefoot
Messages: 21805
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
May be; or ActiveX, as far as Google says. Check this OTN Forms forum discussion (and search for some more by yourself) (also, Google for keywords you found in there). Best of luck!

If you ever manage to do that, please, come back and explain the way you did that; I'm sure that many people will find it useful.
Re: how to get weight in oracle forms from weighment machine [message #540873 is a reply to message #539049] Thu, 26 January 2012 07:40 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
dear
try to use mscomm object it is very easy to get data from atleast comm port to your oracle form 6i by using MSCOMM




[Updated on: Thu, 26 January 2012 07:44]

Report message to a moderator

Re: how to get weight in oracle forms from weighment machine [message #540890 is a reply to message #540873] Thu, 26 January 2012 08:53 Go to previous messageGo to next message
usman goraya
Messages: 9
Registered: December 2011
Junior Member
Dear Owais

we are using forms 10g and are on EBS R12 can mscomm work with it as well
Re: how to get weight in oracle forms from weighment machine [message #540891 is a reply to message #540890] Thu, 26 January 2012 08:54 Go to previous messageGo to next message
usman goraya
Messages: 9
Registered: December 2011
Junior Member
so far i have been able to do it through text file only..
Re: how to get weight in oracle forms from weighment machine [message #541056 is a reply to message #540891] Fri, 27 January 2012 06:07 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
that's good but its better just embedded java code

Most projects that deal with hardware and devices, needs to communicate with them using the COM port of the PC or Server. For example if there is a modem that is connected to a server via its COM port and the Java program has to read the output of the modem then the Java program has to read the COM port for any incoming data.

This sample Java program can be used to Read from a COM port for incoming data and process it. Note that you will need to change the Port number to COM1 or COM2 or any other ports as required.

import java.io.*;
import java.util.*;
import javax.comm.*;

public class SimpleRead implements Runnable, SerialPortEventListener {
static CommPortIdentifier portId;
static Enumeration portList;

InputStream inputStream;
SerialPort serialPort;
Thread readThread;

public static void main(String[] args) {
portList = CommPortIdentifier.getPortIdentifiers();

while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (portId.getName().equals("COM1")) {
// if (portId.getName().equals("/dev/term/a")) {
SimpleRead reader = new SimpleRead();
}
}
}
}

public SimpleRead() {
try {
serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
} catch (PortInUseException e) {System.out.println(e);}
try {
inputStream = serialPort.getInputStream();
} catch (IOException e) {System.out.println(e);}
try {
serialPort.addEventListener(this);
} catch (TooManyListenersException e) {System.out.println(e);}
serialPort.notifyOnDataAvailable(true);
try {
serialPort.setSerialPortParams(9600,
SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {System.out.println(e);}
readThread = new Thread(this);
readThread.start();
}

public void run() {
try {
Thread.sleep(20000);
} catch (InterruptedException e) {System.out.println(e);}
}

public void serialEvent(SerialPortEvent event) {
switch(event.getEventType()) {
case SerialPortEvent.BI:
case SerialPortEvent.OE:
case SerialPortEvent.FE:
case SerialPortEvent.PE:
case SerialPortEvent.CD:
case SerialPortEvent.CTS:
case SerialPortEvent.DSR:
case SerialPortEvent.RI:
case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
break;
case SerialPortEvent.DATA_AVAILABLE:
byte[] readBuffer = new byte[20];

try {
while (inputStream.available() > 0) {
int numBytes = inputStream.read(readBuffer);
}
System.out.print(new String(readBuffer));
} catch (IOException e) {System.out.println(e);}
break;
}
}
}

---------------------------END---------------------

-----------------------------SERIAL COMMUNICATION---------------

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Enumeration;
import java.util.HashMap;

import javax.comm.CommPort;
import javax.comm.CommPortIdentifier;
import javax.comm.NoSuchPortException;
import javax.comm.ParallelPort;
import javax.comm.PortInUseException;
import javax.comm.SerialPort;
import javax.comm.UnsupportedCommOperationException;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
* Open a serial port using Java Communications.
*
* @author Ian F. Darwin, http://www.darwinsys.com/
*/
public class CommPortOpen {
/** How long to wait for the open to finish up. */
public static final int TIMEOUTSECONDS = 30;
/** The baud rate to use. */
public static final int BAUD = 19200;
/** The parent JFrame, for the chooser. */
protected JFrame parent;
/** The input stream */
protected BufferedReader is;
/** The output stream */
protected PrintStream os;
/** The chosen Port Identifier */
CommPortIdentifier thePortID;
/** The chosen Port itself */
CommPort thePort;

public static void main(String[] argv)
throws IOException, NoSuchPortException, PortInUseException,
UnsupportedCommOperationException {

new CommPortOpen(null).converse();

System.exit(0);
}

/* Constructor */
public CommPortOpen(JFrame f)
throws IOException, NoSuchPortException, PortInUseException,
UnsupportedCommOperationException {

// Use the PortChooser from before. Pop up the JDialog.
PortChooser chooser = new PortChooser(null);

String portName = null;
do {
chooser.setVisible(true);

// Dialog done. Get the port name.
portName = chooser.getSelectedName();

if (portName == null)
System.out.println("No port selected. Try again.\n");
} while (portName == null);

// Get the CommPortIdentifier.
thePortID = chooser.getSelectedIdentifier();

// Now actually open the port.
// This form of openPort takes an Application Name and a timeout.
//
System.out.println("Trying to open " + thePortID.getName() + "...");

switch (thePortID.getPortType()) {
case CommPortIdentifier.PORT_SERIAL:
thePort = thePortID.open("DarwinSys DataComm",
TIMEOUTSECONDS * 1000);
SerialPort myPort = (SerialPort) thePort;

// set up the serial port
myPort.setSerialPortParams(BAUD, SerialPort.DATABITS_8,
SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
break;

case CommPortIdentifier.PORT_PARALLEL:
thePort = thePortID.open("DarwinSys Printing",
TIMEOUTSECONDS * 1000);
ParallelPort pPort = (ParallelPort)thePort;

// Tell API to pick "best available mode" - can fail!
// myPort.setMode(ParallelPort.LPT_MODE_ANY);

// Print what the mode is
int mode = pPort.getMode();
switch (mode) {
case ParallelPort.LPT_MODE_ECP:
System.out.println("Mode is: ECP");
break;
case ParallelPort.LPT_MODE_EPP:
System.out.println("Mode is: EPP");
break;
case ParallelPort.LPT_MODE_NIBBLE:
System.out.println("Mode is: Nibble Mode.");
break;
case ParallelPort.LPT_MODE_PS2:
System.out.println("Mode is: Byte mode.");
break;
case ParallelPort.LPT_MODE_SPP:
System.out.println("Mode is: Compatibility mode.");
break;
// ParallelPort.LPT_MODE_ANY is a "set only" mode;
// tells the API to pick "best mode"; will report the
// actual mode it selected.
default:
throw new IllegalStateException("Parallel mode " +
mode + " invalid.");
}
break;
default: // Neither parallel nor serial??
throw new IllegalStateException("Unknown port type " + thePortID);
}

// Get the input and output streams
// Printers can be write-only
try {
is = new BufferedReader(new InputStreamReader(thePort.getInputStream()));
} catch (IOException e) {
System.err.println("Can't open input stream: write-only");
is = null;
}
os = new PrintStream(thePort.getOutputStream(), true);
}

/** This method will be overridden by non-trivial subclasses
* to hold a conversation.
*/
protected void converse() throws IOException {

System.out.println("Ready to read and write port.");

// Input/Output code not written -- must subclass.

// Finally, clean up.
if (is != null)
is.close();
os.close();
}
}
class PortChooser extends JDialog implements ItemListener {
/** A mapping from names to CommPortIdentifiers. */
protected HashMap map = new HashMap();
/** The name of the choice the user made. */
protected String selectedPortName;
/** The CommPortIdentifier the user chose. */
protected CommPortIdentifier selectedPortIdentifier;
/** The JComboBox for serial ports */
protected JComboBox serialPortsChoice;
/** The JComboBox for parallel ports */
protected JComboBox parallelPortsChoice;
/** The JComboBox for anything else */
protected JComboBox other;
/** The SerialPort object */
protected SerialPort ttya;
/** To display the chosen */
protected JLabel choice;
/** Padding in the GUI */
protected final int PAD = 5;

/** This will be called from either of the JComboBoxen when the
* user selects any given item.
*/
public void itemStateChanged(ItemEvent e) {
// Get the name
selectedPortName = (String)((JComboBox)e.getSource()).getSelectedItem();
// Get the given CommPortIdentifier
selectedPortIdentifier = (CommPortIdentifier)map.get(selectedPortName);
// Display the name.
choice.setText(selectedPortName);
}

/* The public "getter" to retrieve the chosen port by name. */
public String getSelectedName() {
return selectedPortName;
}

/* The public "getter" to retrieve the selection by CommPortIdentifier. */
public CommPortIdentifier getSelectedIdentifier() {
return selectedPortIdentifier;
}

/** A test program to show up this chooser. */
public static void main(String[] ap) {
PortChooser c = new PortChooser(null);
c.setVisible(true); // blocking wait
System.out.println("You chose " + c.getSelectedName() +
" (known by " + c.getSelectedIdentifier() + ").");
System.exit(0);
}

/** Construct a PortChooser --make the GUI and populate the ComboBoxes.
*/
public PortChooser(JFrame parent) {
super(parent, "Port Chooser", true);

makeGUI();
populate();
finishGUI();
}

/** Build the GUI. You can ignore this for now if you have not
* yet worked through the GUI chapter. Your mileage may vary.
*/
protected void makeGUI() {
Container cp = getContentPane();

JPanel centerPanel = new JPanel();
cp.add(BorderLayout.CENTER, centerPanel);

centerPanel.setLayout(new GridLayout(0,2, PAD, PAD));

centerPanel.add(new JLabel("Serial Ports", JLabel.RIGHT));
serialPortsChoice = new JComboBox();
centerPanel.add(serialPortsChoice);
serialPortsChoice.setEnabled(false);

centerPanel.add(new JLabel("Parallel Ports", JLabel.RIGHT));
parallelPortsChoice = new JComboBox();
centerPanel.add(parallelPortsChoice);
parallelPortsChoice.setEnabled(false);

centerPanel.add(new JLabel("Unknown Ports", JLabel.RIGHT));
other = new JComboBox();
centerPanel.add(other);
other.setEnabled(false);

centerPanel.add(new JLabel("Your choice:", JLabel.RIGHT));
centerPanel.add(choice = new JLabel());

JButton okButton;
cp.add(BorderLayout.SOUTH, okButton = new JButton("OK"));
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PortChooser.this.dispose();
}
});

}

/** Populate the ComboBoxes by asking the Java Communications API
* what ports it has. Since the initial information comes from
* a Properties file, it may not exactly reflect your hardware.
*/
protected void populate() {
// get list of ports available on this particular computer,
// by calling static method in CommPortIdentifier.
Enumeration pList = CommPortIdentifier.getPortIdentifiers();

// Process the list, putting serial and parallel into ComboBoxes
while (pList.hasMoreElements()) {
CommPortIdentifier cpi = (CommPortIdentifier)pList.nextElement();
// System.out.println("Port " + cpi.getName());
map.put(cpi.getName(), cpi);
if (cpi.getPortType() == CommPortIdentifier.PORT_SERIAL) {
serialPortsChoice.setEnabled(true);
serialPortsChoice.addItem(cpi.getName());
} else if (cpi.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
parallelPortsChoice.setEnabled(true);
parallelPortsChoice.addItem(cpi.getName());
} else {
other.setEnabled(true);
other.addItem(cpi.getName());
}
}
serialPortsChoice.setSelectedIndex(-1);
parallelPortsChoice.setSelectedIndex(-1);
}

protected void finishGUI() {
serialPortsChoice.addItemListener(this);
parallelPortsChoice.addItemListener(this);
other.addItemListener(this);
pack();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}



Re: how to get weight in oracle forms from weighment machine [message #541108 is a reply to message #541056] Fri, 27 January 2012 11:40 Go to previous messageGo to next message
usman goraya
Messages: 9
Registered: December 2011
Junior Member
Thanks for the code, do you have a document through which I can embed this code and call it in my customized form with EBS R12.1.2. Thanks alot

Re: how to get weight in oracle forms from weighment machine [message #541135 is a reply to message #541108] Fri, 27 January 2012 16:16 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
yes dear do as in images
  • Attachment: java.PNG
    (Size: 23.37KB, Downloaded 1872 times)
Re: how to get weight in oracle forms from weighment machine [message #541136 is a reply to message #541135] Fri, 27 January 2012 16:16 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
imported java class
  • Attachment: imported.PNG
    (Size: 34.30KB, Downloaded 1895 times)
Re: how to get weight in oracle forms from weighment machine [message #541144 is a reply to message #541136] Fri, 27 January 2012 21:25 Go to previous messageGo to next message
usman goraya
Messages: 9
Registered: December 2011
Junior Member
Hi owais,

the attached pics show that webutil is being used, however so far I have been unsuccesssful to configure webutil with EBS R12 and it is not supported as well.
Re: how to get weight in oracle forms from weighment machine [message #541444 is a reply to message #541144] Tue, 31 January 2012 06:40 Go to previous messageGo to next message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
this java with API


package msr;

/**
*
* @author Dell
*/
import java.io.*;
import java.util.*;
import javax.comm.*;

/**
* Class declaration
*
*
* @author
* @version 1.8, 08/03/00
*/
public class SimpleRead implements Runnable, SerialPortEventListener {
static CommPortIdentifier portId;
static Enumeration portList;
InputStream inputStream;
SerialPort serialPort;
Thread readThread;

/**
* Method declaration
*
*
* @param args
*
* @see
*/
public static void main(String[] args) {
boolean portFound = false;
String defaultPort = "COM3";

if (args.length > 0) {
defaultPort = args[0];
}

portList = CommPortIdentifier.getPortIdentifiers();

while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
if (portId.getName().equals(defaultPort)) {
System.out.println("Found port: "+defaultPort);
portFound = true;
SimpleRead reader = new SimpleRead();
}
}
}
if (!portFound) {
System.out.println("port " + defaultPort + " not found.");
}

}

/**
* Constructor declaration
*
*
* @see
*/
public SimpleRead() {
try {
serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
} catch (PortInUseException e) {}

try {
inputStream = serialPort.getInputStream();
} catch (IOException e) {}

try {
serialPort.addEventListener(this);
} catch (TooManyListenersException e) {}

serialPort.notifyOnDataAvailable(true);

try {
serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
SerialPort.STOPBITS_1,
SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {}

readThread = new Thread(this);

readThread.start();
}

/**
* Method declaration
*
*
* @see
*/
public void run() {
try {
Thread.sleep(20000);
} catch (InterruptedException e) {}
}

/**
* Method declaration
*
*
* @param event
*
* @see
*/
public void serialEvent(SerialPortEvent event) {
switch (event.getEventType()) {

case SerialPortEvent.BI:

case SerialPortEvent.OE:

case SerialPortEvent.FE:

case SerialPortEvent.PE:

case SerialPortEvent.CD:

case SerialPortEvent.CTS:

case SerialPortEvent.DSR:

case SerialPortEvent.RI:

case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
break;

case SerialPortEvent.DATA_AVAILABLE:
byte[] readBuffer = new byte[20];

try {
while (inputStream.available() > 0) {
int numBytes = inputStream.read(readBuffer);
}

System.out.print(new String(readBuffer));
} catch (IOException e) {}

break;
}
}

}

hope this will help u
Re: how to get weight in oracle forms from weighment machine [message #591395 is a reply to message #541444] Sun, 28 July 2013 03:13 Go to previous messageGo to next message
tabish.nafay
Messages: 4
Registered: July 2013
Junior Member


Hello All,

I have the same scenario..

I am also having EBS R12, need to develop a custom form in the Oracle forms 10g, which having a text field and a button, user will press the button and get the reading of the weight from a weighbridge, in the text field. Kindly reply me ..

Weighment is connected to a PC through a comm port..

I have searched the forum, have diff type of suggestion and solution using java and MSCOMM32.OCX, but couldn't find the steps to start with ...

If any one help me in this regard.. Would be highly thankfull...

Please thanks...!!

Rgds.
Re: how to get weight in oracle forms from weighment machine [message #591587 is a reply to message #591395] Mon, 29 July 2013 23:35 Go to previous messageGo to next message
tabish.nafay
Messages: 4
Registered: July 2013
Junior Member

Dear All , Any Updates..??
Re: how to get weight in oracle forms from weighment machine [message #612470 is a reply to message #591587] Sat, 19 April 2014 05:27 Go to previous messageGo to next message
Jacob3
Messages: 1
Registered: April 2014
Location: United States
Junior Member
I think most of the companies are also providing coding that help you for connected your scale with your system and get weighting results in your database. Why not you try that hope it will help you in getting result accuratly in your database.
Re: how to get weight in oracle forms from weighment machine [message #614198 is a reply to message #591395] Sun, 18 May 2014 15:52 Go to previous messageGo to next message
ziasm1
Messages: 1
Registered: May 2014
Location: PAKISTAN
Junior Member
Hi Tabish...

I am also facing the same problem in same scenario as yours.
Can you let me know have you got your problem solved?

If yes then kindly let me know the steps.

Thanks a lot in advance !

Zia
Re: how to get weight in oracle forms from weighment machine [message #656778 is a reply to message #540891] Tue, 18 October 2016 11:46 Go to previous messageGo to next message
rajeshvemparala
Messages: 4
Registered: November 2005
Junior Member
Hi Usman,

I have similar requirement, can you please help how you are reading the Text file

Regards,
RV
Re: how to get weight in oracle forms from weighment machine [message #656780 is a reply to message #591395] Tue, 18 October 2016 11:49 Go to previous message
rajeshvemparala
Messages: 4
Registered: November 2005
Junior Member
Hi Tabish,

did you find any solution.

Regards,
RV
Previous Topic: Batch submission form - need to output PDF's
Next Topic: using the values of parameters
Goto Forum:
  


Current Time: Tue Mar 19 02:15:34 CDT 2024