malyalewariat

CJ2M serial communication

17 posts in this topic

Hi! I'm trying to connect Omron plc CJ2M cpu11 (photo below) with Weintek touch panel. I've made proper cable, and I'm trying to establish communication between these two devices. I've wrote a script in Weintek's program, that sends and receives via serial port, rs232. Also, I've used example for serial communication in CX-Programmer, that you can see in attached files. I'm trying only to toggle one W adress using hmi. That sounds simple, but still, I'm not able to make plc and hmi to talk with each other. What I'm doing wrong?

Share this post


Link to post
Share on other sites
Your HMI must have the communication driver for that PLC, why don't you use it?

Share this post


Link to post
Share on other sites
Before any action, I'm setting up plc device in weintek program properties. During every program downloading into hmi, it loads drivers for cj2m.

Share this post


Link to post
Share on other sites
If you set up the communications to your PLC as RS232C you will not have to do anything else. Just add a button to the screen to toggle your W bit.

Share this post


Link to post
Share on other sites
When I put button assigned to declared plc, hmi throws "plc no connection". Baud etc. Parameters are the same at both devices. Are you telling that when everything is fine i don't have to use scripts in weintek and rxd txd function for omron? Just button (which adress? W_bit?) And omron should get that bit value? I want to add that when i'm using wientek script, comm light at plc blinks. Same when it says "plc no connectio"n it's blinking continously. Edited by malyalewariat

Share this post


Link to post
Share on other sites
You do not need to do any messaging on either the PLC or HMI to communicate. You only need to have the communications set up correctly. If you are getting the "PLC No Communication" popup window then something is not set up correctly or there is a problem with the cable.

Share this post


Link to post
Share on other sites
I'll check everything once again. Can you tell me, which address in Weintek gonna relate to Omron Work address?

Share this post


Link to post
Share on other sites
The only thing spooky about theEasybuilder addressing is the way you enter bit addresses so they will show up correctly in the Xref. The W0.00 bit needs to be entered as W000 in Easybuilder. If you enter the decimal point it will work OK but it won't show up in the Xref display. Edited by Mendon Systems
1 person likes this

Share this post


Link to post
Share on other sites
Did you check the dip switches on the CJ2M CPU? Make sure that SW5 is OFF.

Share this post


Link to post
Share on other sites
I'll check it, thanks. --EDIT-- All switches are at OFF position. Edited by malyalewariat

Share this post


Link to post
Share on other sites
W (work) registers and (almost all others also) can be addressed as either words or bits depending on the instruction used. W bit addresses range from W0.00 to to W511.15. W word addresses range from 0 to 511. If you use a MOV command to set the value of W10 to #4 (4 HEX) that will also set bit W10.02 to ON and all the other bits in word W10 to OFF.

Share this post


Link to post
Share on other sites
I've got one more minor problem (with EasyBuilder). I'm working on 3 PCs. Only one is able to upload programs to HMI. Soon I'm gonna own only those 2 that cannot connect with HMI. Settings are the same on all PCs. On those 2, EB finds HMI via Etherner with no problems, but it's thinking a lot after pressing Download button, after longer while, it gives me the message "password error". Passwords are the same. Any solutions, ideas what's wrong there? --EDIT-- In device properties i've set Location as Remote (COM master-slave), not Local. Maybe thats the problem, i've just realised that on your thumbnails. I'm gonna check it tommorow (again) when I'll bring that working pc. Edited by malyalewariat

Share this post


Link to post
Share on other sites
I have seen that "password error" message a few times but never consistently. I have always been able to resolve it by cycling power to the HMI. You might want to see if Weintek tech support has any answers for that one.

Share this post


Link to post
Share on other sites
Ok, change Remote->Local in Device Properties of plc solved my problem. Thank you all for all answers especially Mendonsy. One more thing... I can't change W addresses by using a macro. For instance, i want to set W1.00 value 1. macro_command() bool a a=1 SetData(a, "plc", W_Bit, 100, 1) end macro_command Edited by malyalewariat

Share this post


Link to post
Share on other sites
Dunno???? I have a macro that is doing almost the same thing except that it is setting the W bit (50.00) to OFF. It works fine. Are you sure that the macro is actually running?? /// toggles the HMI Reset bit OFF in the local PLC macro_command main() bool Off=0 SetData(Off, "PumpSta1", W_Bit, 5000, 1) end macro_command

Share this post


Link to post
Share on other sites
I've had a few of those episodes also. It happens to everyone at one time or another!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now