Skip to main content

BoX2 base v2, pro (SC), extreme (SC), (pro motion)

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.

VNC_target.png

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”.

Target_settings_VNC.png

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
  1. Open your project in iX Developer.

  2. Select the Project tab and click Export.

    Capture3.png
  3. 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.

    Capture4.PNG
  4. Eject the USB/SD card.

  5. Connect the USB/SD card to your BoX2 device and boot it.

  6. Wait until you get a blue LED-indication.

The installation is now completed.

Download Over Ethernet
  1. Connect the BoX2 device to the PC via an Ethernet connection.

  2. Open your project in iX Developer.

  3. Select the Project tab and click Download.

  4. 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.

  5. Check that the IP address is correct and click Download.

    1. Optional: Click the Include compressed project check box, to compress the project and save it as a ZIP file.

    2. Optional: Click the Password protected check box and enter a password, to protect the ZIP file.

    3. Optional: Click the Copy downloaded project to Memory card check box, to enable SD card backup of project and settings.

  6. The BoX2 device responds to a download request by stopping any current project. The LED will show purple on/off every 0.5 seconds.

  7. 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.

COM_settings_iX.png

In iX Developer, do the following:

config_caption1.png
  1. Click the Tags icon, (1) in the Project Explorer.

  2. Click on the Controllers tab (2).

    Note

    In this example we will add two controllers and exchange data between them through your BoX2 device.

  3. Click on the Controller... button (3).

  4. Identify your controller and select it in the Select brand and Select protocol lists. Click OK.

    config3.PNG
  5. Click the Settings... button to configure your controller.

    config4.PNG

    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.

  6. Rename your controller by changing the name in the controllers list.

  7. 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:

  1. Click on the Tags tab.

  2. Check the Data Exchange checkbox under Columns Visible.

    data_exchange_config1.jpg

    Note

    Un-checking the checkbox will not remove your settings, it is just a visibility filter.

  3. Use the default Tag1 or add new ones. Select Data Type and add addresses for your controllers.

  4. Under Data exchange > Direction, click the ... button and select how the data should be exchanged.

    data_exchange_config2.jpg

    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.

    data_exchange_config3.jpg

    In this case, it would mean that the value from C1 in Demo_Controller_2 would be copied to D1 in Demo_Controller_1:

    data_exchange_config4.jpg

    Note

    The direction setting must be configured separately for each tag.

  5. When the data exchange is configured, click the Download button under the Project tab in the Ribbon at the top of the screen.

    iX_project_download.png
  6. Select (1) your BoX2 device as the target and click Download (2).

    Transfer_Download_BoX2.png

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:

  1. 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.

  2. 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:

  1. 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.

    image260.png
  2. 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)

  3. Select Functions - Tags - Add - Add System Tag…. Select and add needed tags in System tags dialog.

    image376.png
    image377.png
  4. 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.

    path_diagnostic.PNG
    1. Enable FTP server for the project.

      1. On the System ribbon tab (1), within the Servers group, click FTP (2).

        Enable_FTP.png
      2. In the dialog, check the Enable FTP server checkbox (3).

      3. (Optional) Set a username and password.

      4. Click OK.

    2. Download the project to the BoX2 device through Project - Download.

      iX_project_download.png
    3. Connect to the BoX2 device. Use FTP settings specified in the project with the help of any FTP client.

    4. 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:

  1. Click File > New project....

    Capture8.jpg
  2. Choose Standard Project.

    BCS_Tools_Standard_Project.png
  3. In the BCS Tools Standard Project window, click the Choose the device category: drop-down and select the Edge Controllers group.

  4. Click the Choose the device model: drop-down and select your BoX2 device from the list.

    BCS_Tools_New_Project.png

    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.Update the CODESYS Runtime Version Over Ethernet

  5. Make sure that Create directory for project is checked and click Next.

  6. In the following window, choose the programming language for the POU created by the wizard, and click Finish.

    BCS_Tools_Select_language.png

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.

Capture10.jpg

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.

Capture11.jpg

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.

Capture12.jpg

To set the CPU into RUN state, press the RUN button in BCS Tools.

Capture13.jpg
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.

Capture14.jpg

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:

  1. Go to Project/Settings. Select Database and select SD Card in the dialog.

    Reduce_flash_wear.jpg
  2. 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:

  • Normal

  • Warning - Consumed 80% of reserved block

  • Urgent

Please see document Best Practice Database on SD card or flash memory for more detailed information.