Internet PLC Forum

General => Technical support => Topic started by: MatrixMan on December 04, 2019, 12:05:39 PM

Title: PLC Ignoring Timer
Post by: MatrixMan on December 04, 2019, 12:05:39 PM
We are a small manufacturer of EPS densifiers.  We recently added a High/Low switch to aid in densifying egg cartons which are very dense and require a different compression and grinding time.  To do this, I just added a relay with the switch input in high (see circuit #22).  Then for the compression time I copied the existing Circuit #24 and just added a new timer with a _H to show that it was the high mode timer.  It works fine.  Then I did the same exact thing for the grinder.  I copied Circuit #43 and created Circuit #44 with a new timer for the high setting.  The problem is that the Circuit #24 works fine, but Circuit #44 the timer stops and the grinder just keeps going.  They are exactly the same circuits so why doesn't it work?  It works in the simulator too.  The grinder just continues to run until the sequence advances and everything resets.  You can change the Grnd_Hi timer and it does absolutely nothing.  I would appreciate any feedback on this.  Thanks.

Here is a link to see what a densifier is:

You can see a man throwing foam into the grinder.  There are 3 compression chambers called pushes.  One push for each axis (x-y-z).  The program starts the grinder when the first push retracts.  Hope this helps.   
Title: Re: PLC Ignoring Timer
Post by: garysdickinson on December 04, 2019, 03:33:15 PM
There is something wrong with the PC6 file that you attached to the post.  When I download and try to open your file with
i-TRiLOGi 6.52 I get the following error message:
"Open File Error
Error Opening FIle C:\Users\ ...\1500.1.3.5-1.pc6
File Not Found or is is not valid TRiLOBI file"

I opened your file and the first line of the file is as follows:
TRiLOGI Ver 3.0<SUB><LF>

<SUB> has a value of 0x1a  and is named a substitute character<-- I don't know why this character is present
<LF> is an ASCII line feed character this makes sense

The first line of .PC6 files produced by the current version of i-TRiLOGI looks like this

øõTRiLOGI Ver 5.0<LF>

The first two characters are Unicode. I am a 7-bit ASCII guy..

Perhaps your version of i-TRiLOGI has some limitations on what sort of files it can produce.  Tech support at TRI will recognize the problem, easily.

If you can print out your ladder logic to a PDF and either post a link or send it to the email address in my profile, I'd be happy to figure out why stuff is not happening for you.

Best regard,

Gary Dickinson
Title: Re: PLC Ignoring Timer
Post by: MatrixMan on December 04, 2019, 04:34:34 PM
Sorry.  We used to run this on the T28 and now use the FMD88 with an expansion board.  I actually created the file on old WinTrilogi software (.PC3 but couldn't upload it) and tried saving it as a .PC6 which apparently didn't work.  I opened the new i-TriLOGI 6 and converted it so hopefully you can open it correctly now. 
Title: Re: PLC Ignoring Timer
Post by: garysdickinson on December 05, 2019, 08:50:12 AM
OK I can see sort of what you are trying to do.

I have a question and a suggestion.

Question. Line #43 that controls the TIMER, Gndr_Tmr, uses the contact associated with the TIMER as part of the logic. It looks like you are trying to create some sort of Seal-in circuit. The issue is that the TIMER contact only does not go active until it times out. This would then keep Gndr_Tmr active until either the contact with Seq1:1 goes active of SW_High goes inactive.  Is this what you want?

Can you simplify your program down to 2 or 3 lines and the problem still exists?  This would be a lot easier for me to figure out.

Suggestion:  The use of "_" in the names of the ladder logic elements used to work quite fine. Somewhere in the history of TRI they decided to allow attaching a comment to variable names in the TBASIC programming language that was added to PLCs after the T28.  This idea was stupid and it breaks all sorts of things.  Now in TBASIC the following are all references to the same thing, "A" "A_InputState", "A_A".  Essentially anything including the "_" is ignored.  If you use TBASIC and try to access INPUTs, OUTPUTs, RELAYs, TIMERs and such in TBASIC the "_????" will be ignored.

If you never use TBASIC you can keep the "_" names. If you use TBASIC, then DO not use "_" in any name anywhere. The "_" breaks the parts of the i-TRiLOGI syntax highlighter, also. 

TRI did come up with something that was a lot more powerful and I like a lot, the #define mechanism.  This mechanism does give you useful names for things. However, they didn't get rid of the stupid "_" idea.

Gary Dickinson
Title: Re: PLC Ignoring Timer
Post by: MatrixMan on December 05, 2019, 09:36:43 AM
Thanks for the input Gary.  I am not familiar with TBasic.  I inherited this program from another engineer that is gone now so I have struggled a little with its complexity as well.  I can tell you these definitions though:

GRINDER_FW - Output 08 sends the signal to start the grinder in the forward direction.

GRND_Tmr - Timer 09 allows us to set how long the grinder runs.  It is in parallel so that it forces the grinder to stop when the timer stops.  Circuit #43 works fine.

Seq1:1 - This is the start-up sequence that tells the densifier to retract all the pushes.  This just prevents the grinder from coming on during the start-up. 

SW_High - Input 10 tells the densifier that the switch is in High mode.  I had C18 (the relay tied to this input) there instead, but it didn't make any difference.

What I am struggling with is the fact that all I did was copy a working circuit and add in the SW_High input to tell the PLC which line to run and it only runs the original.  I did the same thing for the 1st push and it worked fine.  I can try stripping out most of the code and see if I can figure it out. 
Title: Re: PLC Ignoring Timer
Post by: garysdickinson on December 05, 2019, 05:16:37 PM
I took a look at line 44.  It looks a lot like 43.  But it uses a different timer, Grindr_Hi.  However, Grindr_Hi is not used any where else in the program.  So it has no possible affect on the program.

I think I figured out the usage of many of the timers and why the complicated logic around them.

The explanation: 

1.  the program is using the sequencer mechanism as a drum sequencer using the [AVseq] terminal on line 32.

2. The complicated logic  with the time is to use the TIMER going active to create a pulse for the [AVseq]. It does this by advancing the sequencer when the TIMER goes active. This changes the state of Seq1 and this disables the input to the timer.  The end result is a 1 scan time wide pulse when the TIMER runs out. This pulse somehow is used to advance the sequencer to the next state.

I use another approach for sequential logic that simply assigns the next state to the sequencer.  Oddly enough this direct approach is used on line 3 of the program.

The logic in the overall program is exceedingly convoluted.  The Seq:1 states are used to control other RELAYs C2 ... C7 and C14 for no apparent reason.  Perhaps this was done to ensure that no one could ever understand the program.

I assume you have been tasked with maintaining the program. I feel so sad for you.

Gary d

Title: Re: PLC Ignoring Timer
Post by: garysdickinson on December 05, 2019, 10:48:58 PM
I can't stop thinking about this. I know that you can't rewrite this thing and just need to get something working.

I suggest that you get rid of both rungs that control the grinder TIMERs. The original and the new one that you added for the longer duration TIMER.

Create a new RELAY with a name that makes sense (i picked GrinderDone) to replace the use of the Grndr_Tmr contact earlier in the program.

Create two new replacement rungs as shown in the attachment.

Maybe this will get things working without a total rewrite.

Gary Dickinson
Title: Re: PLC Ignoring Timer
Post by: MatrixMan on December 07, 2019, 11:57:14 AM
Hi Gary,

Thanks again for working on this.  I tried the code you sent me and it seems to work in the simulator.  I won't be back in the office until Monday, but I am confident it will work on the machine.  I really appreciate your help.  Take care.

Jeff Winter, GM
Matrix Mfg