Re: [foxboro] IND HLBL BIT_PATTERN help
- From: Tim Ruhland <truhland@xxxxxxxxx>
- To: foxboro@xxxxxxxxxxxxx
- Date: Mon, 8 Jun 2009 18:08:46 -0700
Re:
"I am thinking about using a IND block and subroutine loop to do the
unpacking & totalizing."
Perhaps it would be better to use CALCA blocks to do this:
- use one CALCA block for every two IIN blocks
- connect the :C.B.IIN parameters to the LI01 and LI02 parameters of the
CALCA
- use the STH and STL instructions to store your 32 bits into LO01
- use the IN 0xx instruction repeatedly to push the individual bits to the
stack
- use the ADD instruction to add up the values on the stack
- use II01 to input the previous CALCA output value
- use IO01 to store the result of adding all the bits
So for 150 IIN blocks, you would use 75 CALCA blocks to get it done.
This would abide by Alex Johnson's Application Programming rule #3 - "Use
Sequence Blocks only if it can't be done in CALC blocks."
When available, I always follow Alex's advice ;)
Regards,
Tim Ruhland
Automation Engineer
Eichleay Engineers of California
1390 Willow Pass Road, Suite 600
Concord, CA 94520
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
foxboro mailing list: http://www.freelists.org/list/foxboro
to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
Other related posts: