CX-Programmer: FIFO inside a function block

HJTRBO

Member
Join Date
Jul 2008
Location
Melbourne
Posts
618
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.
 
Yeah thats what i have done. I prefer siemens so i automatically think to block everything. Just a habit... Thanks BobB
 
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

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...
Replies
4
Views
6,782
bonjour je souhaiterais savoir si c'est possible de faire communiquer Cx-programmer ( logiciel de programmation des automates Omron ) avec...
Replies
2
Views
154
Dear All, I need a sample PLC program to count the output pulse of a mass flow meter so that a specific amount of mass (for example 100gm)can be...
Replies
2
Views
142
I need a good website or tutorial to learn plc programming Thank you
Replies
10
Views
504
Hello ! I am trying to use an omron cj2m-cpu33 with a CP1W-CIF01 plug in serial connector to talk to a zebra ZT610 printer. I am getting the data...
Replies
8
Views
364
Back
Top Bottom