Sorting line by using the library WindowTracking
This example shows a small example of a sorting line with 4 exits.
In this example every second, a TransportWindow
will be created and one of 16 items in a list will be assigned to this window. Each item has one sort destination (exit point).
During the execution, a encoder will be simulated. This encoder will be incremented by 10mm every 10ms (corresponds 1m/s belt speed). In your application, the simulated encoder has to be replaced by a concrete one of type IEncoder
.
The TransportWindow
will be moved according the encoder values. When a TransportWindow
reaches a VirtualTrigger
, it will be activated and the event handler which belongs to the VirtualTrigger
, will be executed.
-
If the event handler is a
SortDecisionEvent
:The
SortDecisionEvent
check, if the assigned item in theTransportWindow
is designated for the activeTriggerPoint
.If yes, the exit handler of the
SortDecisionEvent
will be executed. In your application, you've to implement your own exit handler (e.g. if the exit is another conveyor, it has to be startup).If not, nothing happened.
-
If the event handler is a
TerminateWindowEvent
:In this case, the TransportWindow will be terminated. That has to be done at the end of the sorting line.
to use this application example you need to login into the GitHub registry. You'll find more information here
-
Open a CLI and switch to the target folder like:
D: cd \temp
-
Install the application example on your local PC
Run the following commands in a CLI
apax create @simatic-ax/ae-sortingline --registry https://npm.pkg.github.com ae-sortingline
cd ae-sortingline
install the dependencies with:
apax install
and open AxCode
axcode .
-
If it is not open, open a terminal in
AX Code
(CTRL+SHIFT+ö
) -
Start a PLCSIM Advanced Instance (IP: Address 192.168.0.1). To change the IP you'll find information here
-
Update your dependencies (optionally)
apax update -a
-
Build and download the program to a PLC
apax dlplc
The project will be compiled and downloaded to the PLCSIM Advanced instance
-
Open the monitoring file mon.mon
-
Go online
-
Watch the values
To change the target IP address, open the apax.yml
and search the entry IP_ADDRESS
, Enter the IP address for your target.
To change the IP address for the debugging, open the file ./vscode/launch.json
and search the entry ip
, Enter the IP address for your device.
Thanks for your interest in contributing. Anybody is free to report bugs, unclear documentation, and other problems regarding this repository in the Issues section or, even better, is free to propose any changes to this repository using pull requests.
This workspace will be checked by the markdownlint-cli (there is also documented ho to install the tool) tool in the CI workflow automatically.
To avoid, that the CI workflow fails because of the markdown linter, you can check all markdown files locally by running the markdownlint with:
markdownlint **/*.md --fix
Please read the Legal information