Internet PLC Forum

General => Technical support => Topic started by: skj1402 on April 24, 2007, 12:29:44 PM

Title: Inserting a variable into NETCMD$ string?
Post by: skj1402 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!
Title: Re:Inserting a variable into NETCMD$ string?
Post by: support 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.
Title: Re:Inserting a variable into NETCMD$ string?
Post by: skj1402 on April 24, 2007, 11:49:04 PM
Thanks for that!  It's so easy when you know how!