English (United States)
Call us! 512-349-0334 or (877) INDUSOFT

InduSoft Web Studio Forums

Find additional forum posts in in the Forum Archives. For assistance view the Forum Frequently Asked Questions.

Programatically identify tags in vbScript
Last Post 11 Jul 2019 03:27 PM by Norman E. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
OmniconUser is Offline
New Member
New Member
Posts:1


--
11 Jul 2019 02:37 PM
    Hi all, So I am trying to come up with a method of programmatically based on a user inputted string. I have been implementing a remote interface into the the HMI layer through the use of the TXRX drivers and vbscripts. So far this is all working and I am able to remotely read and write to hard-coded plc tags. The problem is there are a lot of tags (100+) that I will need to control and would rather not have to make some sort of giant lookup table.

    I looked into using the "Execute" command for the vbscripts and it looks like it doesn't work for the tags themselves. I can do something like:


    baseString = $PLC.H_RemoteCtrl.RecievedString
    tempString = "MsgBox("&" baseString " & ")"
    Execute tempString


    which will take the contents of the PLC tag and print it in a message box but I wanted to use the tag reference its self for the execute so something like this:
    baseString = "$PLC.H_RemoteCtrl.RecievedString"
    tempString = "MsgBox("&" baseString " & ")"
    Execute tempString

    but that just ends up printing the name of the plc tag in the message box. I want to see the contents. The idea behind this is for the user to be able to directly indicate the tag they want to write/read.

    Unfortunately, due to IT security constraints, I am limited to connecting to the target device only over serial. (Anything with Ethernet or network in it is a dirty word).

    Any help would be greatly appreciated, thanks!
    Norman EUser is Offline
    Basic Member
    Basic Member
    Posts:19


    --
    11 Jul 2019 03:27 PM
    baseString = $GetTagValue("PLC.H_RemoteCtrl.RecievedString")
    You are not authorized to post a reply.