Sign in to follow this  
Followers 0
Cordep

PUSH and FIFO

5 posts in this topic

Hi i'm trying to use PUSH and FIFO but it seems not to work just like i need or probably i'm doing something wrong, here is the problem: I do: SSET(630) 170 #6 -> Define the STACK Then: MOV(021) #1 200 -> Puts value 1 in CIO 200 MOV(021) #2 201 -> Puts value 2 in CIO 201 PUSH(632) 170 200 -> Write to the STACK the value 1 PUSH(632) 170 201 -> write to the stack the value 2 Now the problem, no matter what push i do first in the program because in the STACK it will be always organized de the number 1 first then the number 2, i mean isn't supposed to First In First OUt? if i do the second PUSH in first place shouldn't the numbers be organized in the stack like 2 ->1 ? I HAve attached the file... Thanks in advance... Cordep FIFO_PUSH.cxp

Share this post


Link to post
Share on other sites
What instruction are you using to pull the data from the stack? FIFO? LIFO? Your ladder example doesn't have any of these instructions. BTW: You need a leading edge trigger on the SSET. You are setting the stack every scan which clears the stack. Come to think of it, that's probably your problem. :)

Share this post


Link to post
Share on other sites

Oh sorry i forgot i'm using FIFO but i already have solved the problem and the problem is that in the definition of the STACK i can only do it once i mean: P_First_Cycle than i can use the @PUSH and @FIFO and it works just fine. I have attached the solution i found and it seems to work just fine. Thanks for your time, Cordep FIFO_PUSH.cxp

2 people like 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
Sign in to follow this  
Followers 0