455115

Parallel operation of the inputs and modbus communication

23 posts in this topic

I have a mitsubishi PLC and I need each input to activate the output with a button, one press ON again OFF (toggle button) in parallel with the Input can be activated with a modbus command, which is respectively 0 or 1 constantly (not toggle with M0-Mхх). I tried options, but without success. Please give advice!

Edited by 455115

Share this post


Link to post
Share on other sites

Well first of all modbus will just exchange the status of a variable. So what you need is to change the status in the PLC,

Depending on which PLC you use there is an direct instruction for it. If not just write a little code like 

-|M0| ----|PLS M1|-

-|Y0|---|M1|------|RST Y0|-

-|/    Y0|---|M1|----|SET Y0|--

 

Share this post


Link to post
Share on other sites

Thanks for the quick response.
Rather, the question is how to make it work in parallel with the input, which is toggle.
Maybe my question is very stupid, but I'm completely new to it.

Share this post


Link to post
Share on other sites

In that case that would mean to  change M0 into the input you need X... if it is from the PLC. 
or M...... which is linked to the Coil from an external modbus device.

 

Share this post


Link to post
Share on other sites

Thanks!
I understood you.
And how to make an input pulse to activate an output with a hold until the next pulse?

Share this post


Link to post
Share on other sites
30 minutes ago, 455115 said:

Thanks!
I understood you.
And how to make an input pulse to activate an output with a hold until the next pulse?

That's what the PLS instruction is for this wil only activate once when the prev conditions are true.

The SET/ RST will change the status 

 

1 person likes this

Share this post


Link to post
Share on other sites

Hello, I obviously didn't understand. I don't understand how "PLC" instruction work. Can you give me an example as in the first post? Let's say for example that I have: input X001 (which is toggle) sends only pulse; M001 (modbus coil) is changed by modbus register and is 0 or 1; Y001 which is the output that must be changed if the state of M001 changes or we have an impulse of X001.

Thanks for the help and your time!

 

 

 

 
Edited by 455115

Share this post


Link to post
Share on other sites

Here are two options.

So the first line wil just puls M0. This means it will only be active for one scan of the PLC. ( if you don't do this it will turn on and of each scan) 
The second part would will activate or deactivate Y0 depending if Y0 was arready on or not.

The second line is everything in one. So if you PLC supports it it you can use that. (FF stands for FLIPFLOP wich inverts a status)

FlipFlop.JPG

 

If you understand this the next step is modbus comm.
It would help if you mention which Mitsubishi PLC you are using.

Edited by Gambit

Share this post


Link to post
Share on other sites

Any other program inside ?

 

Share this post


Link to post
Share on other sites
12 minutes ago, Gambit said:

Any other program inside ?

 

Only modbus configuration and program 1. I tried it on another PLC which has only program 1 the result is the same

Edited by 455115

Share this post


Link to post
Share on other sites

IS the CPU is error or Stopped ? Or is Y0 in anyway other controlled ?

Which PLC are you using ?

Share this post


Link to post
Share on other sites
1 hour ago, Gambit said:

IS the CPU is error or Stopped ? Or is Y0 in anyway other controlled ?

Which PLC are you using ?

I tested it on FX1N and FXON. It doesn't work on both. Here is a video of how he reacts:

bandicam 2020-07-08 15-37-10-056.mp4

Share this post


Link to post
Share on other sites

That's because X2 is driving Y0 aswell!!!

No X2 with an out Y0  is the same as resetting Y0.

 

Edited by Gambit

Share this post


Link to post
Share on other sites

I entered this to show that the Y00 works, the first video is without it and also does not work

Share this post


Link to post
Share on other sites

sorry small mistake it set but also immediately reset do it like this and it will work:

You have to take out the X2 part !!!!

 

FlipFlop.JPG

Edited by Gambit

Share this post


Link to post
Share on other sites
4 hours ago, Gambit said:

sorry small mistake it set but also immediately reset do it like this and it will work:

You have to take out the X2 part !!!!

 

FlipFlop.JPG

You are geniuses!
Thanks a lot, that's how it works!
Now the part with the modbus remains. Is that ok or is there another way? by controlling coil 10 through the modbus

Capture.PNG

Share this post


Link to post
Share on other sites

Modbus isn't a supported protocol for the FX0N or FX1N. So you would have to interpret the modbus string in the program.

or you buy a newer PLC from FX2N it is possible. Latest is now FX5....

Edited by Gambit

Share this post


Link to post
Share on other sites

Yes, that's clear to me. I have another question if there is a way for the same program to recognize a short and a long signal from the input. In short to activate one output in long another.

Share this post


Link to post
Share on other sites

sure just add a retentive timer after the X0  then compare the time to one or more values for the selection 
then reset the timer 

 

Share this post


Link to post
Share on other sites
4 hours ago, Gambit said:

FX0N doesn't have a retentive timer so i used a pulse bit instead. Y0 en Y1 represent the actions

If you want to learn more about PLC programming:

https://www.mitsubishielectric.com/fa/assist/e-learning/index.html

 

timeX0JPG.JPG

Thank you very much for the help! For the link too. It is very nice when there are people like you who help!

1 person likes this

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