Jeppe Clausen
Jeppe Clausen

Reputation: 304

B&R Automation Studio transfer post event

Is there any way to execute a post project transfer event when transferring a project to a PLC?

I want to automatically change the value of a variable using fx the PVI interface every time I do a transfer.

Upvotes: 2

Views: 1049

Answers (1)

kirni
kirni

Reputation: 146

I am not entirely sure what the usecase is for this. However the easiest way for some kind of post transfer script would be to utilize the Runtime Utility Center (RUC).

In the RUC, you can define instruction lists for a B&R PLC with an online connection. This includes instructions for transferring projects and setting values of process variables (PVs).

For transferring the project with RUC, you need to create a RUC package. This can be done under Settings/Export to Runtime Utility Center. You could also do this from the command line. More details in the help under Project management/Project installation/ Performing project installation/Export RUC Guid: cfe34190-f436-4c14-b06d-3a4ca39be7e7

This will create a zip, which you can then use in your RUC. For transfer command there is a wizard which activates when you double click on the command Transfer to target under Project installation The result is a line in the instruction list, which might look like this:

Transfer "C:\path\to\your\zip\project.zip", "InstallMode=Consistent InstallRestriction=AllowUpdatesWithoutDataLoss KeepPVValues=1 ExecuteInitExit=1"

After transferring you can write your PV. Under Process variable functions in the RUC you can find the command Write process variable. Also here there is a wizard and the result looks like this:

WriteVariable "taskname\VariableName", "USINT", "2"

I am using AS 4.4.6. There might be slight differences when using a other version.

Upvotes: 2

Related Questions