Author Topic: String Variables  (Read 12919 times)

hasslof

  • Newbie
  • Posts: 3
  • Tjena
    • View Profile
    • CP Scanrotor
String Variables
« on: February 25, 2002, 08:33:03 AM »
Is there any way to "increase" the number of avaible string variables (Max 26? A$-Z$)?
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: String Variables
« Reply #1 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.

« Last Edit: December 31, 1969, 04:00:02 PM by -1 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

hasslof

  • Newbie
  • Posts: 3
  • Tjena
    • View Profile
    • CP Scanrotor
Re: String Variables
« Reply #2 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!
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: String Variables
« Reply #3 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.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

hasslof

  • Newbie
  • Posts: 3
  • Tjena
    • View Profile
    • CP Scanrotor
Re: String Variables
« Reply #4 on: February 26, 2002, 05:36:46 AM »
Ok.
Thanks!
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »