softMC as OPC UA Server

From SoftMC-Wiki
Jump to: navigation, search


To enable softMC OPC UA you need:

  • Install ipk or rpm with OPC UA to your softMC controller, if you do not have the file contact servotronix support
  • Copy OPC_UA.LIB file to your softMC controller , if you do not have the file contact servotronix support
  • Load it from the config.prg, see below
  • Exctute it from autoexec.prg, see below



Print "system is running"

Sys.DoubleFormat = 1
Load opc_ua.lib

end program


Program Continue

dim x as long

Load startprg.prg

while startprg.prg.state <> 10

    sleep 500

end while


Load IND4.prg

StartTask IND4.prg

x =stop_start_server ; restart OPC UA server

End Program


Example for servo drive Temperature and power mesurment


common shared A1_PWRTEMP as long

common shared A1_POWER  as long

common shared A1_Cycle as long

common shared A2_PWRTEMP as long

common shared A2_POWER  as long

common shared A2_Cycle as long



A1_Cycle = 2

A2_Cycle = 4

while 1


 A1_POWER = abs(a1.TFb) * abs(a1.vfb) / 1000


 A2_POWER = a2.TFb * a2.vfb / 1000

 sleep 10

end while

end program