Anvesh

How to do a printing application through VB script in TIA portal

2 posts in this topic

I want to do a printing application from TP1200 comfort panel HMI. For online printing of data, many suggested to go for VB script. I dont know scripting. Can anyone help me in this regard. 

Share this post


Link to post
Share on other sites

Hi...

Please find the example VBS for the printing application in Siemens CE terminals for reference...

Dim f
Dim path
Dim mode
mode=8
Dim life
life=0
Dim hr,hrm
Dim min,minm
Dim sec,secm
hr=Hex(SmartTags("Act_Hour"))
min= Hex(SmartTags("Act_Minute"))
sec= Hex(SmartTags("Act_Sec"))
If hr<10 Then
    hrm=0&hr
Else
    hrm=hr
End If

If min<10 Then
    minm=0&min
Else
    minm=min
End If

If sec<10 Then
    secm=0&sec
Else
    secm=sec
End If

path="\Flash\print.csv"
Set f=CreateObject("FileCtl.file")
f.Open path,mode
f.LinePrint("                                                             " & "EZAMPLE")
f.LinePrint("                                                        " & "COMPANY")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now