Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- Crestron
- Messages
Search
Re: A wireless router for every rack...?
Is that really true - if you have a legal signoff they can still hold
you responsible? Then what's the point of a signoff, in general? (Note that I think having a WAP installed by default is a bad idea as much as the rest of the people here.) --- In Crestron@..., Jason Dravet <jason.dravet@...> wrote: Even if in the equipment specs you say you are installing a AP andthe customer signs off you might be responsible as the customer really doesn't know what he is signing for and the AP has no legitimate function. |
Re: A wireless router for every rack...?
Jason Dravet
--- On Wed, 1/21/09, uscurtin <jcurtin@...> wrote:
The setup:Personally I don't like wireless. Most are not secure (and I am not just talking about WEP/WPA. A friend just purchased a Wireless AP and installed it. The router was a NetGear wpn842 I think. It worked great after I installed it. When I install equipment I always check for updated firmware. It is a good thing to as router would lose its settings after a power failure without this update. Two weeks later his house lost power and all of the settings were erased. That router was returned and another purchased from a different vendor. But this illustrates APs have to be maintained whereas popular belief is set it up and forgot about it. For installs I do for business I usually spec Cisco as people know Cisco. But having extra functions just because is not a good thing. Even if the AP is strictly for Crestron and not connected to the home or internet it is a way in. If someone were to hack into the network via a AP that the customer didn't spec or know about who knows what trouble the hacker could get into. You might be responsible for any damage that occurred. Say the hacker figures out how to open and close the curtains. Depending on the motor he could overheat it (open/close repeatedly, or figure out how to jam up the motor) and cause a fire. Even if in the equipment specs you say you are installing a AP and the customer signs off you might be responsible as the customer really doesn't know what he is signing for and the AP has no legitimate function. Of course always check with a lawyer. Jason |
Re: Question on finding the number of defined array elements.
Well, even if you pass your array ByRef, *every* time you access an
toggle quoted message
Show quoted text
array element, bounds checking is done. I think that speed hit, whatever it amounts to being in their implementation, outweighs finding an array overrun. As all of us who have programmed in C know, just because you overrun the array "now" doesn't mean you find the error now. You could run into the after effect minutes, days, or years from the time it happened! --- In Crestron@..., "Oliver Hall" <oliver.hall@...> wrote:
|
Re: Question on finding the number of defined array elements.
Chip Moody
That seems pretty legit - thanks Jeremy.
Of course, now I just feel guilty that I'm wasting an extra 1k of volatile memory in my module... :) - Chip --- In Crestron@..., Jeremy Weatherford <xidus.net@...> wrote: on this.
the Database area. Yahoo! Groups Links
|
Re: Question on finding the number of defined array elements.
Well, in the case of something like C, bad pointer arithmetic and bad
indices of arrays are just as bad. At least with SIMPL+ arrays, sure you should check your indices to make sure that you're doing the right thing, but if you over/underrun, at least you don't write into other application memory, it issues an error and you can later try to track it down. --- In Crestron@..., Jeremy Weatherford <xidus.net@...> wrote: efficient since you would not have to be copying data around all over. On the other hand, pointers would cause so much more problems in the code that systems would be crashing all over. Crestron would require better TB personnel and better tools since you would need a debugger that would let you step through the S+ code when it was running. |
Re: Scripting Issues
Jeremy Weatherford
Never tried it. Does the same script work for program uploads? IE,
toggle quoted message
Show quoted text
is the connect statement and everything else functional? On Fri, Jan 23, 2009 at 1:18 PM, Daniel <joyousdan@...> wrote:
Anyone successfuly used ProgramRetrieve in their scripts? --
Jeremy Weatherford |
Re: Question on finding the number of defined array elements.
Jeremy Weatherford
The result of mid() seems to get stored in a temporary variable even
toggle quoted message
Show quoted text
if you just assign it to a local variable. Here's an example from Crestron's BKParser.usp, line 245: Temp1$ = Mid(Temp$[4], 2, (Temp[4] -2)); //Get Name string And here's what it compiles to: UpdateSourceCodeLine( INSTANCE_PTR( S2_BKParser ), 245 ); FormatString ( INSTANCE_PTR( S2_BKParser ) , LOCAL_STRING_STRUCT( __FN_DST_STR__1 ) ,2 , "%s" , Mid ( LOCAL_STRING_STRUCT( __FN_DST_STR__ ) , GetStringArrayElement ( INSTANCE_PTR( S2_BKParser ), LOCAL_STRING_ARRAY( __TEMP$ ) , 4 ) , 2, (GET_LOCAL_INTARRAY_VALUE( S2_BKParser, __TEMP, 0, 4 ) - 2)) ) ; FormatString ( INSTANCE_PTR( S2_BKParser ) , LOCAL_STRING_STRUCT( __TEMP1$ ) ,2 , "%s" , __FN_DST_STR__1 ) ; In this case, there's a temporary variable named __FN_DST_STR__1 used for the result of Mid(). I seem to remember seeing string overflow error messages for variables with names like that. I'm guessing they're generated for any kind of string expression, although it seems odd to use it for a simple assignment. Generated code is never the paragon of efficiency, though... Jeremy On Fri, Jan 23, 2009 at 11:53 AM, Chip Moody <cfm@...> wrote:
--
Jeremy Weatherford |
Re: vtpro-e hang time
Nightcountry
--- In Crestron@..., Chris Erskine <chris@...> wrote:
when you are compiling? Does it exceed the physical memory so that it starts swapping? I have 6 gig of ddr3 memory but because I am using xp, the os only sees 3.24 gig - vt uses 300,000 kb in memory usage when I working on the program - am using the new I-7 intel processing ship as well - the memory usage is so massive that I suspect it is the culprit but my old pc using a P3 processor would use only 70-80000 kb of memory when using vt..... Behalf Of Nightcountry Sent: Friday, January 23, 2009 9:49 AM..... the program is taking 300,000 kb in memory - have an I-7 processor the Database area. Yahoo! Groups Links |
Scripting Issues
Anyone successfuly used ProgramRetrieve in their scripts?
Mine gives me error codes and I can't get the file. Connection is through Internet at a static IP. My Code: LogFile=|MyLogFile| Connect=|pac21connect| ProgramRetrieve "C:\Retrievals\pac21.spz" Error Generated: Command Line 1[FAILURE, 2 minutes 40 seconds]: ProgramRetrieve "C:\Retrievals\pac21.spz" Error for Line 1: ComChannel.cpp(198) : Timeout waiting for the device to respond to the command resumeprogram<LF>. Waiting for one of the following tokens [>]. |
Re: Newbie Simpl+ Question
scates98
Hey Chip,
Thanks for your reply! I spent about a day or two trying to figure out how I could program this in SIMPL+ and eventually gave up because I couldn't figure out how to do it. I went back to SIMPL Windows and continued writing the module. When I look at the code I've written in SIMPL Windows it just looks like a lot of code and when I see my code go that way I start thinking I've made things too complicated. My paranoia starts going because I think signals won't be resolved in logic waves and then things won't work exactly as they should. I've done all I can to keep the code down to it's minimum so things will work efficiently. Since the menu is going to be generated by a TPS-GA-TPI (touchpanel interface for standard display devices) there will be no touch input to navigate the menu. The only device to interface with the menu being displayed will be an ML-600 remote. When the user presses Menu on the ML-600, I want the Menu to toggle on/off. They will then have to use the direction pad to navigate the on-screen menu. I've broken this down into two components, Menu Selection and Menu Control which is selected by the left/right dirpad buttons. When in Menu Selection mode the user is choosing from the list of rooms, sources, lights, shades, etc. when the user is in Menu Control mode the user is selecting options from the current Menu Selection. Example, when the user selected rooms from the Menu Selection they immediately switch to Menu Control mode and start choosing a floor followed by a room. The inputs are fairly simple dirpad signals and such to control navigation. Output signals are to switch between pages and subpages for menu navigation. Example: pressing the Enter button on the dirpad when selecting Rooms from the Menu Selection list will switch the TPS-GA-TPI to display the room selection page and force the Floor Selection subpage high. After using the up/down dirpad buttons the user will select a floor and press the dirpad enter button again to choose a floor which will display the room list for that floor. This is why I was thinking of using an array. In SIMPL Windows I control this using a Ring Counter with Seed so I can send an analog value to the Ring counter to turn all outputs off or force one on. This in conjunction with interlocks help to enable the correct buffer for navigational control. If I knew how to create a buffer in SIMPL+ I might have enough to make the module work. However, I keep thinking I'm reinventing the wheel if all I'm doing is making the same signals in SIMPL+ that I've already written in SIMPL Windows. I hope this answers your question. I appreciate your input and perhaps you're right. Maybe I should keep this in SIMPL Windows. At least I'll know how to troubleshoot it! lol Thanks, - Chris --- In Crestron@..., "Chip Moody" <cfm@...> wrote: work?
|
Re: Question on finding the number of defined array elements.
Matt
Touche
the Iend of an IF statement. Idon't mess up the execution order/nesting. (Didn't see the ; -fatal,but a trace should have shown 10 outputs rather than just 1.) thewereto remove the trace statement, could you use no brackets? If helpbrackets are required, I guess there's another error in the lookingfile. ().toassigneddetermine the number of elements a string array has beeninSimpl. Looking at S+ I see the directive isSignalDefined symbol,Ihavethe following code (not complete). butincorrect?NumSources always = 10, I was expecting to see 1. |
Re: Question on finding the number of defined array elements.
Chip Moody
That was a potential guess for me, but I didn't know if it was one
of those "iffy" situations in the S+ compiler that might bite me in the ass down the road, y'know? Maybe I'll get off my butt and see what happens if I change it over the weekend... - Chip P.S. Oliver - thanks for your answer too, and enjoy the beer!! --- In Crestron@..., "Joseph K. Vossen" <jkv@...> wrote: compiler, but all of the compilers I have worked on will generate a "temporary" whose type/size is "local" to the block and is used to hold the value for cases like this. The temporary is generated on the stack so it will "disappear" when you go out of scope. You can't reference it directly (by name) since it is typically generated above/below (depends on how the stack frame is maintained) the variables that the programmer declared for that block.
|
Re: Question on finding the number of defined array elements.
Joseph K. Vossen
[snip]
My mindset was that the result of MID doesn't exist as a variable,well, actually it does. I can't say for certain with the SIMPL+ compiler, but all of the compilers I have worked on will generate a "temporary" whose type/size is "local" to the block and is used to hold the value for cases like this. The temporary is generated on the stack so it will "disappear" when you go out of scope. You can't reference it directly (by name) since it is typically generated above/below (depends on how the stack frame is maintained) the variables that the programmer declared for that block. [more snip] |
Re: Question on finding the number of defined array elements.
Disclaimer: TOTAL GUESS!
I'd say that in the case of a function that *returns* a value, that value must be created on the stack. So your MID is creating a new string. That "new" string is then either assigned to a string variable or returned to the calling function. So: you're not passing ByRef in this case, but essentially "returning ByVal". Meaning, you don't need to use temp$. The MID(SomeExisting...) is creating a new string, passing it ByRef to Fudge, which then modifies that *new* string (by the REMOVE()). I think... I'll have to test that theory - but not now... it's Beer O'Clock! Enjoy your weekends everyone! Ol --- In Crestron@..., "Chip Moody" <cfm@...> wrote: XM Now Playing module, and just couldn't bring myself to write TBTS onthis. to one of my own functions that in turn manipulates the results of thethis: I show in that snippet up there. So in the ACTUAL module, one of thefunction for that matter) exist in some malleable state that I can operateon? of ByRef does actually make a copy the data 8) |
Re: Question on finding the number of defined array elements.
Chip Moody
This is actually something I was wondering about when I made the XM
toggle quoted message
Show quoted text
Now Playing module, and just couldn't bring myself to write TBTS on this. In the XM module, I take the result of a MID function and pass it to one of my own functions that in turn manipulates the results of the MID and returns the result of THAT manipulation. If I could abbreviate/abstract it, it might look something like this: STRING_FUNCTION Fudge (STRING src$) { // Among other things, do something along these lines: Garbage$ = REMOVE(";",src$); // Blah blah, more code here... RETURN (MyProcessedString$); } PUSH Go { tx$ = Fudge (MID(SomeExistingStringVar$,3,6)); } My mindset was that the result of MID doesn't exist as a variable, so I can't really mess around with the contents of that result like I show in that snippet up there. So in the ACTUAL module, one of the first things that happens inside Fudge is I copy "src$" into local variable "temp$", then work on temp$ exclusively: STRING_FUNCTION Fudge (STRING src$) { temp$ = src$; // Among other things, do something along these lines: Garbage$ = REMOVE(";",temp$); // Blah blah, more code here... RETURN (MyProcessedString$); } Does that make sense? Does anyone know for certain if what I did was required, or does the result of MID (or any other string function for that matter) exist in some malleable state that I can operate on? Thanks, - Chip --- In Crestron@..., "Oliver Hall" <oliver.hall@...> wrote:
|
Re: Question on finding the number of defined array elements.
Chip Moody
Part of me wants to ROTFL over that, but no - that's just not funny. :)
toggle quoted message
Show quoted text
- Chip --- In Crestron@..., "Oliver Hall" <oliver.hall@...> wrote:
|
Re: Newbie Simpl+ Question
Chip Moody
I'm certainly not going to steer you away from diving into S+, but
toggle quoted message
Show quoted text
I'm going to question whether what you're trying to accomplish in this case is better off left in SIMPL. Based on what you've described, it doesn't sound like you're going to be pushing the limits on the processor by any means - even if you had 16 instances of the "block" of code AND had 16 people pounding buttons in each zone at the same time. (16 instances of a block of code with a zillion signals where only one instance is going to be used by the client at any one time is pretty much a non-issue) If you want to neaten things up a bit, get the block to a point where you think it's got all the goezintas and goezouttas you need, and turn it into a SIMPL module. Then you can just drop 16 instances of the completed module into your program. No, it doesn't make any difference on processing - it'll just make your main program's code easier to read through and maintain. If you're still interested in making an S+ version for self-educational purposes at the very least, could you describe the signals going in/out a bit more? I wasn't able to get a clear enough picture to advise/suggest S+ approaches. - Chip --- In Crestron@..., "scates98" <ccates98@...> wrote:
|
Re: Question on finding the number of defined array elements.
I agree, that in the right hands, pointers are extremely powerful,
but I feel Crestron have chosen wisely here. As foo's already said, the potential for misuse of pointers would open us up to a world of pain. I'm not knocking anyone here; we all have to start somewhere, but there do appear to be a lot of guys programming systems with some pretty shaky foundations in procedural languages, and even simple syntactic issues (like the root of this thread) could wreak havoc scrambling your processor's brains. So I suppose you could argue "Pointers don't kill processors, programmers do" ;-) Anyway - anyone who's had to debug bad pointer arithmetic knows what a time-consuming process it can be, and that's on your own code - it's 100x harder when it's someone else's. The efficiency argument can be mitigated too - you can always use ByRef in your function declarations (in fact, you can't avoid it with STRING). I've written an XML parser that doesn't move the XML document at all (though it does mean creating a lot of markers... which I guess are just my version of (safe?) pointers). This is where foo pipes up to say that Crestron's implementation of ByRef does actually make a copy the data 8) Now... if they'd just implement multiple-inheritance in S+ (*JOKING!*) Ol --- In Crestron@..., "Joseph K. Vossen" <jkv@...> wrote: found that a *good* understanding of pointers separates the good programmers from the great ones. And then when you jump into function pointers, that opens up a whole new world of fun..... that perform a *lot* of parsing, such as busting up XML pages. Sure one can do it now with what is available, I just think the code would be a bit more compact, IMHO array elements. of tosupport. They tend to perform a lot of support that doesn't seem butbe "their problem" - issues that are clearly programming mistakes, upthey do try to help resolve them (I know people knock TB for a lot, Iand fix it/teach them? whinecan definitely see why many things are limited. access orabout how your system crashed because you did a NULL pointer parser'soverwrite the bounds of your array, they'd probably just be like destination andpoint of view; it just doesn't do what you want/expect terminating'q' points to the source:. The while() terminates when the NULL lone semi-colonbyte is hit. at the line Iend of an IF statement.True, but I always put them in so that if I do add another the ; -don't mess up the execution order/nesting. (Didn't see just 1.)fatal, but a trace should have shown 10 outputs rather than
|
to navigate to use esc to dismiss