Recording data to USB memory stick (with MpDataRecorder for dummies :D)

Hello everyone!

We have been caught in a predicament for some time. A quite simple task, yet no direct answer so far (from our experience). We are using X20 CP0484 and several I/O modules primarily as a data acquisition system with only a few (control) outputs. Thus, the data recording might be crucial in our use case. We used configured MpDataRecorder function blocks and a directory on the user partition (F:) with the FTP server enabled in the CPU config for this task. This works fine, however, after a few days / weeks of operation, there is no more space for new data. So we decided to switch to a memory stick (serves as backup storage for data as well).

The simple answer is:

  • go to the CPU configuration - File devices (ADR for gDataRecorder)
  • change the path from “F:\" to “/bd0”
  • that is all :smiley:

… to break it down a little:

  • we used a part of the AsUSB library read sample (Sample for all AsUSB-Library-Functions) in order to identify addresses of USB ports (this is the critical part we struggled most as we did not find this anywhere in the documentation)
  • then we switched into Watch, opened the variable and found the correct string for the address

Edited overview (credits: B&R Academy):

It is not IF5 / IF4, it is not /bd0a … it is /bd0 (we have also tried to add and connect a second memory stick and it appeared with address /bd16).

We are aware that existing workarounds, more sophisticated approaches, or conceptual changes to send data elsewhere can be implemented . Nevertheless, this is how we needed to use it, and we finally made it :smiley:

We hope this will help.

Have a good one!

6 Likes

thanks for sharing @jan_leffler :flexed_biceps:

1 Like

hi @jan_leffler,

In addition to your post, I would like to draw your attention to a few points :

  • The transfer rate of USB (to save a new file, we must first finish the previous one)
  • The number of write operations (too many writing operation, the USB is dead)
  • The number of files (the CPU spent time to list the files, so the other asynchronous task will not work properly)

I have a client (X20CP1384 - AS V4.7) who generates so many production data files that his USB drive is out of service after a year and a half and his VC4 visualization is blocked.

Best regards

1 Like

thanks a lot for sharing! these are issues we are not yet familiar with… I will bear these points in mind!

out of curiosity - what is approximately “too many” data files writing operations that the USB drive is dead in less than 18 months?

Hi @jan_leffler

For Usb memory, this is feedback from our customer.

I will share my experience and I hope it will be useful to you.

At the end of the production run, the machine created 1 file (230kB). On average, we had 1 files every 1 minutes. The customer used our machine several weeks minimal 8 hours per days : at least 480 files per day.

All the files were saved in the same directory. The PLC is not designed to handle files like PC. The managing files are placed in the non-cyclic operations (e.g. visualisation, communication, etc.) It spent some much time to scan files that the VC4 freezed and the ANSL connexion was lost. In the worst case, the PLC switched in SERVICE MODE. To reduce the number of files, the B&R engineer advised us to write to one directory and when the number of files exceeded 200, we changed the saving directory.
For example, you start to save in the directory “DATA0000”. When the number of files in this directory exceeded 200, the new directory will be “DATA0001”. And, so on. With this tips, we can create 10,000 directories of 200 files for a total of 2E+06 files.

When recording production datas, I don’t think saving to a USB drive is the best solution. The system generates a considerable amount of datas and the customer must have direct access to the machine to upload and delete the files on the USB (consider the cybersecurity aspects). The alternative may be a PC with an OpcUA client (or the edge solution of B&R) and the PLC as server.

Best regards,

2 Likes

Hello @Jean_Philippe_Daniel

Thank you for such a detailed reply! We will definitely come back to it at some point. Now, our solution is acceptable for our use case and potential customer, however, the concept will probably be reworked in the future.

Take care.

Just same case, i have AS6.3 and there it seems to have /bd0a before in AS4xxx /bd0— work

it there conformation what is correct

2 Likes

@Kari_Kivisto I am still with AS4.12 :smiley: … I have checked the 4.12 Help and found this (screenshot below), which corresponds to my findings. Unfortunately, I couldn’t find it earlier without the right keywords :smiley: I would still be lost without the recent Expert Update organized in B&R Academy (Brno, CZ).

image

So apparently, /bd0a etc is not incorrect - good to know! Thanks for the information (we will start new projects in AS6 soon).

1 Like