Difference between revisions of "TestIT:Programming"

From Nolek Wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
=5. Programming=
 +
 
The programming service allows you to create, update, and delete programs. A test of programs can also be done in this element.
 
The programming service allows you to create, update, and delete programs. A test of programs can also be done in this element.
 
[[File:TestIT_Programming_1.png|right|TestIT Info]]
 
[[File:TestIT_Programming_1.png|right|TestIT Info]]
 
'''Options'''
 
* [[File:TestIT_Home.png|TestIT Home button]] Home - go back to home screen
 
* [[File:TestIT_Programming_Editor_1.png|Programming editor]] Editor - go to program editor
 
  
 
An overview of programming
 
An overview of programming
 
<gallery>
 
<gallery>
File:TestIT_Programming_Select.png|Program selector
+
File:TestIT_Programming_Select.png|
 
</gallery>
 
</gallery>
 +
 +
'''Options'''
 +
* [[File:TestIT_Home.png|TestIT Home button]] Home - go back to home screen
 +
* [[File:TestIT_Programming_Editor_1.png|Programming editor]] [[TestIT:Programming#5.2_Program_editor|Program Editor]] - go to program editor
  
 
==5.1 Programs==
 
==5.1 Programs==
Line 22: Line 24:
  
 
<gallery>
 
<gallery>
File:TestIT_Programming_Editor_02.png|Program editor
+
File:TestIT_Programming_Editor_02.png|
 
</gallery>
 
</gallery>
  
Line 61: Line 63:
  
 
'''Options'''
 
'''Options'''
 +
* [[File:TestIT_Home.png|TestIT Home button]] Home - go back to home screen
 
* [[File:TestIT Programming Editor 1.png|Program editor]] Program editor – go to program edit
 
* [[File:TestIT Programming Editor 1.png|Program editor]] Program editor – go to program edit
 
* [[File:TestIT_Programming_NotConnected.png|Not connected]] Not connected to I/O – is not connected to TwinCat I/O's
 
* [[File:TestIT_Programming_NotConnected.png|Not connected]] Not connected to I/O – is not connected to TwinCat I/O's
 
* [[File:TestIT_Programming_Connected.png|Connected]] Connected to I/O – is connected to TwinCat I/Os
 
* [[File:TestIT_Programming_Connected.png|Connected]] Connected to I/O – is connected to TwinCat I/Os
 +
* [[File:TestIT_Not_debugging.png|Not Debugging]] Not debugging guide steps
 +
* [[File:TestIT_Debugging.png|Debugging]] Debugging guide steps
  
 
====5.2.3.1 Code/debug window====
 
====5.2.3.1 Code/debug window====
Line 84: Line 89:
 
In the symbol tab it is possible to add some symbols. Press the green plus and the symbol will be added to the watch list.
 
In the symbol tab it is possible to add some symbols. Press the green plus and the symbol will be added to the watch list.
  
==5.3 Functions==
+
==5.3 Commands==
[[TestIT:Programming_Functions|Functions]]
+
* [[TestIT:Programming_Functions|Functions]]<br />
[[TestIT:Programming_Misc|Misc]]
+
* [[TestIT:Programming_Misc|Misc]]<br />
[[TestIT:Programming_Display|Display]]
+
* [[TestIT:Programming_Display|Display]]<br />
[[TestIT:Programming_Image|Image]]
+
* [[TestIT:Programming_Image|Image]]<br />
[[TestIT:Programming_Math|Math]]
+
* [[TestIT:Programming_Math|Math]]<br />
[[TestIT:Programming_DateTime|DateTime]]
+
* [[TestIT:Programming_DateTime|DateTime]]<br />
[[TestIT:Programming_Text|Text]]
+
* [[TestIT:Programming_Text|Text]]<br />
[[TestIT:Programming_Files|Files]]
+
* [[TestIT:Programming_Files|Files]]<br />
[[TestIT:Programming_InternalDevice|InternalDevice]]
+
* [[TestIT:Programming_InternalDevice|InternalDevice]]<br />
[[TestIT:Programming_Database|Database]]
+
* [[TestIT:Programming_Database|Database]]<br />
[[TestIT:Programming_Serial|Serial]]
+
* [[TestIT:Programming_Serial|Serial]]<br />
[[TestIT:Programming_Socket|Socket]]
+
* [[TestIT:Programming_Socket|Socket]]<br />
[[TestIT:Programming_S9RS232|S9RS232]]
+
* [[TestIT:Programming_S9RS232|S9RS232]]<br />
[[TestIT:Programming_C9|C9]]
+
* [[TestIT:Programming_C9|C9]]<br />
[[TestIT:Programming_Printer|Printer]]
+
* [[TestIT:Programming_Printer|Printer]]<br />
[[TestIT:Programming_Guide|Guide]]
+
* [[TestIT:Programming_Guide|Guide]]<br />
[[TestIT:Programming_S10|S10]]
+
* [[TestIT:Programming_S10|S10]]<br />
[[TestIT:Programming_S11|S11]]
+
* [[TestIT:Programming_S11|S11]]<br />
 +
* [[TestIT:Programming_mosCura|mosCura]]<br />
 +
* [[TestIT:Programming_Modbus|Modbus]]<br />
  
 
==5.4 Standard project==
 
==5.4 Standard project==
 +
 +
When “insert standard project” is marked, it will insert the code below:
 +
 +
<code>Standard project structure</code><br>
 +
<code>'**************************************</code><br>
 +
<code>/* Main Sub: Add comment here  */</code><br>
 +
<code>Function.Sub(Main)</code><br>
 +
<code>    'Add comment</code><br>
 +
<code>    Function.GoSub(1000)</code><br><br>
 +
   
 +
<code>    'Add comment</code><br>
 +
<code>    Function.GoSub(2000)</code><br><br>
 +
   
 +
<code>    'Add comment</code><br>
 +
<code>    Function.GoSub(3000)</code><br><br>
 +
   
 +
<code>    'Add comment</code><br>
 +
<code>    Function.GoSub(4000)</code><br><br>
 +
   
 +
<code>    'Add comment</code><br>
 +
<code>    Function.GoSub(5000)</code><br><br>
 +
   
 +
<code>    'Add comment</code><br>
 +
<code>    Function.GoSub(6000)</code><br><br>
 +
   
 +
<code>    'Add comment</code><br>
 +
<code>    Function.GoSub(7000)</code><br><br>
 +
   
 +
<code>    'Add comment</code><br>
 +
<code>    Function.GoSub(8000)</code><br><br>
 +
   
 +
<code>    'Add comment</code><br>
 +
<code>    Function.GoSub(9000)</code><br>
 +
<code>Function.EndSub()</code><br><br>
 +
 +
<code>'**************************************</code><br>
 +
<code>/* Sub 1000: Add comment here  */</code><br>
 +
<code>Function.Sub(1000)</code><br>
 +
<code>    Misc.Reset(_seqOK)</code><br><br>
 +
   
 +
<code>    Misc.Set(_seqOK)</code><br>
 +
<code>Function.EndSub()</code><br><br>
 +
 +
<code>'**************************************</code><br>
 +
<code>/* Sub 2000: Add comment here  */</code><br>
 +
<code>Function.Sub(2000)</code><br>
 +
<code>    Misc.Reset(_seqOK)</code><br><br>
 +
   
 +
<code>    Misc.Set(_seqOK)</code><br>
 +
<code>Function.EndSub()</code><br><br>
 +
 +
<code>'**************************************</code><br>
 +
<code>/* Sub 3000: Add comment here  */</code><br>
 +
<code>Function.Sub(3000)</code><br>
 +
<code>    Misc.Reset(_seqOK)</code><br><br>
 +
   
 +
<code>    Misc.Set(_seqOK)</code><br>
 +
<code>Function.EndSub()</code><br><br>
 +
 +
<code>'**************************************</code><br>
 +
<code>/* Sub 4000: Add comment here  */</code><br>
 +
<code>Function.Sub(4000)</code><br>
 +
<code>    Misc.Reset(_seqOK)</code><br><br>
 +
   
 +
<code>    Misc.Set(_seqOK)</code><br>
 +
<code>Function.EndSub()</code><br><br>
 +
 +
<code>'**************************************</code><br>
 +
<code>/* Sub 5000: Add comment here  */</code><br>
 +
<code>Function.Sub(5000)</code><br>
 +
<code>    Misc.Reset(_seqOK)</code><br><br>
 +
   
 +
<code>    Misc.Set(_seqOK)</code><br>
 +
<code>Function.EndSub()</code><br><br>
 +
 +
<code>'**************************************</code><br>
 +
<code>/* Sub 6000: Add comment here  */</code><br>
 +
<code>Function.Sub(6000)</code><br>
 +
<code>    Misc.Reset(_seqOK)</code><br><br>
 +
   
 +
<code>    Misc.Set(_seqOK)</code><br>
 +
<code>Function.EndSub()</code><br><br>
 +
 +
<code>'**************************************</code><br>
 +
<code>/* Sub 7000: Add comment here  */</code><br>
 +
<code>Function.Sub(7000)</code><br>
 +
<code>    Misc.Reset(_seqOK)</code><br><br>
 +
   
 +
<code>    Misc.Set(_seqOK)</code><br>
 +
<code>Function.EndSub()</code><br><br>
 +
 +
<code>'**************************************</code><br>
 +
<code>/* Sub 8000: Add comment here  */</code><br>
 +
<code>Function.Sub(8000)</code><br>
 +
<code>    Misc.Reset(_seqOK)</code><br><br>
 +
   
 +
<code>    Misc.Set(_seqOK)</code><br>
 +
<code>Function.EndSub()</code><br><br>
 +
 +
<code>'**************************************</code><br>
 +
<code>/* Sub 9000: Add comment here  */</code><br>
 +
<code>Function.Sub(9000)</code><br>
 +
<code>    Misc.Reset(_seqOK)</code><br><br>
 +
   
 +
<code>    Misc.Set(_seqOK)</code><br>
 +
<code>Function.EndSub()</code><br><br>
 +
 +
<code>'**************************************</code><br>
 +
<code>/* Sub System Stop: Add comment here  */</code><br>
 +
<code>Function.Sub(system_stop)</code><br>
 +
<code>Function.EndSub()</code><br>

Latest revision as of 12:40, 10 September 2019

5. Programming

The programming service allows you to create, update, and delete programs. A test of programs can also be done in this element.

TestIT Info

An overview of programming

Options

5.1 Programs

Select a program and an overview of the program with details will be shown. Here it is possible to switch between the programs. By a pressing on the View program button, the program editor will be shown.

5.2 Program editor

It is possible to go to program editor on the main menu of the programming. Just press on the program editor symbol. It is also possible by selecting the wanted program and then pressing View program. The picture shown below is when the program editor symbol is selected.

Options

  • All programs All programs - view all programs
  • New program New program - create new program
  • Program symbols Program symbols - open program symbols menu
  • Comment Comment – insert a comment in the program
  • Save program Save – save the program
  • Compile program Compile – compile the program to check for errors (F6)
  • Debug Debug – compile, save and open the debug area (F5)
  • Config Config – open the command configurations area (F2)
  • Command info Info – display command info (F3)
  • Symbols Symbols – open symbol handler (F4)

5.2.1 Create new program

  1. Press the Create new program button
  2. Write program name (required)
  3. Write a description of the program
  4. Select Active, if the program has to be active
  5. Select insert standard project to insert a TestIT standard project
  6. Press Create – or Cancel and the program will not be created

Now it is for example possible to insert the wanted functions, debug the codes, go to production and run it.

5.2.2 Program symbols

To select program symbol, a program has to be viewed or a new program has to be created. In this, all the symbols which are defined as a program symbol will be shown to the right. Now it is possible to select the symbols for the selected program. Press the Save symbol to add the program symbol to the program and press the Trash symbol to remove a program symbol from a program.

5.2.3 Debug area

In the debug area, all the codes can be tested to see if they are correct. To go to this area, press the Debug button.

This debug area is divided into three windows:

  • Code/debug window
  • Production window
  • Symbol watch list window

Options

  • TestIT Home button Home - go back to home screen
  • Program editor Program editor – go to program edit
  • Not connected Not connected to I/O – is not connected to TwinCat I/O's
  • Connected Connected to I/O – is connected to TwinCat I/Os
  • Not Debugging Not debugging guide steps
  • Debugging Debugging guide steps

5.2.3.1 Code/debug window

In this window, all the codes are shown. The codes can be shown while the program is running in normal or in step mode. The buttons in the bottom, from left to right:

Run program Run program – press and the program will start like it would start in production
Step mode Run program in step mode – the program will execute one line. After a press on this button the Step to next line button is going to be used
Next line Step to next line – press and the program will execute the next line
Continue Continue run – press and the program will execute to the end
Stop Stop program – press and the program will stop
Pause Pause – press and the program can run in Step mode or with Continue run

5.2.3.2 Production window

The production window shows what it will look like in the production. It will show the status of the run.

5.2.3.3 Symbol watch list window

In this window, it is possible to watch and change the symbol values. There are two tabs; one with a watch list of the selected symbols; the other is symbols, and is a list of the symbols that can be selected. If a symbol is unwanted, press the red cross and the symbol will disappear. To empty the list of the selected symbols empty, select the Empty list button. In the symbol tab it is possible to add some symbols. Press the green plus and the symbol will be added to the watch list.

5.3 Commands

5.4 Standard project

When “insert standard project” is marked, it will insert the code below:

Standard project structure
'**************************************
/* Main Sub: Add comment here */
Function.Sub(Main)
'Add comment
Function.GoSub(1000)

'Add comment
Function.GoSub(2000)

'Add comment
Function.GoSub(3000)

'Add comment
Function.GoSub(4000)

'Add comment
Function.GoSub(5000)

'Add comment
Function.GoSub(6000)

'Add comment
Function.GoSub(7000)

'Add comment
Function.GoSub(8000)

'Add comment
Function.GoSub(9000)
Function.EndSub()

'**************************************
/* Sub 1000: Add comment here */
Function.Sub(1000)
Misc.Reset(_seqOK)

Misc.Set(_seqOK)
Function.EndSub()

'**************************************
/* Sub 2000: Add comment here */
Function.Sub(2000)
Misc.Reset(_seqOK)

Misc.Set(_seqOK)
Function.EndSub()

'**************************************
/* Sub 3000: Add comment here */
Function.Sub(3000)
Misc.Reset(_seqOK)

Misc.Set(_seqOK)
Function.EndSub()

'**************************************
/* Sub 4000: Add comment here */
Function.Sub(4000)
Misc.Reset(_seqOK)

Misc.Set(_seqOK)
Function.EndSub()

'**************************************
/* Sub 5000: Add comment here */
Function.Sub(5000)
Misc.Reset(_seqOK)

Misc.Set(_seqOK)
Function.EndSub()

'**************************************
/* Sub 6000: Add comment here */
Function.Sub(6000)
Misc.Reset(_seqOK)

Misc.Set(_seqOK)
Function.EndSub()

'**************************************
/* Sub 7000: Add comment here */
Function.Sub(7000)
Misc.Reset(_seqOK)

Misc.Set(_seqOK)
Function.EndSub()

'**************************************
/* Sub 8000: Add comment here */
Function.Sub(8000)
Misc.Reset(_seqOK)

Misc.Set(_seqOK)
Function.EndSub()

'**************************************
/* Sub 9000: Add comment here */
Function.Sub(9000)
Misc.Reset(_seqOK)

Misc.Set(_seqOK)
Function.EndSub()

'**************************************
/* Sub System Stop: Add comment here */
Function.Sub(system_stop)
Function.EndSub()