69FIREBIRD
Member
Hi, I’m looking for some feedback on the best way to develop a one second pulsed (one shot) internal bit that is as accurate as possible, I am using this bit to increment (ADD) 1 to integer addresses each time the bit is true, these integer addresses are then used as timers with a 1 second time base throughout the program. Why not just use timers? My rational is to set up something similar to the user defended datatables in ControLogix (albeit limited). Within an integer file the first 10 words are addressed at bit level, the next 10 are addressed at word level for timers, the next 10 for counters, floating points can also be dealt with buy multiplication factors and stored within the integer file, etc. Along with this the file contains all the data relevant to a ladder file of the same number i.e. ladder file 10 is associated with integer file N10 therefore code written within a particular ladder file for a step in a process or individual component has a ladder file associated to it that also has an integer file associated with that which contains all the bit, timer, counter, HMI data, etc related to that step/component.
I have looked at the following:
NEQ S:42 N7:30 OSR N7:3/0 BST OTE N7:3/1 NXB MOV S:42 N7:30 BND
BST TON T4:0 0.01 99 16 NXB XIC T4:0/DN BST OTE N7:3/4 NXB RES T4:0 BND BND
Neither of which are accurate over time.
The best I have found so far is to use the STI interrupt on a 1 second base to scan a file that latches on the second pulse bit and then unlatch it at the end of the program scan, the problem I can see with this is that if the STI occurs part way through a scan then all references to the second pulse bit prior to that will not have seen the latched bit before the end of the scan.
Any Advise or feedback would be appreciated.
I have looked at the following:
NEQ S:42 N7:30 OSR N7:3/0 BST OTE N7:3/1 NXB MOV S:42 N7:30 BND
BST TON T4:0 0.01 99 16 NXB XIC T4:0/DN BST OTE N7:3/4 NXB RES T4:0 BND BND
Neither of which are accurate over time.
The best I have found so far is to use the STI interrupt on a 1 second base to scan a file that latches on the second pulse bit and then unlatch it at the end of the program scan, the problem I can see with this is that if the STI occurs part way through a scan then all references to the second pulse bit prior to that will not have seen the latched bit before the end of the scan.
Any Advise or feedback would be appreciated.
Last edited: