nick88
Member
Hello,
I am wanting to totalize barrels by interpolating a flowrate in the PLC.
I have a MicroLogix 1400 plc w/ an IF4 expansion card. I am bringing in a (4-20ma) analog input measuring flowrate in BBL/DAY. I am scaling the range from 515 to 6000 bbl/day using the SCP function block and setting it in the register F8:1.
To totalize my barrels, I am using an STI (periodic) task to run a program with a 1 second delay between scans.
At the beginning of the periodic program, I take the floating point register (F8:1) and then multiply by .000012 to convert to bbl/sec and set that value in F8:2. The next rung, I add F8:2 (flowrate) and F8:3 (total) and set equal to F8:3.
When my total is greater than 1000, I add .001 to an integer (N7:13) to get millions of barrels. I then subtract 1000 from F8:3 to reset it.
To implement a STI program, do I need to just configure the STI function file under the STI tab in function files?
Do I appear to be on the right track with my code?
I am wanting to totalize barrels by interpolating a flowrate in the PLC.
I have a MicroLogix 1400 plc w/ an IF4 expansion card. I am bringing in a (4-20ma) analog input measuring flowrate in BBL/DAY. I am scaling the range from 515 to 6000 bbl/day using the SCP function block and setting it in the register F8:1.
To totalize my barrels, I am using an STI (periodic) task to run a program with a 1 second delay between scans.
At the beginning of the periodic program, I take the floating point register (F8:1) and then multiply by .000012 to convert to bbl/sec and set that value in F8:2. The next rung, I add F8:2 (flowrate) and F8:3 (total) and set equal to F8:3.
When my total is greater than 1000, I add .001 to an integer (N7:13) to get millions of barrels. I then subtract 1000 from F8:3 to reset it.
To implement a STI program, do I need to just configure the STI function file under the STI tab in function files?
Do I appear to be on the right track with my code?
Last edited: