Java PLC communication over USB-to-RS232

jangid

Member
Join Date
Oct 2016
Location
New Delhi
Posts
2
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—

57f27470748af_ScreenShot2016-10-03at7.55.45PM.png.9312e5dfdcb00df57b661882d94ef7ff.png


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
 
Not knowing about that particular PLC, suggest going online with it if possible while testing your program. See if you can pick up any error messages on the fly.
 
Have a look at this (VB, not Java) tutorial on Omron Hostlink:

http://accautomation.ca/how-to-implement-the-omron-plc-host-link-protocol/

Everything looks correct to me. Are you sure about the 7-data/2-stop/even parity framing ?

Are you looking for a reply from the PLC, or just looking to see if the data values change, using a different port ?

I have taken help from the above link only and translated it into Java. I have translated it to Python. It is working fine there. The Java program isn't working. I am using purejavacomm library for serial communication.

I want to write/read DM area of the PLC.

Regards
 
I have taken help from the above link only and translated it into Java. I have translated it to Python. It is working fine there. The Java program isn't working. I am using purejavacomm library for serial communication.

I want to write/read DM area of the PLC.

Regards

Sounds like an issue with that Java lib then as opposed to a PLC comm issue. Surprised Java doesn't have built-in serial capabilities and needs a 3rd party lib.
 

Similar Topics

I want to read micrologix 1400 plc data with register address with the help of java program on ethernet using tcp ip. Please anybody help me...
Replies
5
Views
4,778
Hi All, Can anyone help me out in reading the data from Micrologix 1400 PLC using JAVA programme through Ethernet/IP.?? or any java library for...
Replies
0
Views
2,612
Hi, Does anyone know if it would be possible (and practical) to create a java based PLC simulator (or know of any examples) ? I am familiar...
Replies
6
Views
3,780
Does anyone know what version of java is needed to view the webpages of EthernetIP Safety I/O blocks from Rockwell; I can't find any mention of...
Replies
1
Views
1,577
motion view application for our kineticx 300 does not launch automatically.java latest version 8only installed in our VM ware system . I...
Replies
1
Views
2,556
Back
Top Bottom