Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MatrixMan

Pages: [1]
1
Technical support / Re: TBASIC Input On/Off Question
« on: December 10, 2019, 02:46:24 PM »
Thank you all for your help.  I am posting this in case someone needs help in the future with this.  Here is the final code I wrote that works exactly like I wanted:

rem 'First clear the value for GrndrTmr
TIMERPV[9] = -1
CLRIO GrndrTmr
Refresh
rem 'Determine if the switch is on (High) or off (Low) and set the timer value
IF TestIO(SWHigh)
    Then SetTimerSV 9, GetTimerSV(15)
Else
     SetTimerSV 9, GetTimerSV(16)
ENDIF
RETURN

This code, along with the ladder I attached, allows you to have a timer that you can change based on if a switch is on or off.   

2
Technical support / Re: TBASIC Input On/Off Question
« on: December 10, 2019, 12:14:19 AM »
Hi Gary,

Thanks again for your input.  It was very helpful.  I am still trying to get my densifier to change the grinder time depending on the position of the high/low switch.  The ladder code you gave me on the other posting didn't work.  There is just too much stuff going on at the same time and it caused other problems.  I got the TBASIC code to work.  Well, mostly.  I used the existing ladder code, but added some custom TBASIC to it.  See the attached ladder code.  The problem is that no matter what I type in TBASIC, it still saves that last value when you turn the switch on.  In other words, when you go from Low to High it runs the Low timer one more cycle and then runs the High timer from then on.  I tried changing the timer to 0.  Clearing the IO for that timer and refreshing.  It still does it.  What is weird is that the I/O table shows the correct values (I added pauses in for each step), but the simulator still holds that timer value one last time.  Here is what I wrote:

SetTimerSV 9,0
CLRIO GrndrTmr
Refresh
IF TestIO(SWHigh)
    Then SetTimerSV 9,0
          CLRIO GrndrTmr
Refresh
Else SetTimerSV 9,0
CLRIO GrndrTmr
Refresh
ENDIF
IF TestIO(SWHigh)
   Then CLRIO GrndrTmr
      Refresh
        SetTimerSV 9, GetTimerSV(15)
Refresh
Else CLRIO GrndrTmr
Refresh
     SetTimerSV 9, GetTimerSV(16)
Refresh
ENDIF
RETURN

I know it has a lot of overkill in it, but it still didn't work.  I am new to this so I am probably doing something wrong.  9 is GrndrTmr.  15 and 16 are the Low and High timers.  Thanks again for your help.  Take care.

Jeff

3
Technical support / TBASIC Input On/Off Question
« on: December 07, 2019, 12:19:19 PM »
I am new to TBASIC.  I want to write a simple program that looks to see if a switch is on or off, but when I wrote it in i-TriLOGI 6.x for my FMD88 I found that the Input
  • =0 treats this as an integer instead of a boolean 0 or 1.  I guess I don't understand how the system generates the integer to know what bit to read to see when it is on or off.  Here is the code I used:


IF Input[10]=0 Then SetTimerSV 9, GetTimerSV(16)
Else SetTimerSV 9, GetTimerSV(15)
ENDIF
RETURN

The simulator seems to always return 0 whether the switch is on or off so the code doesn't work.  Also, if it is the first time I run it then it might have a 1 until I run it again and then it is back to 0 even though the switch position didn't change.  I think it has something to do with refreshing, but I am not sure.  I appreciate any help.  Thanks.

4
Technical support / Re: PLC Ignoring Timer
« 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


5
Technical support / Re: PLC Ignoring Timer
« 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. 

6
Technical support / Re: PLC Ignoring Timer
« 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. 

7
Technical support / PLC Ignoring Timer
« 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: 

https://www.youtube.com/watch?v=eI0GMIiu9PI

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.   

Pages: [1]