
RedParadox (Customer) asked a question.
So I'm adding some logic to my PLC. Currently, I have a Manual Keypad Entry on the C-More HMI that will write to DS100. This can be any number from 1-126 for operator input. But let's say I want to have specific values added with their own button... When it was only 3 possible values, I made a C-Bit that triggered code manually like so:
HMI Button triggers C1321, C1321 performs Copy 21 to DS100, reset C1321
HMI Button triggers C1342, C1342 performs Copy 42 to DS100, reset C1342
HMI Button triggers C1365, C1365 performs Copy 65 to DS100, reset C1365
And this works fine for 3, or even 5, but let's say I have 20 or more...
Is there a way to say for ANY C1301-1399, Copy 1-99 (based on which one I enabled) to DS100, Reset C1301-1399 (Resetting them all is fine) so I don't have to write the same code 99 times but change the numbers for each?
Edit: I appreciate the replies, but I just now realized I'm technically asking the wrong question... The end goal here is that Myself or Someone can add a button to the HMI that adds a given integer to a DS in one click (without a keypad entry) and I was trying to write code to do that the only way I know how. Since I already have code that takes DS100 and unpacks it to binary (1-127) for 7 outputs to an MP3 playback... Ah well. Unless there's a way to get C-More to set DS100 to an arbitrary number with a single button, I'll just go back to Plan B and handcode the few C-Bits I need and a subroutine to copy them over.
Have you looked at the recipe button on the Cmore? You can set a value with one button press.