Reputation: 75
I've just begun PLC programming and did not find too much literature on the internet so sorry if my question is stupid.
If I want to start a motor when my sensor gives a signal, then can I set the motor in every cycle while my sensor gives the signal?
Or should I check if the signal has changed since the last cycle?
I use Siemens S7-300 by the way.
Upvotes: 0
Views: 73
Reputation: 11
Your question is a little unclear to me, but I'll try to help.
If you want to start the engine after the sensor gives you a signal, you must first read the value of the sensor, if appropriate, then start the engine. You must perform this operation in each cycle if you want the engine to be properly positioned.
There is also an option for the engine to run continuously for as long as the sensor gives a signal, and if you want to adjust it further (speed, torque) you must use additional hardware such as a frequency modulator. Adjustment with the S7-300 is not possible in this case.
Upvotes: 0
Reputation: 1424
If I understood correctly, you mean that if you should use for example set/reset block to write output or if you should write the value every cycle?
Basically, you can do both. If you set the motor run command once and then reset it when necessary, it should work. The value will be held in memory. But in my opinion, a better approach in PLC programming is to set the output value always.
By writing a value every cycle you can be sure that it is what is should be. After all, PLCs are quite low level systems and there could be a situation that somehow memory is overwritten from somewhere else and your value is something else than you think.
So my suggestion is: If you have an output for motor run command, write it every cycle. Then you can be 100 % sure that the value is the one you think it should be.
Upvotes: 2