HW not being called 1200 plc

adam_lhadi

Member
Join Date
Feb 2022
Location
algeria
Posts
59
hi everyone

i have this simple program using HSC

i set the NEW_RV to 1000 when rotating the encoder and when reaching 1000 the counting restart as it should be, but this happen only 3..6 times then the counting keeps increasing beyond 1000

the hardware configuration is set correctly

why am gating this problem



kind regards

aaaaaaaaaa.PNG
 
One possibility is that,

  • if the hardware interrupt (OB40) occurs to SET Tag_11 while OB1 is running, and
  • that hardware interrupt event occurs
    • after [OB1:Network 2 - CTRL_HSC], and
    • before [OB1:Network 3 - RESet Tag_11],
  • then [OB1:Network 3 - Reset Tag_11]
    • will reset Tag_11 back to 0, but do so
    • before the next time [OB1:Network 2 - CTRL_HSC] executes,
  • so the next time [OB1:Network 2 - CTRL_HSC] does execute,
    • Tag_11 will be 0, and
    • the CV input to the CTRL_HSC will be FALSE, so the count will not reset.
I believe the solution is to put the CTRL_HSC, with the same [CTRL_HSC_0_DB], into the hardware OB40 routine, with a TRUE rung feeding the CV input, and remove Tag_11 from the rung feeding the CV input to CTRL_HSC/CTRL_HSC_0_DB in OB1.

But I am not sure about that.
 
Last edited:
That approach does seem to work: the image below shows the result immediately after the CTRL_HSC_0_DB's CV value reached its RV value.

Although it seems odd that the CV (%ID1000) when the hardware interrupt OB40 is called is one less than the RV.
Untitled.png
 
One possibility is that,

  • if the hardware interrupt (OB40) occurs to SET Tag_11 while OB1 is running, and
  • that hardware interrupt event occurs
    • after [OB1:Network 2 - CTRL_HSC], and
    • before [OB1:Network 3 - RESet Tag_11],
  • then [OB1:Network 3 - Reset Tag_11]
    • will reset Tag_11 back to 0, but do so
    • before the next time [OB1:Network 2 - CTRL_HSC] executes,
  • so the next time [OB1:Network 2 - CTRL_HSC] does execute,
    • Tag_11 will be 0, and
    • the CV input to the CTRL_HSC will be FALSE, so the count will not reset.


If you put a counter (ADD misc_dint_tag 1 misc_dint_tag), then I strongly suspect that you will observer that the hardware interrupt OB40 routine is being called, because that misc_dint_tag will increment, even in the cases when the counter's RV is not reset to 0 in OB1. The most likely reason is the explanation above.

Once the CV exceeds the RV (assuming CV only counts up), the hardware interrupt to call OB40 will not happen again until the (DINT) CV wraps around from +2147483647 to -2147483648 and then increases through 0 and reaches 1000 again, because the interrupt condition is

  • only [CV equal to RV],
  • not [CV greater than or equal to RV].
 
Last edited:

Similar Topics

I am using Studio 5000. I know the AOIs are being called and setup properly but when I open the AOI the green bar on the left and right that show...
Replies
9
Views
3,384
I am using a 1769-L33 ERM CompactLogix 5333 Controller. how long does an energized coil stay on after the routine that the coil is in stops...
Replies
4
Views
2,602
I just want to be sure I am right about this... I have a number of ladders that I call based on a number, #1 = Ladder 1, #2 = ladder 2 etc. The...
Replies
4
Views
3,111
It has come to my attention that some dislike being called old or old man. If I did this my apologizes, sheesh I consider myself an old man. Being...
Replies
61
Views
13,938
Somewhere along the line I created an FB512 (and FB513) as S7-GRAPH programs. This then caused me some problems with my standard nomenclature...
Replies
4
Views
3,883
Back
Top Bottom