Jump to content

Recommended Posts

Posted

Good day everyone. I am new to PLC although I understand the design process and sequence of what I want to accomplish. This is my first time working with the Mitsubishi gx works3 so there's a learning curve. I am more comfortable with function blocks so I intend to stick with it for the mean time. I am having some challenges with a logic connection that I hope to get some help.

So I have 3 pumps that I would want to rotate whenever one of the 3 inputs (float switch) is activated. I am using a counter and some comparism logic (EQ, GE, LE and some logic gates). I have setup everything as needed but the EQ logic output that I want to use to reset the counter will not connect to the R (reset) input to reset it after I reach my max count. I want this to be automatic reset after every max count reached. I have attached a screenshot and marked with red the part that will not snap (connect). If there is something missing, please let me know or if there are better options to accomplish this, I am welcomed to any help

3_Pump_Rotation.JPG

Posted

Hello Hagi,
     You can access properties of the CTU instance with the dot notation.  For example, you could add CTU_1.Q in R instead of the EQ block with the red line.  CV will be 7 for one scan and then zero.  Does that do what you need?

     The help file for CTU(_E) (you can search for it or look up Page ID JY997D55801-AB7) shows the timing chart for when Q will be high with respect to CV and PV.

11-6-24 temp1.PNG

Posted

Thanks a lot for the reply and showing the way.

Now my other question would be in creating the labels and assigning them to the IO, what's the steps (which one comes first)

After creating the FB/FUN 'new data', do you setup the FB labels (give me a sample of how to set it),

 Do you create the Global labels (give me a sample of how to set it)

How about the label for the Main.

What I am trying to understand is that which label affects the physical X and Y of the PLC

I am new to this so this is a learning moment for me. Function block is one I like to build my applications on, so any help is appreciated

Posted (edited)

Hello Hagi,

     Please see the attached mspaint artwork.

Edit - I forgot you might need to use the Show Details button on the right if you don't see these columns.

11-6-24 temp2.PNG

Edited by Integrator_99
Posted

Thank you very much. I guess I am trying to understand why does GX works3 uses 'Global label', FB/FUN 'local label', and Main 'local label', how does each relate to the other. I now know the global label can be assigned to the physical X0 and Y0 but why do you need the local labels for the FB/FUN and Main when the global labels are the one that activates the real X input and Y output?

Posted

Local labels are data specifically inside one program or FB, not accessible from outside.  Think of program local labels as work memory, that has no bearing on other programs. So for example, labels you make in program MAIN1 are not visible to program MAIN2, so creating duplicate names does not cause a problem.  Prevents you from having to remember which bits and words you used internally in each program to prevent duplication.

Global labels are available to every program in the CPU.  That's why the I/O is created as global labels.  Global labels are also used for any data to display on an HMI or transmit over a network like EtherNet/IP.

There's a lot of good videos out there explaining label based programming.

Posted

The reason you cannot draw that red line is because you are making a loop.  The EQ function is using the output of the CTU as an input, and then you try to use the EQ as an input to the same function block.  It won't allow you to draw that.

Put the output of the EQ into a variable, and then use that variable as the input to the CTU.  It needs to process the EQ before it can process the CTU if it's input data...

Posted

Thank you, that part has been resolved by Integrator_99. Your explanation is great, and what I wanted to understand is during the development of a function block, do you use the labels created in the global or the FB local label or Main local label

Posted
6 hours ago, Hagi said:

Thank you, that part has been resolved by Integrator_99. Your explanation is great, and what I wanted to understand is during the development of a function block, do you use the labels created in the global or the FB local label or Main local label

When you make your own function blocks, everything used inside should be defined inside its local label list.  Never use global labels inside a FB, you should make an input pin and connect the global to that on the outside.  As for programs, local labels can be used in any way you wish that isn't required externally.  If it's required in more than one program, on a network, or an HMI, you should use a global label.  There's some good eLearning materials on the Mitsubishi US website that can help you learn programming basics.  And they regularly offer training classes on GX Works2 and GX Works3, if that would help.  I know labels are discussed in the in-person classes.

Posted
On 11/6/2024 at 5:21 PM, Integrator_99 said:

Hello Hagi,

     Please see the attached mspaint artwork.

Edit - I forgot you might need to use the Show Details button on the right if you don't see these columns.

11-6-24 temp2.PNG

Ok, I tried a small X0 and Y0 but when I close the X0, I see the status green light ON but the relay Y0 does nothing. See attached image and see if there's an issue when what I did. I did same with ladder and that works. Integrator_99 and and Crossbow can you review and tell me why this would/does not work. 

 

FB_ProgBody.JPG

Global_Label.JPG

MainProgBody.JPG

MainProgBody_Label.JPG

Posted

Hello Hagi,
     The logic you have should work.  See the attached images.  I simulated the ladder and forced Input_1_Global_X0 high.  Your function block will hold Y0 high correctly (which is confirmed with the Watch window monitoring Y0 at the bottom of the screen).  

     Since you didn't show them, I added the label details for the function block local labels too (FB_Input_1 and FB_Output_1).  Double-check you have the Class defined as VAR_INPUT and VAR_OUTPUT.

     I'm unclear in your last message if you mean the X0 or Y0 indicator is green.  Check that the PLC is in RUN Mode, not STOP Mode.

11-11-24 temp1.PNG

11-11-24 temp2.PNG

11-11-24 temp3.PNG

Posted

Thank you for all the help. It's working now, and all the information you had provided before are very helpful. I will continue to learn from this experience and board. Your input here is invaluable

  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...