Use VBS programming to calculate PLC variable values ​​every minute - Database & Sql Blog Articles

Programmable Package SG-8018CA(SG7050C) 0.67M~170M
SMD aluminum electrolytic capacitor
Supply 1206 blue light 1206 blue LED quality assurance original authentic large number

I want to try VBS programming in WINCC6.2 and calculate the real-time bad rate of production equipment. I have two plc variables: a1 (unsigned32int), a2 (unsigned16int), and WINCC6.2 script variable a3 (scripttagfloat32). I want to calculate once every minute: a3=a2/a1*100. How can VBS be programmed to achieve this function?
A: First create the variables tag1, tag2, tag3 in a1, a2, a3.vbs:
Dimmytag, mytag1, mytag2
Mytag=hmiruntime.tags("tag1").read
Mytag1=hmiruntime.tags("tag2").read
Mytag2=mytag1/mytag*100
Hmiruntime.tags("tag3").writemytag2


The above script is placed in wincc's global vbs script, setting the trigger period to 1 minute.

Kenwood portable radio

Kenwood Portable Radio,Kenwood Vhf Handheld Radio,Kenwood Dual Band Portable Radio,Kenwood Vhf Portable Radio

Guangzhou Etmy Technology Co., Ltd. , https://www.digitaltalkie.com