Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
Connect(runtimeHostAddress, userName, password):

runtimeHostAddress  =  IP address or server name
userName  = User name.
password = Password


  • Get a Status of Server Connectionserver connection status
Code Block
GetConnectionStatus ()                 

...

Code Block
Disconnect()


  • Set a flag waiting value from server
Code Block
SetSyncFlag(flag):

flag = True wait value from server, false does not wait value from server.


  • Retrieve a current value
Code Block
GetObjectValue(name)

name = TagName


  • Set a new value for an object
Code Block
SetObjectValue(name, newValue)

name = TagName
newValue = new value to set in the tag.

...

Using Namespace in CodeBehind

In this first example, there are two input parameters called val1 and val2 that will be summarized and the result will be stored in the result variable.

...

In this scenario, we configure a task for the Python language. In the Python file name field, you need to set the Python file that will be to be executed. In this example, we used the Main2.py.

...

In the Standard Output field, we selected a tag called output. This tag type must be text. In the Arguments field, we selected another type of tag called script.

The Using the print method, the Python file called Main2.py gets the retrieves the input data and outputs its value inside a string, using the print method. Where the . The sys.argv will receive the Tag.script and the output tag will receive all the values from the print() method.


Code Block
import sys

value = sys.argv[1] print("Value: " + value) print("That’s  all  folks!")

...