Author Topic: Inserting a variable into NETCMD$ string?  (Read 11891 times)

skj1402

  • Newbie
  • Posts: 28
  • The Innovator!
    • View Profile
Inserting a variable into NETCMD$ string?
« on: April 24, 2007, 12:29:44 PM »
I need to write a 'Write Counter Set Value" command to my T100 slave unit, the format as you know being:
NETCMD$ 3,"@02Wu01****",  where **** is the new counter's SV.
Can you please tell me how I can insert a variable into this string so that the contents of the variable inserts the new SV into the position of ****?

Thanks!

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Inserting a variable into NETCMD$ string?
« Reply #1 on: April 24, 2007, 04:02:08 PM »
Assuming variable A contains the variable value:

NETCMD$ 3,"@02Wu01"+STR$(A,4)

will convert the value of A into 4 digit string and appended to the back of the first string.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

skj1402

  • Newbie
  • Posts: 28
  • The Innovator!
    • View Profile
Re:Inserting a variable into NETCMD$ string?
« Reply #2 on: April 24, 2007, 11:49:04 PM »
Thanks for that!  It's so easy when you know how!