Managing System of WCs

Efried

Active Member
Being in a position, where the main controller will be upgraded from WC8 to WC32 I'm experiencing lack of roll out support again. In the best case a drag and drop solution should allow to transfer code from one WC to another while keeping the references to the measuring points.
example:
Using T1 directly will be replaced by a WEBSET of WC1 from T1 to VAR1 at WC2, while the programm on WC2 will then use VAR1 instead of T1...
The good point is while altering, I might update firmware finally...
 
 
Lars has an utility that can copy configuration from one board to another.  PLC code probably needs to be copied separately, because if PLC code is protected, it is not visible anyway.
 
Best bet is to ask Lars if his utility can work for you transfer from one board to another,
 
CAI_Support said:
Lars has an utility that can copy configuration from one board to another.  PLC code probably needs to be copied separately, because if PLC code is protected, it is not visible anyway.
 
Best bet is to ask Lars if his utility can work for you transfer from one board to another,
 
 
thanks, its not only transfer - since the main logic transits from one to another WC - the measuring points have to be translated. I'm really curious if you see a standard system architecture for networked WCs. Will a WC32 play the main controller, or as proposed, could the main control task roam?
This topic is hot introducing resilient home automation.
 
unfortunately I came accross a Russian board in the price range below the WC8, but offering JSON. This will allow a new system architecture using a raspberry pi as master controller. May be CAI has missed the need for networked controllers. In practice my four WC boards pose a challenge in keeping the overview of the distributed logic and induce blocking risks if one communication stack for webset is full. I hope not, because people were helpful here, but progress into the wc32 conflicts with the ability scaling cheaply, having passive controllers for 25 USD, and a master controller for not much more. May be a cheap but more capable WC BRE version could step in, controlled by a WC 32. Hope the lacklustering sales activities don't constitute the first step into obsolescence.
 
Using WC8 to WEBSET to WC32 should never be blocked, since WC32 has much more RAM and in current feature set, it still has almost 1/2 RAM free. HTTP and EMAIL should never be blocked.
 
CAI_Support said:
Using WC8 to WEBSET to WC32 should never be blocked, since WC32 has much more RAM and in current feature set, it still has almost 1/2 RAM free. HTTP and EMAIL should never be blocked.
 
The blocking occurs at the WC8. Because there is so much RAM free I was bullying for a better users interface- the first step could be variable names
 
DEFINE VAR1 T_ROOM
 
the we could use
 
TSTGT T_ROOM 200
 
This would tender the chose much more readable.
 
other ideas?
 
Efried said:
the first step could be variable names
DEFINE VAR1 T_ROOM
other ideas?
 
Create your source files with a standard editor. Eg, vi.
Fully and comprehensively annotate and comment them so you can understand them later.
USE VARIABLE NAMES AS YOU INDICATE.
Use sed or awk, a VERY simple program (likely no more than a few lines) would parse your "raw, master source" file and create a test version to paste into the WC
 
rossw said:
Use sed or awk, a VERY simple program (likely no more than a few lines) would parse your "raw, master source" file and create a test version to paste into the WC
 
Here's something I just hacked together to prove the point:
 
Sample source code, "webcontrol-elfried"

# Code sample for webcontrol

#define T_ROOM var1
#define T_OUTSIDE var2
#define sensor1 T1
#define cooler OP1

START
   set T_ROOM sensor1           # initialise room temperature
   tstgt T_ROOM T_OUTSIDE       # is temperature more than outside?
   set cooler 1                 # set output high
END
 
 
Simple awk script:

#! /bin/sh

# Parse specified raw webcontrol file
awk '/^#define/ {mneumonic[$2]=$3}
        {for(n in mneumonic) gsub(n,mneumonic[n],$0)
         sub("#.*","",$0); print }
        ' $1
 
What happens when you run it:

Code:
# ./awk-elfried webcontrol-elfried



START
   set var1 T1  
   tstgt var1 var2
   set OP1 1
END
 
rossw said:
Here's something I just hacked together to prove the point:
 
Sample source code, "webcontrol-elfried"
 

# Code sample for webcontrol

#define T_ROOM var1
#define T_OUTSIDE var2
#define sensor1 T1
#define cooler OP1

START
   set T_ROOM sensor1           # initialise room temperature
   tstgt T_ROOM T_OUTSIDE       # is temperature more than outside?
   set cooler 1                 # set output high
END
 
 
Simple awk script:
 

#! /bin/sh

# Parse specified raw webcontrol file
awk '/^#define/ {mneumonic[$2]=$3}
        {for(n in mneumonic) gsub(n,mneumonic[n],$0)
         sub("#.*","",$0); print }
        ' $1
 
What happens when you run it:
 

# ./awk-elfried webcontrol-elfried



START
   set var1 T1  
   tstgt var1 var2
   set OP1 1
END
 
ross you are great, hope CAI will implement this script on the board itself.
 
You have to understand that there is no BASH on the WC firmware, just not enough space for that. 
We know our board limitations are, so we use the CPU and storage on board most effective on what it supposed to do.
Sorry that we can not do everything you want, but we do what we can the best.
 
Efried said:
ross you are great, hope CAI will implement this script on the board itself.
 
Thank you... but implementing this on the WC board was never my intention, nor can I imagine it being practical.
I, as I expect most others, like to keep my "master code" on a computer, along with my flowcharts, construction and assembly notes etc.
The "pre-parsing" of my fully-commented code (and now with readable symbol names!) is a really simple process that just spits out text I can cut and paste straight into the WC "PLC PROGRAM" window and submit. I certainly don't WANT my fully commented source in random boxes out there, even if they DID have the memory and other resources to store it.
 
I agree with rossw this is not something that should be built into the WC but a standalone utility.


Not being a UNIX user it would be nice to have an off the shelf Windows utility to expand macros and delete
comments so the result can be pasted directly into the WC. Since it is not an assembler the same utility should
be applicable to both WC8 and WC32.

/tom
 
Tom look at Notepad++ for Windows. It's a free powerful text editor and can strip out comments among other things.

Terry
 
roussell said:
 It's a free powerful text editor and can strip out comments among other things.
 
Recent versions of the Webcontrol firmware already strip out comments.
My post was specifically in relation to using "symbols" or "more descriptive titles" for variables, inputs and outputs.
I'm not aware of any editors that can read a list of global substitutions from a file, then use that same list to change all subsequent references throughout the same file.
 
My 3 line awk script (could easily be reduced to a single line) does exactly that - reading "#define" lines and substituting all subsequent references.
I'm sure unixtools or something similar is available for windows - but as I don't (and won't) run doze, I don't really know.
 
Everyone probably has different preferences and ways to do things. My (above) offering was more a "proof of concept" to provide a highly portable, very flexible "extension" to the way we program and interact with the webcontrol programs.
 
rossw said:
Thank you... but implementing this on the WC board was never my intention, nor can I imagine it being practical.
I, as I expect most others, like to keep my "master code" on a computer, along with my flowcharts, construction and assembly notes etc.
The "pre-parsing" of my fully-commented code (and now with readable symbol names!) is a really simple process that just spits out text I can cut and paste straight into the WC "PLC PROGRAM" window and submit. I certainly don't WANT my fully commented source in random boxes out there, even if they DID have the memory and other resources to store it.
 
Why would that not be practical? I would love also seeing the variables with their real name on the status page, this would male debugging much easier. So the variable name definition could greatly benefit us all.
 
Back
Top