Re: [foxboro] CALCA

  • From: Corey R Clingo <corey.clingo@xxxxxxxx>
  • To: foxboro@xxxxxxxxxxxxx
  • Date: Tue, 16 Aug 2011 10:19:45 -0500

I did this on one application, and it worked well once I figured out how 
the *X logic instructions _really_ worked (i.e., the documentation was 
inaccurate and misleading). Essentially, you have to watch out for 
implicit type coercion between signed and unsigned integer when using some 
of those instructions (but not others).

As for Nick's comment about code documentation, I agree, and I took great 
pains to document both in the CALCA and externally. I used CALCA because 
of Alex's rules(tm), and the fact that I needed the code to run every scan 
and I didn't want to worry about BPCSTM issues with an IND block. Further, 
most people around here are more familiar with CALC code than HLBL.


Corey
 



From:
"Wilson, Brad" <brad.wilson@xxxxxxxxxxxx>
To:
"foxboro@xxxxxxxxxxxxx" <foxboro@xxxxxxxxxxxxx>
Date:
08/16/2011 08:49 AM
Subject:
Re: [foxboro] CALCA
Sent by:
foxboro-bounce@xxxxxxxxxxxxx



Similarly, you can connect a 32-bit packed integer to LI01 and access the 
bits directly as I01-I32.

IN I01 ; read bit 1 of LI01 to the stack
IN I17 ; read bit 17 of LI01 to the stack

Only LI01 and LO01 can be accessed bit-wise, not LI02 & LO02.

If you want to do 16-bit logic (ANDX, XORX, etc), use INH & INL to read 
the high & low 16-bits of of LIxx or LOxx.

Brad Wilson
Invensys Operations Management
SAMREF Project Team
brad.wilson@xxxxxxxxxxxx
732-874-0087 cell
626-599-2502 office
971 (04) 807 4799 Dubai office
971 (055) 284 1692 Dubai cell

-----Original Message-----
From: foxboro-bounce@xxxxxxxxxxxxx [mailto:foxboro-bounce@xxxxxxxxxxxxx] 
On Behalf Of Badura, Tom
Sent: Tuesday, August 16, 2011 5:29 PM
To: foxboro@xxxxxxxxxxxxx
Subject: Re: [foxboro] CALCA

John,
I think I have done something like this in the past.  May not be exactly
right, but I believe the concept works.

Bring booleans in via MCOUTs into II01 and 02 on CALCA and move into
LO01.  You can then perform Boolean operations on the individual bits in
LO01 (O01-O32). 

Booleans 1-16 -->  IN1-16[MCOUT1]PAKCRB  --> II01[CALCA]
                                                |----->LO01 
Booleans 17-32 --> IN1-16N[MCOUT2]PAKCRB --> II02[CALCA]

Something Like

IN II01;  B1-16 to High Bytes
STH LO01;
IN II02;   B17-B32 to Low Bytes
STL LO01
  |
AND L01 LO2;  Do Required Boolean Logic
OR L17 L18;  etc


Tom Badura
Plastics Engineering Company
tbadura@xxxxxxxxxx



 
 
_______________________________________________________________________
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:             //www.freelists.org/list/foxboro
to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
 

Other related posts: