Jump to content

Recommended Posts

Posted
I developed this simple code as a first example of STL programming for my Mechatronics class. See the program text below. It simply uses a push button switch (X1) to activate (SET) and deactivate (RST) indicator lamps (Y0- Y2). The weird aspect is that when the program is executed for the very first time, push button input X1 must be activated (pressed) twice for the operation to continue. After that, the program functions properly, looping back and only requiring a single button press. Does anyone have a clue regarding this behavior? A reply is greatly appreciated. Thank you. 0 LD M8002 1 ZRST S0 S100 6 ZRST Y000 Y024 11 SET S0 13 STL S0 14 LD X000 15 SET Y004 16 SET S10 18 RET 19 STL S10 20 LDP X001 22 SET Y000 23 SET S20 25 RET 26 STL S20 27 LDP X001 29 SET Y001 30 SET S30 32 RET 33 STL S30 34 LDP X001 36 SET Y002 37 SET S40 39 RET 40 STL S40 41 LDP X001 43 ZRST Y000 Y002 48 OUT S10 50 RET 51 END
Posted
Hi, My STL programming is a bit rusty, but I think the problem is: You use X001 to set Y0 20 LDP X001 22 SET Y000 You reset Y0 immideately 41 LDP X001 43 ZRST Y000 Y002 You will basically SET, then RST the variable in one scan. Remember that the FX-series don't set or resets any outputs before the end of the actual scan, so if you set/reset the same variable in the same scan, nothing will happen....
Posted (edited)
When your program finishes it returns to S10, but when you initially start you begin at S0. Your program currently S0 | S10< | | S20 | | | S30 | | | S40 - There is however an issue in the program. The use of LDP X001 is a bit of a no-no, especially in consecutive rungs. After step 11, add the following LDP X1 OUT M2800 Use LDP M2800 instead of LDP X001. There is a special range (M2800-M3071) in the PLC allocated for this type of thing. It prevents run-through of the steps. Consult the manual FX1S-FX1N-FX2N Prog Man (Complete Man) JY992D88101C or later, section 3.5.2 Single step control Let us know if this worked for you? Edited by waynes

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...