FIFO In CCW

jamesgsummers

Member
Join Date
Feb 2019
Location
Kansas City MO
Posts
18
Hello everyone, has anyone out there ever made a FIFO using an FFL and FFU instructions on a Micro800? I have tried setting it up just as I would in Studio5000 but in CCW it doesn't seem to work the same. My purpose in this whole thing is to build an alarm queue. I started out trying to build a simple FIFO and just followed a youtube video that uses an FFL and FFU in studio5000, only I was using CCW. I had built the FIFO from the video using studio5000 previously so I know it works. So I began a troubleshooting process that ended up with a XIC on a rung with a FFL so I could toggle the enable bit and try to get this thing to do something. This is what I have at this point: a DINT as the Src tag, a single dimension array with 4 elements as the FIFO tag (typed in the block connector box as gbCurrentAlmQ[1,1]) ( I suspect the problem is here, this is only one element and I need a way to show that there are 4 but I can not figure out how to do that)(also tried replacing the [1,1] with [1..1,1..4]). With this set up if I set the FIFOCon Length to 4 and Toggle the XIC I get an error ID of 6, which the CCW instruction manual describes as the length of the FIFO tag and the FIFOCon tag do not match. If I change the FIFOCon length to 1 and toggle the XIC there is no error. Does anyone know why I can't make a FIFO that is more that 1 position?

FIFOCon1.PNG FIFOCon4.PNG
 
I think you want to specify the FIFO array parameter as arr[0..3] or arr[1..4] - i.e. exactly like that arr[1..1,1..4] will probably not be understood.

Here is a post in an old thread that says that CCW FFL/FFUis buggy; this link may contain the COP instruction implementing a FIFO; it may be tough to find because I did not include a PDF and I am away from my CCW installation.
 
Where is you FFU
In FIFO, FFL and FFU work in pairs Load and Unload
without the unload the file will just fill up and not except new data
and you can't read any data unless you unload it
 
I tried the arr[0..3] and arr[1..4] with no luck.

I saw that same thing in the manual and it has me question whether I understand the difference between dimensions and elements. The attached picture shows the tag I'm using. If I have it right, that is a single dimension with 4 elements. So I should be able to use it, and I can just one position at a time. The old post you showed mentioned about possibly using indirect addressing and I think they meant it as a way to increment/decrement the position. So I'm going to explore that a bit. Am I remembering wrong or do the FFL/FFU in studio5000 increment/decrement on their own when they are enabled?

Tag.PNG
 
I think Studio5000 keeps track of the state* of the FIFO in a CONTROL object.

CCW is similar: it uses the FF_LF_CON object as input parameter FIFOcon to the FFU and FFL instruction to keep track of the length and position, plus FFU and FFL objects(?) to keep track of everything else (full, execute for rising edge, etc.).

The images below are from a working FFL/FFU prototype driving a six-element FIFO:

  • N.B. the FIFO is an array of DINTs with Dimension [0..5] i.e. a single-dimensioned array;
    • the code would not build when I tried more than one dimension e.g. [0..0,0..5];
  • the valTON timer emulates a generator of values to be FFLed onto the FIFO;
  • the triggerTON timer's .Q element feeds triggerQ, a boolean which triggers when values will be FFLed onto the FIFO;
  • the FFL writes True to fifofull when the fifo is full, which triggers the FFU to remove one element at the next triggerQ event.
In the trend image you can see where

  • valout's values are six FFL/FFU pair shifts behind the valin's values when the FIFO is full (pos is 6), and
  • I manually reset the FIFOcon .Position attribute to 0, which stopped the valout's updates until the FIFO was full again.
* Length i.e. capacity, and Current Position i.e. of next element to be loaded onto the FIFO

ccw_fifo_var.png ccw_fifo_pou.png ccw_fifo_trend.png
 
Thank you drbitboy! I think that is enough information to get me going on FIFO. On another matter that isn't very important but something that has me feeling like this o_O: How do you change your username on this site? I want to get a cool name like you but I've dug around everywhere in my profile settings and can not figure it out. If you don't know how or who I might be able to contact to change it right off hand don't waste a lot of time on it. Like I said not important.
 
...On another matter ... How do you change your username on this site? I want to get a cool name ...

Haha funny, I want to go the other way. I have no idea, but I would try these:

1) I don't know if it's possible, but contact Phil Melore here.

2) Create a new account.

And let us know the result.

Best regards.
 
Yeah, I am starting to think the new account might be my only option but I try to get a hold of Phil and see if he has a better option.

I built your FIFO. I had to make a few modifications to suit my purposes but it’s going to work perfectly. Thanks so much
 

Similar Topics

I am not sure if this is possible but if there is a way, you guys would be the ones to know. I am currently working on a project where we are...
Replies
7
Views
219
Hello all, I'm using a 5069-L330ER in a project and I need to essentially capture some data that will be shown as a trend on a screen. The data...
Replies
9
Views
963
Hello! I have a network of conveyors bringing raw product to 4 machines. A sensor in the hopper of each machine calls for more product. I'm...
Replies
15
Views
5,876
I have a bottle capper that is using an encoder and FIFO logic to track the free standing bottles passing through a bottle capper. I have checked...
Replies
31
Views
11,677
Good morning I would appreciate any assistance with this problem. I am trying to write FIFo program for what I am calling a magazine rack. I...
Replies
17
Views
3,904
Back
Top Bottom