Kkula
Hi Guys,
I'm doing a string concatenation from two tags into a text. Now how can i make this text into a string tag? (Text variable 8-bit)
If it's possible in VB Script, please provide an example too. It'll be more helpful.
Thanks in Advance
You can convert concatenated text into a string tag (Text variable 8-bit) using VBScript within your Siemens PLC program (e.g., in a Function Block or Function). Here's how:
Dim strTag1, strTag2, strConcatenated, strResultTag
strTag1 = "Hello"
strTag2 = "World"
strConcatenated = strTag1 & " " & strTag2 'Concatenate strings
strResultTag = "YourStringTag" 'Name of your string tag
'Assuming "YourStringTag" is a global text tag defined in your PLC
'Assign the concatenated string to the string tag.
PLC_Tag(strResultTag) = strConcatenated
Explanation:
Important: Make sure the `strResultTag` variable name matches exactly the name of your pre-defined text tag in the PLC's tag table. Also, ensure the string tag is large enough to accommodate the concatenated string.
For more details on VBScript in Siemens PLCs, refer to the SiePortal documentation: Siemens VBScript Examples.
Our flexible community website is a platform that allows users to connect, share information, and collaborate on various topics of interest. The website offers a range of features such as discussion forums, messaging, user profiles, event calendars, and more. Users can customize their experience by creating and joining different groups or communities based on their interests or location. The website is designed to be user-friendly and adaptable to the needs and preferences of our diverse user base. Whether you are looking to network professionally, share hobbies and interests, or simply connect with like-minded individuals, our flexible community website has something for everyone. Join us today and become a part of our thriving online community!
India
Copyright ©2026
Share this page with your family and friends.