Hello all,
Can someone please look at the attached program to give me some help figuring out why one of my counts (the 'actual' count triggered by the sensor input) is zeroing itself out? Looks like it may be rolling over after 9999, but I haven't totally confirmed this.
I am not using a counter, but incrementing a register to do the counting (look in the interrupt routines). To handle the ten thousands digit and up I am incrementing the adjacent memory location each time the four least significant digits are zero (it should not happen the first time the interrupt is called, since the conditions are checked after the least significant word is incremented). Am I right in doing this, or will the 0000 9999 roll into 0001 0000 directly?
To give an idea of the physical setup, I have an Automation Direct DL06-DD1 hooked up to a C-more panel at each of three printing presses. The only inputs (3 total) are a single proximity sensor at each machine wired to high speed inputs X0, X1, and X2. The outputs (9 total) are a three level stack at each of the three presses. The run time is determined indirectly by using the time between pulses rather than tying into the machine (again see the program and the interrupts). You will notice that each section of the program is repeated three times (the comments and labels end with -1, -2, -3 to specify the machine number)
Please take a look and see if (i.e. where) I have made some errors. If any specific questions come up, I will be checking in and will get back to you shortly.
Thanks!
Can someone please look at the attached program to give me some help figuring out why one of my counts (the 'actual' count triggered by the sensor input) is zeroing itself out? Looks like it may be rolling over after 9999, but I haven't totally confirmed this.
I am not using a counter, but incrementing a register to do the counting (look in the interrupt routines). To handle the ten thousands digit and up I am incrementing the adjacent memory location each time the four least significant digits are zero (it should not happen the first time the interrupt is called, since the conditions are checked after the least significant word is incremented). Am I right in doing this, or will the 0000 9999 roll into 0001 0000 directly?
To give an idea of the physical setup, I have an Automation Direct DL06-DD1 hooked up to a C-more panel at each of three printing presses. The only inputs (3 total) are a single proximity sensor at each machine wired to high speed inputs X0, X1, and X2. The outputs (9 total) are a three level stack at each of the three presses. The run time is determined indirectly by using the time between pulses rather than tying into the machine (again see the program and the interrupts). You will notice that each section of the program is repeated three times (the comments and labels end with -1, -2, -3 to specify the machine number)
Please take a look and see if (i.e. where) I have made some errors. If any specific questions come up, I will be checking in and will get back to you shortly.
Thanks!