Difference between revisions of "softMC as OPC UA Server"

From SoftMC-Wiki
Jump to: navigation, search
(Created page with " <u>CONFIG.PRG</u> program     ..     Print "system is running  -  "     Sys.DoubleFormat = 1     Lo...")
 
Line 1: Line 1:
 +
 +
[[File:OPC 01.jpg|RTENOTITLE]]
 +
 +
&nbsp;
  
 
<u>CONFIG.PRG</u>
 
<u>CONFIG.PRG</u>

Revision as of 13:03, 13 January 2019

RTENOTITLE

 

CONFIG.PRG

program

    ..

    Print "system is running  -  "

    Sys.DoubleFormat = 1

    Load opc_ua.lib

    ..

end program

AUTOEXEC.PRG

Program Continue

dim x as long

Load startprg.prg

while startprg.prg.state <> 10

    sleep 500

end while

..

Load OPC_GL.prg

StartTask OPC_GL.prg

Print "OPC UA Global value ready"

 

x =stop_start_server

End Program

IND4.PRG

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

 

program

A1_Cycle = 2

A2_Cycle = 4

while 1

 A1_PWRTEMP=ec_sdo_read(a1.dadd,0x2044,2)

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

 A2_PWRTEMP=ec_sdo_read(a2.dadd,0x2044,2)

 A2_POWER = a2.TFb * a2.vfb / 1000

 sleep 10

end while

end program