Saving permanent variables with MpRecipeCsv - FB says CommandBusy but never goes to CommandDone

Hi all,

I’m trying to use MpRecipeCsv to save permanent variables into a csv-file on a USB (FAT32), plugged in to the first USB port of the PLC. The issue is when I do Save=TRUE through the watch, the function block sets CommandBusy to TRUE but never goes to CommandDone = TRUE. It doesn’t give any information in the logger, it just goes on until I set everything to FALSE, and no CSV file is created.

I’m using PLC X20EM0611 and AS6.1.1.14.

This is the code, based on the Help B&R Online Help :

PROGRAM _INIT
mpRecipeCSV.MpLink := ADR(gRecipeCsv); 
mpRecipeCSV.Enable := TRUE; 
mpRecipeCSV.DeviceName := ADR('HD'); 
mpRecipeCSV.FileName := ADR('MyFile'); 

mpRecipeRegPar.MpLink := ADR(gRecipeCsv); 
mpRecipeRegPar.Enable := TRUE; 
mpRecipeRegPar.PVName := ADR('TestPermanent'); 

mpRecipeCSV(); 
mpRecipeRegPar();

TestPermanent.Test := TRUE;
END_PROGRAM
PROGRAM_CYCLIC
mpRecipeCSV(); 
mpRecipeRegPar();
END_PROGRAM

And this is the device configuration (which worked with the USB and MpBackupCore):

PV is declared here:

Mapp configuration:

What am I missing here for it to actually create a file on the USB?

THANKS!

The FileDevice could be problematic.

It is more save to use the AsUSB library to detect and find the usb-stick and resulting path, which can be different depending on the type of the USB-stick.

See earlier post: Log File in a USB Drive - Ask Questions - B&R Community

I would double check the system logbook as there might be an error if it’s trying to create the \bd0 file device at boot if nothings connected. I also highly encourage the usage of AsUSb for usb stick MSD usage.

Another possible cause could be that MpRecipeRegParSync is used instead of MpRecipeRegPar.
In this case, the input ConfirmSave must be set, as soon as the output SaveNotification is pending.

I am using the MpRecipeRegPar and not MpRecipeRegParSync. Do you recommend using sync instead?

I’ll try it out with the AsUsb as well.

I always recommend using the MpRecipeCsv.Active output as a conditional on the MpRecipeRegPar.Enable to make sure that the mpRecipeRegPar block doesn’t have any issue registering the parameters. Do you have any error numbers on the outputs or any messages in the logbook (mapp or Services logbook)?

No, unless the sync functionality is required.