Stepper Motor Emulate code help :-|

EricBig

Member
Join Date
Mar 2018
Location
usa
Posts
21
Hi all.
I have an application to apply but i have been using RSlogix Emulate to pre-code my application and would like if someone correct me if i am wrong.
Application operation is very simple.
components: 2 leds (Yellow & Green)- two push buttons - 1 motor - limit switch
1- two buttons backward and forward
2- when backward is pressed a yellow LED light is on until it reach home position then yellow is off and green is on
i need to include limit switch but i dont know how!!
3- when forward is pressed, yellow turns on until it reach final point then then green turns on

Code:

backward driver cw ---------- yellow led
---][--------]/[-------------------()--
yellow led----------------------- Motor
---][------------------------------()--
Motor -------------------------Green led
---][------------------------------()--
Green led ---------------------yellow led
---][------------------------------(U)

same for forward - is that correct one to start with?
 
Last edited:
*Edited*
After seeing your join date and your post history I feel like your passing school or work loads on here that you don't understand.
So lets make this a learning point.

Your post is a little confusing and so is your code.. Lets break it down by requirements first.

1) we have stepper motor that can go forward and reverse
This means 2 outputs for the motor correct?? lets give these 2 distinct names
2) there is a button for forward and 1 for reverse
This means 2 inputs, give these 2 names also
3) you have 2 LED's 1 Green for at home position 1 Yellow for running (reverse only???)
This means 2 more ouputs, give these names that are meaningful also.
4) Limit switch (is this for the home position or a travel position?)
Ahh another input.

Now build a list of all your Inputs and Outputs with their new descriptive names.
Then lets go over each input and say what you want it to do, Example:
Forward Input: start the motor in the forward direction..
ect...
 
Last edited:
Your post is a little confusing and so is your code.. Lets break it down line by line and your requirements first.

1) we have stepper motor that can go forward and reverse
Lets give these variable names (Out_Fwd , Out_Rev)
2) there is a button for forward and 1 for reverse
Lets give these variable names (Cmd_Fwd, Cmd_Rev)
3) you have 2 LED's 1 Green for at home position 1 Yellow for running (reverse only???)
Lets call these LED_Yellow , LED_Green
4) Limit switch (is this for the home position or a travel position?)
we should call this something that relates to what it is (Inp_LS) doesn't really give a description but o well

Your code:
Line 1) what is backward driver cw ??? are those 2 different tags I assume they are but I don't know if its backward driver, cw or backward, driver cw

Line 2) I'm assuming the (N.O.) is yellow led and the (ote) is Motor but the motor needs a direction also does it not???
Line 3) if motor is on turn on green led (this doesn't meet your requirements for home position for green led)
Line 4) (N.O.) Green led (OTU) yellow led.. so if green is on turn yellow off..

Your code doesn't not make sense, so start by listing your requirements and giving each Input / Output a descriptive name.
Then we can look at your code and let you know what you need to change there....
If you have a list of Inputs and Outputs I think your code issues will be easier to spot for you.


3) you have 2 LED's 1 Green for at home position 1 Yellow for running (reverse only???)
Lets call these LED_Yellow , LED_Green
This will be for both home and final positions
4) Limit switch (is this for the home position or a travel position?) This will be for home position
we should call this something that relates to what it is (Inp_LS) doesn't really give a description but o well
---------------------------------------------
code part:
Line 1) what is backward driver cw ??? are those 2 different tags I assume they are but I don't know if its backward driver, cw or backward, driver cw
Cmd_Rev-- Drive_CMD_CW ------------ LED_Yellow
---][--------]/[-------------------()--
Drive_CMD_CW => driver commanding motor to clockwise direction
_____________________________________________

Line 2) I'm assuming the (N.O.) is yellow led and the (ote) is Motor but the motor needs a direction also does it not???
You mean by adding whether its going clockwise or Counterclock wise?

- i meant from first line when yellow led is on - turn on the motor


LED_Yellow----------------------- Out_Rev
---][------------------------------()--

i didnt continue until i make sure that my response make sense first
 
Ok so we have

Inputs:
Cmd_Rev
Cmd_Fwd
Inp_Home

Outputs:
LED_Yellow (moving)
LED_Green (Home)
OUT_Rev
OUT_Fwd

Correct?
 
Last edited:
I have to leave soon so I'll help with 1 more post in case you don't have time to post again.

Line 1)
Cmd_Rev ----- Drive_Cmd_CW ------- LED_Yellow
--][-----------------]/[----------------------(OTE)
So this line will only turn on the LED when you are pressing the Cmd_Rev button & motor is going in reverse, is this what you want?
if not you need it to be a latch or set (SET) or (OTL)


if it were me I would replace Drive_Cmd_CW with OUT_Fwd this will cut down on tags used and help with confusion
 

Similar Topics

Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
986
I'm controlling an Applied Motion HW23-601D using a Leadshine EM542S connected to a 2080-LC50-48QBB, using CCW, and experiencing some weird...
Replies
2
Views
606
Hello. I am using the following: Eaton E4-AC-12RXP PLC I am trying to control the CL86T which controls a Closed-Loop Stepper motor. I am using...
Replies
3
Views
969
Not totally PLC related, but I figured this would be a good place to ask: I have an application where 7 small parts are being gripped and then...
Replies
19
Views
3,300
Hello all, I'm working with an s7-1200 and a stepper motor in Tia portal v17. This stepper motor is an SMD23E2 and I am attempting to connect...
Replies
19
Views
2,842
Back
Top Bottom