Beijer ELECTRONICS SER0056 iX Detect USB Stick and SD Card User Guide

Add to My manuals
6 Pages

advertisement

Beijer ELECTRONICS SER0056 iX Detect USB Stick and SD Card User Guide | Manualzz

Quick start guide

iX Detect USB stick and SD card

SER0056 – iX example project

iX Detect USB stick and SD card – iX Developer script module

SER0056_V1.0.0 2021-09

1 Function and area of use

This document shows how to check whether USB or SD media are inserted into the X2 panel.

The time for the cyclic check is adjustable inside the script module.

2 About this document

This quick start document should not be considered as a complete manual. It is an aid to be able to startup a normal application quickly and easily.

Copyright © Beijer Electronics, 2021

This documentation (below referred to as ‘the material’) is the property of Beijer Electronics. The holder or user has a non-exclusive right to use the material. The holder is not allowed to distribute the material to anyone outside his/her organization except in cases where the material is part of a system that is supplied by the holder to his/her customer.

The material may only be used with products or software supplied by Beijer Electronics. Beijer Electronics assumes no responsibility for any defects in the material, or for any consequences that might arise from the use of the material. It is the responsibility of the holder to ensure that any systems, for whatever applications, which is based on or includes the material (whether in its entirety or in parts), meets the expected properties or functional requirements. Beijer Electronics has no obligation to supply the holder with updated versions.

Use the following items in order to obtain a stable application:

In this document we have used following software and hardware

• iX Developer 2.40 SP5 / SP6

• X2 base/pro/marine/control/extreme series

For further information refer to

• iX Developer Reference Manual (MAxx831)

• iX Developer User's Guide (MAxx832)

• Beijer Electronics knowledge database, HelpOnline

This document and other Startup documents can be obtained from our homepage.

Please use the address [email protected]

for feedback about our Startup documents.

2 (6)

iX Detect USB stick and SD card – iX Developer script module

SER0056_V1.0.0 2021-09

3 Table of Contents

1 Function and area of use ......................................................................................... 2

2 About this document .............................................................................................. 2

3 Table of Contents .................................................................................................. 3

4 The iX example project .......................................................................................... 4

The Script Module .......................................................................................... 4

5 Adding the USB SD media Detection ........................................................................... 5

Import the project parts .................................................................................. 5

6 About Beijer Electronics ......................................................................................... 6

Contact us ................................................................................................... 6

3 (6)

iX Detect USB stick and SD card – iX Developer script module

SER0056_V1.0.0 2021-09

4 The iX example project

The cyclic check for USB and SD media is done inside the script module SCM_USB_SD_Check.

The Script Module

{

}

Inside the script module the following Namespace is inserted additionally to enable access to the file system. using System.IO;

Every iX script module brings a “Created” method with it, which is perfect to initialize stuff as it is worked on exactly once at the start of the iX project.

// The method is invoked when the script module object is created. void SCM_USB_SD_Check_Created(System.Object sender, System.EventArgs e)

{ m_Timer= new Timer(); m_Timer.Enabled = true; m_Timer.Interval = 1000; m_Timer.Tick += OnTimerTick;

//ms - adjust time for cyclic check here.

}

// Cycle private void OnTimerTick(System.Object sender, System.EventArgs e) if(Directory.Exists("\\Hard Disk")) else

Globals.Tags.USB_plugged_In.SetTag();

// Check if USB key is connected

// Set tag if connected

// Reset tag if disconnected Globals.Tags.USB_plugged_In.ResetTag(); if(Directory.Exists("\\Storage Card"))

Globals.Tags.SD_plugged_In.SetTag(); else

Globals.Tags.SD_plugged_In.ResetTag(); // Reset tag if disconnected

// Check if USB key is connected

// Set tag if connected

4 (6)

iX Detect USB stick and SD card – iX Developer script module

SER0056_V1.0.0 2021-09

5 Adding the USB SD media Detection

Implementation

1.

Import the script module “SCM_USB_SD_Check” , see example project

(iX_Detect_USB_SD_V1_0_0).

2.

Create the Tags “USB_plugged_in” and “SD_plugged_in” with Datatyp BOOL.

3.

Optionally import Screen1 of the example project

(iX_Detect_USB_SD_V1_0_0).

4.

Adapt the screen to your needs.

5.

Transfer the application.

6.

Run the application.

Import the project parts

Follow the steps to add the enclosed screen and the script module to your iX project:

1.

Unpack the enclosed example ZIP-file to a temporary folder.

2.

Start iX Developer and load your project.

3.

In the Project Explorer, right-click in the lower left corner (1. in the picture)

4.

In the list, select Import... (2. in the picture)

5.

Navigate to the temporary folder, where you unpacked the ZIP-file and select

SCM_USB_SD_Check.neo, click [Open].

6.

Select Screen1.neoxaml, click [Open].

7.

Done!

5 (6)

iX Detect USB stick and SD card – iX Developer script module

SER0056_V1.0.0 2021-09

6 About Beijer Electronics

Beijer Electronics is a multinational, cross-industry innovator that connects people and technologies to optimize processes for business-critical applications. Our offer includes operator communication, automation solutions, digitalization, display solutions and support. As experts in user-friendly software, hardware and services for the Industrial Internet of Things, we empower you to meet your challenges through leading-edge solutions. Beijer Electronics is a Beijer Group company.

Beijer Group has a sale over 1.6 billion SEK in 2019 and is listed on the NASDAQ OMX Nordic

Stockholm Small Cap list under the ticker BELE. www.beijergroup.com

China

Shanghai

Italy

Salsomaggiore

Denmark

Roskilde

Norway

Lier

Taiwan

Taipei City

Turkey

Istanbul

Contact us

Global offices and distributors

France

Champlan

South Korea

Geumcheon-gu

United Kingdom

Nottingham

Germany

Nürtingen

Sweden HQ

Malmö

Usa

Salt Lake City

6 (6)

advertisement

Key Features

  • Checks for USB stick and SD card insertion into X2 panel
  • Adjustable cyclic check time interval
  • Access to file system
  • 'Created' method for initialization
  • 'Cycle' method for ongoing checks
  • Sets tags to indicate USB/SD insertion status

Related manuals

Frequently Answers and Questions

How do I import the script module into my iX project?
Right-click in the Project Explorer, select Import..., navigate to the location of the SCM_USB_SD_Check.neo file, and click Open.
What tags should I create to use with this module?
Create two tags with Datatype BOOL: USB_plugged_In and SD_plugged_In.
Where can I find the example project mentioned in the manual?
The example project (iX_Detect_USB_SD_V1_0_0) is included in the ZIP file that you can download from the 'About this document' section of the manual.