20.6.10.3. Julia Function

Dialog Box

../_images/image233.png

Figure 20.157 JlFunction dialog box

Table 20.95 Parameter

Parameter(s)

Description

Port Type

Selects the port type

Number of inputs

Enters the number of inputting data

Number of outputs

Enters the number of outputting data

Number of input ports

Enters the number of inputting port

Number of output ports

Enters the number of outputting port

Function Name

Defines the name of using function in the Julia function block

Code Editor

Enters a function code for the Julia function block

Test

Performs the inputted code of Code Editor on trial. The result of test is displayed by Output.

Export

Saves a file as inputted code in Code Editor

Import

Displays the content in Code Editor after selecting a code or a Julia code file.

Output

Displays the result of test or error messages.

Note

The original form of using function is int Function Name (y, u). Function Name can be changed in the original form.
You can use global variables, the PV list, working values by Pre-Event.
The displayed code of Code Editor is saved as block name.jl of the folder which has a CoLink model when performing a simulation.

20.6.10.3.1. Example

You can test the Jl Function block with the CoLink model shown in the below figures.

../_images/image234.png
../_images/image235.png

Figure 20.158 Example of Julia Function [Single Type]

../_images/image236.png
../_images/image237.png

Figure 20.159 Example of Julia Function [Multi Type]

20.6.10.4. Python Function

Dialog Box

../_images/image2331.png

Figure 20.160 PythonFunction dialog box

Table 20.96 Parameter

Parameter(s)

Description

Port Type

Selects the port type

Number of inputs

Enters the number of inputting data

Number of outputs

Enters the number of outputting data

Number of input ports

Enters the number of inputting port

Number of output ports

Enters the number of outputting port

Function Name

Defines the name of using function in the Python function block

Code Editor

Enters a function code for the Python function block

Test

Performs the inputted code of Code Editor on trial. The result of test is displayed by Output.

Export

Saves a file as inputted code in Code Editor

Import

Displays the content in Code Editor after selecting a code or a Julia code file.

Output

Displays the result of test or error messages.

Note

The original form of using function is int Function Name (y, u). Function Name can be changed in the original form.
You can use global variables, the PV list, working values by Pre-Event.
The displayed code of Code Editor is saved as block name.py of the folder which has a CoLink model when performing a simulation.

20.6.10.4.1. Example

You can test the PythonFunction block with the CoLink model shown in the below figures.

../_images/image2341.png
../_images/image2351.png

Figure 20.161 Example of Python Function [Single Type]

../_images/image2361.png
../_images/image2371.png

Figure 20.162 Example of Python Function [Multi Type]