Pankaj Jangid

MrPLC Member
  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Pankaj Jangid

  • Rank
    Hi, I am New!

Profile Information

  • Country India
  1. I am trying to communicate with Omron PLC CP1E-N40DR-A over USB-to-RS232 cable, using a Java program. Following is my basic code— public void startComm() { PrintStream os; 
try {
 CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("COM4"); SerialPort serialPort = (SerialPort)"MyApp", 2000); serialPort.setSerialPortParams(9600, SerialPort.DATABITS_7, SerialPort.STOPBITS_2, SerialPort.PARITY_EVEN);
 os = new PrintStream(serialPort.getOutputStream(), true);

 } catch (IOException e) {
 } catch (PortInUseException e) { e.printStackTrace(); } finally {
 if (os != null) os.close(); } } This code produces no effect on the DM area. In this code I am trying write “0070” at location “0620”. The connector and its driver are alright because CX-Programmer is working fine using the same cable. Any pointers for this would certainly help me. Thanks