Jump to content

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


Recommended Posts

Posted

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. 

Posted

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")

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...