Quick Start


Port operates by reflecting messages in the most recently updated repository. Try creating and editing a basic project to see how you can modify and configure projects. Follow along to understand the process better.


How to create a repository


Before starting a Port project, you need to create a root folder that defines your messages. The subfolders within this root folder are managed as groups by Port, allowing users to organize messages by group. The root folder contains files with the *.enum extension and the structure of sub-group folders. Within the sub-group folders, message definition documents with the *.msg extension are created.

Here's an example

C:\Users\...>cd C:\Users\Demo C:\Users\Demo>port new Demo C:\Users\Demo>port add --group stage,efem

Here is an example of the structure of the generated repository

root_folder/
├── stage/
│   ├── *.msg
├── efem/
│   ├── *.msg 
└── *.enum

How to add messages


To declare a message, you need to edit the *.msg file in the sub-folder you created. By defining message data types and attributes as shown below, you can later utilize various features such as automatic logging and backup. Additionally, you can define relationships using predefined relations.

Here's an example of message file

STAGE_ACCELATOR          num                                                                                                                                             
STAGE_DECELATOR          num                                                                                                                                             
STAGE_HOME_SENSOR        enum.NonHome   api:IOBoardLib.DigtalInput PROPERTY:{"Argument":"1,0"}                                                                                                                                
STAGE_LOAD_MOVE_TIMEOUT  num                                                                                                                                            
STAGE_LOAD_POSITION      num                                                                                                                                            
STAGE_POSITION           enum.CHUCKPOS                                                                                                                                     
STAGE_POSITION_RATIO     num                                                                                                                                                 
STAGE_SPEED              num                                                                                                                                               

To link the declared relations in your messages, you need to add them to the project. This process involves entering the call key and the library name to complete the addition of the relation.

C:\Users\...>cd C:\Users\Demo C:\Users\Demo>port add --relation IOBoard1 IOBoardLib

Tip

If you see a message like [ERROR][open ..\proj.toml: Access is denied.] granting administrator privileges to the port.exe program will resolve the issue.

After linking the relations to your project, you can verify the integration using the following command

C:\Users\Demo>port show --relation C:\Users\Demo>[IOBoard1]IOBoardLib\IOBoardLib.dll

How to start project

Once all message definitions are complete, you can start the message server based on these definitions. Before running the server, upload all updated content to the local repository by entering port push in the console. Then, run the server with the command port run [project-name].

C:\Users\Demo>port push C:\Users\Demo>port run Demo --ng ignore [localhost:5001]Port Running ... OK Access point count [4] Relation count [2] NG point [CATEGORY_MSG_POINT_RELATION][4] NG point [CATEGORY_RELATION_MESSAGE][1] NG point [CATEGORY_MEMORY][2] NG point [CATEGORY_LIBRARY][3] NG point [CATEGORY_MSG_POINT_ENUM][136] Pressing 'CTRL + C' will initiate server shutdown. Please wait for all processes to safely terminate before closing the application.

Tip

When running the server, if you include --ng ignore in the command, it will summarize only the points where errors (NG) occur. For detailed information on these NG points, you can visit the following URL to view the NG point table:

http://localhost:5001/api/app/ng/?view=table

Good luck!