String into a Var

BTCAD

Active Member
Is it possible to set astring value into a var?
 
 
We can do : set var1 urom1 
 
so can we do something like : set var1 str1 ?
 
 
Or can we use string table as a usable value table?
 
 
I.E :
 
tsteq var9 str1
callsub loop1
 
String is a multi bytes storage, VAR or RAM are fixed storage value, they could not be compared.
Maybe you could tell us what you want to do, so that we can help you to find solution. If a new feature is needed and feasible, we could consider adding it to the firmware.
 
Perhaps a test string table, installed at the beginning of a program and then a variable could index into it.
 
    TTAB "zero","one","two","three","four","five"  <----set text table to the six element table. Use this before Text Table usage
 
    TINDX 4   XXXX  <---- access the fifth element of text table and substitute for character string and put it in XXXX?
      results in "four"
 
But where would you use this?  (only one telephone in the world is not useful)
I can only think about WEBSET that could  send a string of characters and do not see any other place on WC8 that could handle the text table function result.
 
    WEBSET 1 TINDX 3  <-----use WEBSET 1 and send text "three" instead of a numeric value
 
To meet customer request, We need to remove the PLC acces from the webserver. And only let them access to urom to set their own value.
 
For exemple urom 1 to urom 4 are used to set maximum and minimum temperature threshold. urom5 to urom8 are to set other threshold.
 
 
It will be fine if we could get more urom space. For exemple 16. I know you are limited with memory but it could be nice if it can be implement.
 
 
 
Bitwise?
 
Such as 2 values in the same urom?   2500 and 2200 == urom1 25002200     
 
For WC32, you can build you own GUI to remove the PLC page, in that way, customer will not be able to make any change to it.
Bitwise can be looked like 8 F,  oxFFFFFFFF. If possible, leave out the first digit like 0x0FFFFFFF, since RAM and VAR could be signed 32 bit value, each F can be value from 0 to 15. In calculator (handhold or computer based), if you go to programmer mode, it will allow convert those into decimal value.  That a lot of bits can be used.
 
Back
Top