12.07.2015 Views

GX Works 2 Operating Manual Structured Project - Automation ...

GX Works 2 Operating Manual Structured Project - Automation ...

GX Works 2 Operating Manual Structured Project - Automation ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>GX</strong> <strong>Works</strong>24 PROGRAM CONFIGURATIONS● "Use MC/MCR"• This check box can be checked only if both of the "Use EN/ENO" and "Use Macrocode" check boxes arechecked.• If the MC/MCR instruction is used and the function block is not executed, the outputs and the current values oftimers in the function block are reset. (If the instruction is not used, the current values are retained).● Return value of functionProgram the function names as labels in a function to set a return value.Setting function names as labels is not needed. Data type set on "Result Type" can be used.Example: Set return value of function name "FUN_01" to 0FUN_01 := 0;● Applying function blocks to locations where instances are usedThe following shows the example of codes when the following programs are compiled.Note that devices are assigned as follows.• Input1: X0• Input2: X11• Output1: D10Use MacrocodeApplied(The check box is checked.)Not applied(The check box is not checked.)Code to be created in the program at thelocation of useLD X0AND X11INCP D10LD X0OUT M4096LD X11OUT M4097LD SM400CALL P2048LD SM400MOV D6144 D10NoneP2048LD M4096AND M4097INCP D6144RETFunction block code4 - 12 4.3.2 Setting properties of functions and function blocks

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!