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
plc:software_plc_examples [2019/07/12 09:26] ivanplc:software_plc_examples [2022/03/29 15:55] (current) ivan
Line 1: Line 1:
 ==== Software PLC examples ==== ==== Software PLC examples ====
 +
 +//**NOTE**: The myCNC team recommends utilizing the examples provided in this manual (as well as other manuals in this documentation) as a starting point for your machine setup. When possible (and applicable), it is recommended to keep changes to a mininum. In general, using these examples as the basis for your PLCs/macro commands allows for an easier setup process.//
 +
 +===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 208:
  
  
-==== 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 265:
 }; };
  
 +</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.1562937971.txt.gz · Last modified: 2019/07/12 09:26 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki