Hi Community,
I am having some trouble with the Keep PV option in program download working with my MpRecipeCsv command.
If I don’t select it and let the PLC run through the Exit and Init routine after download, everything works fine (I do need to disable MpRecipeReg and MpRecipeCsv in Exit and re-enable them to avoid other trouble).
If I select Keep PV, no matter if I let the PLC execute the Exit and Init routine or not, the MpRecipeCsv command will give an error 32772: INVALID_FILE_NAME if I trigger a recipe load or save.
I want to highlight that I created constants to give device name and file names to MpRecipeCsv. For example:
VAR CONSTANT
fileName : STRING[20] := ‘Recipe’;
deviceName : STRING[20] := ‘F:/recipefiles’
END_VAR
MpRecipeCsv.DeviceName := ADR(deviceName);
MpRecipeCsv.FileName := ADR(fileName);
I suspect the issue is by keeping PV, somehow the pointer to the strings is affected. Though I have tried to run the ADR() command in cyclic and assumed it will update the pointer, it didn’t help.
I believe there are some awesome engineers who can guide me through this.
Thanks👍