|
NB Data Log With USB Memory Removal Detection ObjectivesThis article demonstrates detection of USB memory stick removal while logging data with the Data History component in the NB HMI. ![]() IntroductionThe NB HMI provides a powerful tool to log data to a mounted USB memory device. Abrupt or inadvertent removal of a USB memory device is not automatically detected and can be problematic. This article provides a simple solution to detect such a condition. The NB-series HMI can log data read from the connected PLC(s) directly to a .CSV file on a USB stick inserted into the NB. By default, NB system bit LB9154 goes ON a few seconds after a USB stick is inserted, and this bit should be turned OFF (eg. via touch switch) prior to the USB stick being removed. But, if the stick is removed then LB9154 is not automatically switch OFF by the NB. This means that the NB cannot detect if a USB stick is removed inadvertently. However, by using a combination of a Data Transfer and 2 xTimer components, this functionality can be created in the user application. The example provided was created with the following hardware and software.
ContentTo achieve USB memory stick removal detection while logging data with the Data History component, an attached project created for the NB HMI operates as follows.
a. A Data History component to log 14 x REAL values from PLC address W0 – W27 and 2 x INT values from PLC address W28 & W29 to \trend\History Data\History Data.csv on a USB stick inserted into the NB every 5 seconds. These values are changed by the PLC program. In addition (although not necessary), 2 x Event Settings are defined that detect a change in LB9154 to change Event Display scrolling text, and set/reset W201.00 in the PLC (The PLC then uses the state of W201.00 to change output 100.00 to indicate if data-logging is active or not). In this manner, the NB can indicate to the PLC that data-logging is active, or not.
SummaryThe NB data logging function is a convenient method for storing data to an inserted USB stick. Detecting abrupt or inadvertent removal of the USB stick is important for the correct operation of this function. This article provides a simple solution with attached project example files.
Additional information can be found in the NB-Designer Operation Manual (Cat. No. V106).
The details and references for this article were made at the time of NB-Designer Version 1.45. Newer versions may operate and function differently. Contact your local Omron representative for more information.
Link: |
| Comments | ||
|
||
