Set Pickmaster variable from PC SDK application

We are using Pickmaster for our pick and place operation. The pattern selection needs to be done fron a PC application developed using PC SDK. I am trying to write to the variables of Pickmaster for performing the pattern selection but the controller gives exception.
code snippet:

Dim sig As IOSystemDomain.Signal = robctrl.IOSystem.GetSignal(“pmOutfeeder1_giProdSel”)
Dim gSig As IOSystemDomain.GroupSignal = DirectCast(sig, IOSystemDomain.GroupSignal)
gSig.WriteGroupValue(1)

Error: “Write of unblocked in-signal not allowed.”

please let me know how to do this.