API sync to station

Hi!

I try to write a procedure to sync a Rapid proc to station:

Set pro = pros.Item(“PROC1”)
pro.Refresh

An empty path “PROC1” exists.

I get the following message:

“Synchronization of element PROC1 succeeded.”

But in fact it looks like RS syncronizes station to virtual controller instead of the procedure to station. Anyway, I don’t get some robtargets into the “PROC1” path.

Hi

Here is a simple example how to sync a module from VC to RS.
Module name in VC =“myModule”
Procedurename in VC=“Path1”

Sub SyncToStation()
Dim SyncToModule As ABBS4Module

Set SyncToModule = ActiveStation.ActiveMechanism.Controller.Modules(“myModule”)

ActiveStation.Paths.Insert SyncToModule.Procedures(“Path1”)

End Sub

Thank you very much, I will try this.