User Tools

Site Tools


plc:software_plc_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
plc:software_plc_examples [2019/07/12 09:26] ivanplc:software_plc_examples [2021/02/03 16:06] ivan
Line 1: Line 1:
 ==== Software PLC examples ==== ==== Software PLC examples ====
 +
 +===General examples===
  
   * [[How to add mandatory Homing after Emergency Button and-or Servo ready alarm]]   * [[How to add mandatory Homing after Emergency Button and-or Servo ready alarm]]
Line 204: Line 206:
  
  
-==== Jog Step (0.001, 0.01, 0.1 1.0) Indication with external LED display ====+===Jog Step (0.001, 0.01, 0.1 1.0) Indication with external LED display===
  
  
Line 261: Line 263:
 }; };
  
 +</code>
 +
 +
 +===Switching an output ON for a certain period of time===
 +
 +<code>
 +#define OUTPUT_TIMER 15
 +main()
 +{
 +count=0;
 +do{
 +a=gvarget(7373);
 +
 +if (a!=0)
 +{
 +  count++;
 +  if (count<30) { portset(OUTPUT_TIMER); }
 +  else { 
 +            portclr(OUTPUT_TIMER); 
 +            if (count>6000) { count=0; };
 +          };
 +}else
 +{
 +  portclr(OUTPUT_TIMER);
 +  count=0;
 +};
 +}while(1);
 +exit(99);
 +};
 </code> </code>
  
plc/software_plc_examples.txt · Last modified: 2022/03/29 15:55 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki