CX-Programmer: FIFO inside a function block

Hi all,
I am playing around with omron at the moment. I have a CJ1M CPU22 plc and cx programmer version 9.4 to test with. Currently i am working with the simulator only.
I have successfully created an encoder based product tracking / reject detection with system using multiple fifo stacks and i have the code working just how i like it. However now i want to package it up into a function block as i have multiple conveyors using the same identical logic. Problem is i cant get the fifo instruction to work inside the function block? All i done was copy all the logic i wanted and pasted straight into a new function block and tidied up some of the operands that didnt map how i liked into internal fb memory.
Normally the fifo is set using sset instruction and one of the operands determines the head address of the stack and the other operand is the stack depth. But inside the function block the memory is allocated differently so i created an array of type word and supplied the array[0] as the head address and correctly set the depth to match the fifo stack depth. But alas it is not working.
I am unconditionally calling the function block from the first program section.
If someone wouldn't mind quickily letting me know that i have missed something please fill me in...
 
I do not know about FIFO in FBs, hate them and do not use them.
You could just copy the rung and use it again - easier in my view. That is all I do.
 
Had some down time and worked it out. I was using 2 FIFO's side by side in my original code as I needed 32 bit resolution (standard FIFO is only 16 bit).

Anyway, inside the function block I created a nested FB in which I created a 32 bit FIFO using structured text. Never knew you could do that! Very impressed. Now I have some canned code that I will probably never use again... If anyone wants it shoot me a msg.
 
Lol, did some testing today with a 3 camera + single reject station with the fifo buffers at 12 parts deep and the conveyor encoder resolution wound right up. Blew the scan out to 8.4ms. With the same code written long hand without FB 0.9ms. POS! Trying to convince the customer to use Siemens in their next projects as they wouldn't mind a modular block based solution so their own sparky could do the coding from picking the blocks I created. But it was a good learning curve.

BobB, so I will not be using Omron FB's very much anymore. Please don't say I told you so.
 
No I told you so - FBs are just ruddy useless in my view. Funny thing is I am not a Siemens fan either - byte based in this day and age? Too much work to do - hard to make money out of a Siemens project.
Code Omron fast and furious - gone to the next job. Different world when you work for yourself! Make some more dollars.
 

Similar Topics

Hello I newby from here. I have a project with PLC CP1L Omron and CX Programmer for programming In this project. Scanner as input and plc...
1
Replies
912
Views
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...
4
Replies
7,960
Views
I just had an occurrence where doing online edits with a PLC happen to cause a watchdog timeout for messaging failure. Which on this particular...
6
Replies
217
Views
Hello all, I am looking for an alternate PLC Programmer, specifically someone familiar with Alen Bradley and Omron PLC's. We are in the Heat...
4
Replies
443
Views
CJ2M CPU35 I am a product of Allen Bradley so not too familiar with Omron or cx programmer. trying to configure my I/O for this plc, not winning...
5
Replies
281
Views
Top