Internet PLC Forum

General => Technical support => Topic started by: hasslof on February 25, 2002, 08:33:03 AM

Title: String Variables
Post by: hasslof on February 25, 2002, 08:33:03 AM
Is there any way to "increase" the number of avaible string variables (Max 26? A$-Z$)?
Title: Re: String Variables
Post by: support on February 25, 2002, 09:12:19 AM
No, the number of string variables are fixed. There may be creative way of getting around this restrictions: ?You can create strings out of dynamic data using the STR$(n), HEX$(n), INPUT$(n) , "+" operator etc to reduce the number of string variable required to store static string constants. You could also use an IF THEN ELSE structure to assign different string constansts to a string variable:

e.g. IF ?X = 1
 ? ? ? ? ? ?A$ = "This is Line 1 with X = "+STR$(X)
 ? ? ? ELSE
             IF X = 2
 ? ? ? ? ? ?     A$ = "This is 2nd Line with 2X = "+STR$(X*2)
 ? ? ?       ENDIF
       ENDIF

Hope this will help.

Title: Re: String Variables
Post by: hasslof on February 25, 2002, 10:22:15 AM
I will give it a try. By the way, thanks for the help regarding the com-port (ascii-string) problem I had. But I had to use pin 2,3,5,7 & 8 to get it to work. Don?t ask me why. Anyway, It works perfect now. Thanks!
Title: Re: String Variables
Post by: support on February 25, 2002, 11:16:34 AM
I think I know why 7 and 8 is needed. Your equipment needs RTS and CTS handshake. In our PLC, pin 7 and 8 are shorted together, so when you connect pin 7 and 8 to our PLC the RTS and CTS signals are looped back.
Title: Re: String Variables
Post by: hasslof on February 26, 2002, 05:36:46 AM
Ok.
Thanks!