Getting Started and Commonly Used Functions
Important
Before doing any transfer over Ethernet, ensure that the network is considered secure in order to limit the risk of any malicious intrusion.
Some best practices that are encouraged:
Use strong passwords to ensure that network devices (routers/switches/servers) are protected with strong, passwords.
Utilize encryption protocols to encrypt data packets.
Divide the network into separate segments to limit the impact of a security breach.
Configure Access Control Lists on network devices to restrict traffic based on IP addresses/protocols/ports.
Restrict access to your network by only allowing trusted devices based on MAC addresses.
Regularly update firmware and software on the network devices.
If running remote, make sure to connect via VPN to create a secure tunnel for data transmission.
Ensure that all firmware is validated and verified before transfer, ensuring that there is no risk of tampering.
Create and Download Project Using iX Developer
Create a Project in iX Developer
For information on creating a new project in iX Developer, see the iX Developer Reference Manual.
When creating a new project for BoX2 devices, we recommend setting the target to BoX2 base/pro (SC)/extreme (SC) with VNC.
Creating a BoX2 target with VNC allows the user to create graphical screens that can be viewed remotely via VNC. This can is some cases lead to easier configuration and troubleshooting of the device.
Creating a target without VNC means that the possibility to create screens and to access them through VNC is disabled, the hardware and image are identical. A project created without VNC can afterwards be changed to VNC enabled by changing Target Type in “Project - Settings - Display/Target”.
Note
It is possible to switch from a target without VNC to a target with VNC at any time, but not the other way around.
For more information on how to enable VNC in iX Developer, see Remote Access (FTP and VNC) in iX Developer 2.xx, SUEN00314.
Download the iX Developer Project
To download an iX Developer project to a device, you can choose to either export the project to a USB/SD card or to download the project over Ethernet.
Note
Not applicable for BoX2 pro motion.
Export Project to USB or SD Card
Open your project in iX Developer.
Select the Project tab and click Export.
In the pop-up window, find and select the root folder of your USB/SD card, and save the project there by clicking Save.
Note
Make sure Save as type is set to Export to folder.
Eject the USB/SD card.
Connect the USB/SD card to your BoX2 device and boot it.
Wait until you get a blue LED-indication.
The installation is now completed.
Download Over Ethernet
Connect the BoX2 device to the PC via an Ethernet connection.
Open your project in iX Developer.
Select the Project tab and click Download.
The Download Project dialog opens, and all devices connected in the network are listed with information about IP address and device type.
Select your BoX2 device from the list.
Check that the IP address is correct and click Download.
Optional: Click the Include compressed project check box, to compress the project and save it as a ZIP file.
Optional: Click the Password protected check box and enter a password, to protect the ZIP file.
Optional: Click the Copy downloaded project to Memory card check box, to enable SD card backup of project and settings.
The BoX2 device responds to a download request by stopping any current project. The LED will show purple on/off every 0.5 seconds.
Wait until you get a blue LED-indication.
The installation is now completed.
Data Exchange Between Two Controllers
Configure Controllers
Note
In iX Developer, COM port settings can be adjusted on the System ribbon tab.
In iX Developer, do the following:
Click the Tags icon, (1) in the Project Explorer.
Click on the Controllers tab (2).
Note
In this example we will add two controllers and exchange data between them through your BoX2 device.
Click on the Controller... button (3).
Identify your controller and select it in the Select brand and Select protocol lists. Click OK.
Click the Settings... button to configure your controller.
Note
If you are unsure about Settings and Addressing, see our Drivers documentation, accessed by clicking Help in the bottom right corner of the Settings... dialog.
Rename your controller by changing the name in the controllers list.
Click on Add and repeat steps 4 - 6 for your second controller.
Configure Data Exchange
To be able to configure data exchange, at least two controllers must be configured in the project (see how this is done in the previous chapter).
In iX Developer, do the following:
Click on the Tags tab.
Check the Data Exchange checkbox under Columns Visible.
Note
Un-checking the checkbox will not remove your settings, it is just a visibility filter.
Use the default Tag1 or add new ones. Select Data Type and add addresses for your controllers.
Under Data exchange > Direction, click the ... button and select how the data should be exchanged.
In the following screenshot, data exchange is configured to move the data for the selected tag from the device configured under the Demo_Controller_2 to the device configured under Demo_Controller_1.
In this case, it would mean that the value from C1 in Demo_Controller_2 would be copied to D1 in Demo_Controller_1:
Note
The direction setting must be configured separately for each tag.
When the data exchange is configured, click the Download button under the Project tab in the Ribbon at the top of the screen.
Select (1) your BoX2 device as the target and click Download (2).
A green checkmark will illustrate that the project has been downloaded.
Note
Before further configuring data exchange, make sure that communication to all devices works.
This is done by:
Opening the downloaded iX Runtime project on your BoX2 device remotely from your PC.
For information on enabling VNC in iX Developer, see previous section Create a Project in iX Developer and separate document Remote Access (FTP and VNC) in iX Developer 2.xx, SUEN00314.
In the iX Runtime project, check that the tags that are configured to the different controllers receive values as expected.
Enable Diagnostics Page
The diagnostics page shows diagnostic values from the BoX2 device. The diagnostic values include internal temperature, available RAM, used storage, connection and database errors and other system related information. The diagnostic page can be viewed after the project is downloaded to the device.
In iX Developer:
Open Web server configuration from System ribbon tab. Set values needed to access web server and enable web server for the project.
Note
The URL for the diagnostics page should include the assigned port number.
Add system tags, used on the page, manually to the project. If the system tag is missing, ‘-’ will be displayed on the page.
The following system tags are available:
Communication Errors (count)
(SystemTagCommunicationErrorMessage)
Communication Error Message
(SystemTagCommunicationErrorMessage)
Database Error Active
(SystemTagStorageErrorActive)
Database Error Message
(SystemTagStorageErrorMessage)
Database Max Size Exceeded
(SystemTagStorageMaxSizeExceeded)
Current Date and Time
(SystemTagDateTime)
Debug Logging Enabled
(SystemTagDebugLoggingEnabled)
Select Functions - Tags - Add - Add System Tag…. Select and add needed tags in System tags dialog.
Deploy by either upload files via FTP or copy into the ProjectFiles folder. Diagnostics page files are installed with iX Developer installation and reside in iX Developer <version>\Bin\DiagnosticsPage.
Enable FTP server for the project.
On the System ribbon tab (1), within the Servers group, click FTP (2).
In the dialog, check the Enable FTP server checkbox (3).
(Optional) Set a username and password.
Click OK.
Download the project to the BoX2 device through Project - Download.
Connect to the BoX2 device. Use FTP settings specified in the project with the help of any FTP client.
Create a new folder named ‘diagnostics’ in the ‘Website’ folder and copy the diagnostics page files into it.
Use this URL to access the diagnostic page: http://<image_ip_address><:port>diagnostics/index.html to access the page. Use the port defined in the web server configuration. If Forms authentication is enabled for the web server, user is first taken through authentication process. The page is updated asynchronously every 2 seconds with the latest data.
Note
For more information about how to use FTP, see Remote Access (FTP and VNC) in iX Developer 2.xx, SUEN00314.
Create a Project in BCS Tools and Download the PLC Program
Create a Project in BCS Tools
If you are using a CODESYS Runtime in BoX2 pro SC or BoX2 extreme SC, the software BCS Tools is required
BCS Tools can be downloaded from Beijer Electronics SmartStore.
Once you have downloaded and launched BCS Tools, do the following to create your project:
Click File > New project....
Choose Standard Project.
In the BCS Tools Standard Project window, click the Choose the device category: drop-down and select the Edge Controllers group.
Click the Choose the device model: drop-down and select your BoX2 device from the list.
Note
The PLC functionality has support for storing non-volatile variables. Those variables can be stored dynamically in two different modes:
Power-fail mode (Default setting)
If the voltage drops below a hardware given threshold (that is, during a power loss or power dip), the system instantly copies all persistent data defined in the PLC application from RAM into the battery backed SRAM. They are verified and restored when the device is restarted.
Cyclic mode
The PLC is instructed to store all retain and persistent data directly into SRAM synchronously with every PLC cycle. This means all device types can use the whole available memory, which is 128 kB. However, writing to the SRAM might increase the configured PLC cycle depending on the size of used retain and persistent data, because a SRAM is naturally slower than a RAM. This possible increase is dependent of the application and to find out about the possible increase one would need to monitor the configured task(s) of the project. For projects with large amounts of persistent data, cyclic mode is recommended.
These settings must match the settings made in “Retain data options”, see Update the CODESYS Runtime Version Using USB or SD Card or Update the CODESYS Runtime Version Over Ethernet.
Make sure that Create directory for project is checked and click Next.
In the following window, choose the programming language for the POU created by the wizard, and click Finish.
Compile the Project
When the program is ready, a compile is needed to generate the executable code for the BoX2 device.
There are two ways to compile the project, the Generate code function which is an offline compile and the online compile, which is triggered when logging into the device if there is a code change from the last online session.
Compile Offline
Note
When a program change has been made to the project, the project must be compiled.
The offline compile is triggered by using the option Generate code from the Build menu.
The other two options, Clean/Clean all, will remove the generated application binaries and forces BCS Tools to regenerate the application. After a Clean or Clean all, the controller must be stopped to be able to update the application.
Note
A project can still be changed online if the offline compile is being used, if it is only program code changes.
Compile Online
Note
When a program change has been made to the project, the project must be compiled.
This compile is triggered when logging into the CPU if there is uncompiled program code. If there are any compile errors, the login procedure will be interrupted. The compilation must be successful to be able to login to the CPU.
If the compilation is successful, a question of online change will be shown.
Download the PLC Program
There are two ways to transfer the program code to your BoX2 device, the Download and the Online Change function.
The Download function is a mode for downloading new projects and also current projects where the PLC parameters have been changed; hardware configuration, task changes etc.
The Online Change function is a mode for downloading changes while the CPU is in RUN mode. There is no restriction regarding how large the code change can be, as long as the only change is the program code, the online change function is always available.
Download in STOP Mode
To download a new application or an application with hardware changes, task changes etc, the CPU must be in STOP mode.
When logging into the CPU, BCS Tools will prompt that a download needs to be made.
When the Yes button is pressed, the CPU will enter STOP mode and the application is downloaded.
When the download is complete, BCS Tools will enter the online state with the CPU in STOP mode.
To set the CPU into RUN state, press the RUN button in BCS Tools.
Online Change
The online change function is a mode for downloading changes while the CPU is in RUN state. There is no restriction regarding how large the code change can be, if the only change is the program code.
When a change is made in the program code, BCS Tools will prompt with the following message to let the user decide whether to make an online change or a download with the PLC in STOP mode.
When a login attempt is made and the program code differs between BCS Tools and the PLC, online change is available.
When a change in parameters, tasks or other parameter related options are changed, no online change can be performed. BCS Tools will prompt with a message asking if you want to perform a download instead. Click Yes or No. Clicking Details... shows the code generation timestamp of the PC vs the PLC.
Boot Application
The Boot Application is the program code that the CPU will load and execute, after powering on or resetting the system.
When a download is made with the CPU in STOP mode, the downloaded project will be registered as a Boot Application.
An online change updates the Boot Application per default.
Reduce Flash Wear by Storing Data on SD Cards
Beijer Electronics recommend using industrial SD card instead of the built-in flash memory when data logging is performed. The capability to use external SD card for data logging on BoX2 devices was introduced in iX Developer 2.40 SP5. Since extensive writing to the flash memory can cause wear problems and possibly premature failures, the alternative to write to an exchangeable SD card will potentially lengthen the lifetime of the device. An SD card is easy to replace compared to a built-in memory. In addition, the memory size of the SD card is normally much larger than the built-in flash memory.
To set up the SD card database in iX Developer:
Go to Project/Settings. Select Database and select SD Card in the dialog.
Click on the OK Button to confirm the new settings.
When the location of the database is changed from flash to SD card (or vice versa) in an existing application, the database will be automatically copied to the new location once the project is transferred to the device. This will be started immediately after the project transfer has taken place and hence a somewhat slower project start-up time can be noticed.
It is advisable to do a backup of the database in case something happens during the database copy operation.
If during runtime of the device, the SD card is removed and the chosen location for the database is the SD card, the panel will close the application and attempt to reboot until either an SD card is reinserted into the device, or a project is downloaded to the device with the location set to “Hard disk”.
Please note that if any scripting has been done towards the database, then these scripts need to be manually adapted to work with the new location (flash or SD card).
If Audit Trail is enabled for the project and if the database is stored on SD card, the transfer client will not provide the option to keep/remove audit trail in an existing project. It will always keep the audit trail database. If the user wants to clear the audit trail database for the same project, the SD card needs to be inserted into a PC and manually delete the audit trail database file.
It is also recommended to track the flash wear status in your iX Developer project.
The following System Tags can be used for that purpose:
System Tag | Description |
---|---|
Flash Memory Life Time Used | The usage of the device lifetime (in percent). |
Flash Memory EOL Info | Information about the flash memory end of life. The three possible values are:
|
Please see document Best Practice Database on SD card or flash memory for more detailed information.