Detailed description
2.4 Starting up the PLC program
Basic logic functions: PLC basic program solution line (P3 sl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
23
Return parameter value:
0
= OK
-1
= Function unavailable, call Magic function beforehand
-2
= File name cannot be generated
-4
= Container parameter invalid or container block empty
-5
= Internal error (memory request rejected by Windows)
-6
= Internal error (problem in STEP 7 project)
-7
= Write error when generating series start-up files (e.g. disk full)
Use in script
If S7Ext.Magic("") < 0 Then
Wscript.Quit(1)
End If
Set Proj1 = s7.Projects("new")
set S7Prog = Nothing
Set s7prog = Proj1.Programs.Item(1) 'if there is only one program'
For Each cont In s7prog.Next
If (Cont.ConcreteType = S7BlockContainer) Then
' Check block container
Exit For
End if
Cont = Nothing
Next
Error = S7Ext.MakeSerienIB("f:\dh\arc.dir\PLC.arc", 0, Cont)
' Now error analysis
The For Each...Next Block programmed above can be programmed in the Delphi
programming language as follows (the programming for C, C++ programming languages is
similar).
Var
EnumVar: IEnumVariant;
rgvar: OleVariant;
fetched: Cardinal;
//For Each Next
EnumVar := (S7Prog.Next._NewEnum) as IEnumVariant;
While (EnumVar.Next(1,rgvar,fetched) = S_OK) Do Begin
Cont := IS7Container(IDispatch(rgvar)); // block container,
check sources
If (Cont.ConcreteType = S7BlockContainer) Then Break;
Cont := NIL;
End;
Summary of Contents for SINUMERIK 840D sl
Page 282: ...Index Basic logic functions Acceleration B2 64 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 388: ...Basic logic functions Travel to fixed stop F1 Function Manual 11 2006 6FC5397 0BP10 2BA0 52 ...
Page 962: ...Index Basic logic functions Emergency Stop N2 20 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 1704: ...Constraints Basic logic functions Spindles S1 94 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 1716: ...Index Basic logic functions Spindles S1 106 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 1996: ...Index Basic logic functions Tool Offset W1 208 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 2150: ...Table of contents Basic logic functions Appendix 4 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...
Page 2184: ...Glossary Basic logic functions Appendix 38 Function Manual 11 2006 6FC5397 0BP10 2BA0 ...