News:

  • June 09, 2026, 12:42:56 PM

Login with username, password and session length

Author Topic: I-Box guts  (Read 9519 times)

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
I-Box guts
« on: February 17, 2011, 09:38:08 AM »
Is there a reference for what native instructions all the IBoxes compile to?
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: I-Box guts
« Reply #1 on: February 17, 2011, 10:24:47 AM »
Create a program with, for simplicity, one rung with the IBox you are interested in. Then perform an export to a text file choosing "Expand IBoxes" in the options area.
An output is a PLC's way of getting its inputs to change.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: I-Box guts
« Reply #2 on: February 17, 2011, 11:04:00 AM »
Thanks.  I'm trying to do things like understand what to expect to find in the accumulator after IBox execution.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: I-Box guts
« Reply #3 on: February 17, 2011, 11:19:58 AM »
Thanks.  I'm trying to do things like understand what to expect to find in the accumulator after IBox execution.
I know that when you do MATHBIN and MATHBCD, if the result could be bigger than 16 bits, the result is still in the 32-bit accumulator.  So if it's possible that your calculation may be bigger than 9999BCD or 65535binary, just do an OUTD immediately after the MATHBIN/MATHBCD IBox.

LD K5001
OUT V1400
OUT V1401
MATHBCD V2000 "V1400 + V1401"
OUTD V2001

V2000 would equal 2 BCD, but V2001 as a DOUBLE BCD would equal 10002
« Last Edit: February 17, 2011, 11:21:54 AM by franji1 »