Hello I am fairly new to PLC programming and am trying to figure out how to write a particular program.
I am trying to write a program that will increase an analog output by 5% each time a button is pushed.
When the button is initally pushed I am going to move a value of 5% into a an interger register lets say N7:1. Each each time the button is pushed again I'm going to use the add function to add 5% to what is in N7:1 and then write the result back to N7:1.
In order to output whatever value is in N7:1 at any time I am going to put the value at N7:1 in a scaled output block and scale it 0-100% = 6553-32768.
So when the button is first pressed it will write a 5 into N7:1. When the button is pressed again it will add 5 to the value of 5 in N7:1 and write this total of 10 back into N7:1. This value of 10 will then be referenced to the scaled output block which will give it its corrosponding analog output.
Am I missing something here?
I am trying to write a program that will increase an analog output by 5% each time a button is pushed.
When the button is initally pushed I am going to move a value of 5% into a an interger register lets say N7:1. Each each time the button is pushed again I'm going to use the add function to add 5% to what is in N7:1 and then write the result back to N7:1.
In order to output whatever value is in N7:1 at any time I am going to put the value at N7:1 in a scaled output block and scale it 0-100% = 6553-32768.
So when the button is first pressed it will write a 5 into N7:1. When the button is pressed again it will add 5 to the value of 5 in N7:1 and write this total of 10 back into N7:1. This value of 10 will then be referenced to the scaled output block which will give it its corrosponding analog output.
Am I missing something here?