First of all, I like the way you put the underscore in your text tool - looks sharp.
Not sure why you are getting the duplicated entry - I don’t see anything obvious and I haven’t ran your project to see what happens, just looked through your chart. I’m sure you will track it down- you are learning fast. Perhaps the following suggestion will help you refactor your code a bit and the bug will go away or be easier to track down…
You could definitely create a subroutine for these calls. There is a computer science term called DRY, which means “Don’t repeat yourself”.
When you find yourself writing the same code over and over, you should stop and ask yourself if you could put this into a subroutine (or create a loop and use pointers/tables - a bit more advanced)
So after reviewing two of your blocks (RF Frequency and Tuner Position) I find these are the only significant differences:
Error message name and text (could you use the data label constant here too?)
Data label constant (e.g. sTUNERPOSITION)
So I think you could have a subroutine something like:
You could call this for every point:
and even better you could put the parameters in tables and create a loop to call the subroutine:
for i=0 to nLastIndex step 1
Now when you need to add another item, you add it to the register and label tables and increase nLastIndex.
So, I may be over-simplifying a bit (as you have different modbus function codes to deal with and probably some other things), but that would reduce 22 blocks of code to a few lines + subroutine and an initialization block for your tables. Also, you will only have one subroutine to debug instead of 22+ blocks.