¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io
Date

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 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.


Re: A wireless router for every rack...?

Jason Dravet
 

--- On Wed, 1/21/09, uscurtin <jcurtin@...> wrote:
The setup:
So my boss has recently decided that a wireless router
should be put
in place into every rack we install from now on (or build,
if multiple
racks exist in a single build) so that a tech can hook up
to the rack
wirelessly whenever they need to service the rack. This
mandate
extends for all racks, regardless of whether or not
wireless products
exist in the build (since the router is primarily for
service).

I have more than several reservations against this notion,
but rather
than share them immediately, I was wondering what the rest
of you
thought of this concept. I'm interested in all sides
of the argument,
so please post whatever thoughts you have on this idea.

-Justin
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
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:

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:

agreed...in my non-Crestron circle of travels in the past, I have
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.....

having pointers in SIMPL+ would benefit, for example, those tasks
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

-----Original Message-----
From: fooguy89 <fooguy89@>
Sent: Jan 23, 2009 10:53 AM
To: Crestron@...
Subject: [Crestron] Re: Question on finding the number of defined
array elements.

I'm pretty sure the reason Crestron doesn't do Pointers is because
of
support. They tend to perform a lot of support that doesn't seem
to
be "their problem" - issues that are clearly programming mistakes,
but
they do try to help resolve them (I know people knock TB for a lot,
but I mean they do try to be helpful if you get the right folks).

Can you just imagine the chaos of newbies trying to use pointers,
overwriting memory, blah blah blah, and Crestron trying to suck it
up
and fix it/teach them?

As a professional programmer, sure, it would be great to have, but
I
can definitely see why many things are limited.

Sometimes I don't understand the need to try to fix and assist with
blatant programming problems (If you were to call microsoft and
whine
about how your system crashed because you did a NULL pointer
access or
overwrite the bounds of your array, they'd probably just be like
"Uh....GO FIND AND FIX IT YOURSELF!!")


--- In Crestron@..., Joseph K. Vossen <jkv@> wrote:

the semi-colon after the if() is a valid statement from the
parser's
point of view; it just doesn't do what you want/expect

here is a simple example of how that is useful; the following 'C'
code copies a NULL-terminated string, where 'p' points to the
destination and
'q' points to the source:. The while() terminates when the NULL
terminating
byte is hit.

while (*p++ = *q++)
; // <- note
lone semi-colon

ya' just gotta love pointers...sure wish SIMPL+ had 'em.......

On Friday 23 January 2009 12:33 am, you wrote:
I would have expected to see a compiler error on the fatal ;
at the
end of an IF statement.

True, but I always put them in so that if I do add another
line I
don't mess up the execution order/nesting. (Didn't see
the ; -
fatal, but a trace should have shown 10 outputs rather than
just 1.)

Lindsay


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:

The result of mid() seems to get stored in a temporary variable even
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:

This is actually something I was wondering about when I made the XM
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:

This is where foo pipes up to say that Crestron's implementation of
ByRef does actually make a copy the data 8)

------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in
the Database area.
Yahoo!
Groups Links





--
Jeremy Weatherford


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:

What would you do with pointers that you can't do with array indexes?
Function arguments are already passed by reference, so what's this
"copying data around all over"?

It's easy to bounds-check array indexes to keep a program from doing
bad things when it screws up. It's hard to check pointer arithmetic.
It's also hard to get dynamic memory allocation right. I think
Crestron has struck a good balance with SIMPL+'s features, power, and
robustness.

Jeremy


On Fri, Jan 23, 2009 at 10:12 AM, Chris Erskine <chris@...> wrote:
I agree that not only would your code be more compact but more
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,
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?

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:&#92;Retrievals&#92;pac21.spz"

Error Generated:
Command Line 1[FAILURE, 2 minutes 40 seconds]: ProgramRetrieve
"C:&#92;Retrievals&#92;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 [>].




------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links



--
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
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:

This is actually something I was wondering about when I made the XM
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:

This is where foo pipes up to say that Crestron's implementation of
ByRef does actually make a copy the data 8)

------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in the Database area.
Yahoo! Groups Links



--
Jeremy Weatherford


Re: vtpro-e hang time

Nightcountry
 

--- In Crestron@..., Chris Erskine <chris@...> wrote:

How much memory is in your PC and what is the usage of the memory
when you are compiling? Does it exceed the physical memory so that it
starts swapping?

Hey Chris
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.....

Chris


-----Original Message-----
From: Crestron@... [mailto:Crestron@...] On
Behalf Of Nightcountry
Sent: Friday, January 23, 2009 9:49 AM
To: Crestron@...
Subject: [Crestron] Re: vtpro-e hang time

--- In Crestron@..., "scates98" <ccates98@> wrote:

I experience this problems on some panels as well but I just have to
wait a minute or two and it always finishes. I've found that I really
have to be careful not to use too many fonts in my projects as it
causes the compile time to slow down as wall as keeps the file size
too large for some panels. My recommendation to you is to eliminate
any unnecessary fonts and give it another go.

- Ccates
Thanks - the file size I am using with the tps6l is around 10 meg
however the panels capacity is 28 - when you say eliminate unnecessary
fonts do you mean the number of font styles or just text information?
Cheers



--- In Crestron@..., "Nightcountry" <patrickbedford@>
wrote:

Hi is anyone else having a problem when compiling a vtpro program -
pc hangs at 50 percent when loading fonts and sometimes freezes
completely - another installer I know is having the same issues
.....
the program is taking 300,000 kb in memory - have an I-7 processor
with 6 gigs of ram
and am still having problems - with vt 3.8 and now with vt 3.9
thanks


------------------------------------



Check out the Files area for useful modules, documents, and drivers.

A contact list of Crestron dealers and programmers can be found in
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:&#92;Retrievals&#92;pac21.spz"

Error Generated:
Command Line 1[FAILURE, 2 minutes 40 seconds]: ProgramRetrieve
"C:&#92;Retrievals&#92;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:


I'm certainly not going to steer you away from diving into S+, but
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:

Hi all,

Sorry for the long post, but I like to give a lot of details to help
people understand what I'm trying to do. I'm an experienced SIMPL
Windows programmer but SIMPL+ is still pretty new to me. I'm trying
to find a way to program a custom menu subsystem for my client and was
hoping someone could help me in building this in SIMPL+.

The client will be using an ML-600 and he's only going to be using
some basic inputs like: dirpad up/down/left/right/enter and page
up/down on the remote to navigate an on-screen display generated by a
TPS-GA-TPI. He wants to have the ability to control any zone in the
house. So I've created a GUI so he can select room control, source
control, lighting control, climate control, shade control and security
control.

In SIMPL Windows I am using a series of buffers and interlocks to
control when the dirpad up/down/left...etc. signals are in use for a
particular menu. I am also using a series of Ring Counter with Seed
symbols to allow him to navigate the on-screen menu using only the
dirpad on the ML-600. Example: the user selects "Choose Room" from
the primary menu, then uses the ring counter to scroll through the
floors, another ring counter controls the scrolling through rooms for
the selected floor.

As I'm building this project, I am noticing that my menu system, built
in SIMPL Windows, is creating a lot of signals and I'm concerned with
how well it will function after I've duplicated it for all zones which
require it (at least 16 zones). I know that if I were to build this
in SIMPL+ it would be much more efficient and easier to copy, but I am
confused on how I could write it as I'm not experienced in SIMPL+. I
thought of using an array to create a table where the first row would
contain values for the primary menu (rooms, sources, lights, etc.).
Then each column would contain values for each of the primary menu
items (ex: 1=first floor, 2=main floor, 3=upper floor, etc.). However
I do not understand how to buffer the dirpad up/down commands to
control the scrolling through the list. I keep thinking about using
an IF statement but then I'm writing a large amount of nested IF
statements to control when the up/down command is enabled for a
specific menu. Perhaps using a long SWITCH/CASE statement would
work?

Any help you can provide would be greatly appreciated as I know I need
to get my head into SIMPL+ programming to become a better programmer.
Please try not to get too technical with your replies as I'm still
new to programming this way and can get lost quickly.

Thanks In Advance For All Your Help,

- Scates

P.S. I've read the SIMPL+ programming help PDF and it's helped me to
get this far. I really need to take some sort of programming class to
better learn this.


Re: Question on finding the number of defined array elements.

Matt
 

Touche


Why?

You're just saying if some condition is true, then do nothing. Not
exactly something I'd typically see someone programming, but it *IS*
perfectly valid.


--- In Crestron@..., "Matt" <mjrtoo@> wrote:

I would have expected to see a compiler error on the fatal ; at
the
end of an IF statement.



True, but I always put them in so that if I do add another line
I
don't mess up the execution order/nesting. (Didn't see the ; -
fatal,
but a trace should have shown 10 outputs rather than just 1.)

Lindsay

--- In Crestron@..., "Matt" <mjrtoo@> wrote:

Thanks Lindsay and Chip, it's always puntuation isn't it. If
I
were
to remove the trace statement, could you use no brackets? If
the
brackets are required, I guess there's another error in the
help
file.



Hi Matt,

You need to put the statements after the IF in {}.

Lindsay

--- In Crestron@..., "Matt" <mjrtoo@> wrote:

I'm messing around with an upcoming project, and am
looking
to
determine the number of elements a string array has been
assigned
in
Simpl. Looking at S+ I see the directive isSignalDefined
().
I
have
the following code (not complete).

STRING_INPUT in$[10][25];

Function Main()
{
FOR(i = 10 to 1 Step -1)
{
IF(IsSignalDefined(in$[i]));
TRACE("i = %d", i);
BREAK;
}
}

Within Simpl, I have only two strings expanded on the
symbol,
but
NumSources always = 10, I was expecting to see 1.

Is this the correct approach and/or any advice on what's
incorrect?


Denon DCM-390 Module

kyle805
 

Does anyone out there have a module built for the Denon DCM-390 CD
changer?


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:

[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.

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:


This is actually something I was wondering about when I made the
XM
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:

This is where foo pipes up to say that Crestron's implementation
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
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:

This is where foo pipes up to say that Crestron's implementation of
ByRef does actually make a copy the data 8)


Re: Question on finding the number of defined array elements.

Joseph K. Vossen
 

[snip]

Now... if they'd just implement multiple-inheritance in S+ (*JOKING!*)
don't even go there :))


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. :)

- Chip

--- In Crestron@..., "Oliver Hall" <oliver.hall@...> wrote:

Now... if they'd just implement multiple-inheritance in S+ (*JOKING!*)

Ol


Re: Newbie Simpl+ Question

Chip Moody
 

I'm certainly not going to steer you away from diving into S+, but
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:

Hi all,

Sorry for the long post, but I like to give a lot of details to help
people understand what I'm trying to do. I'm an experienced SIMPL
Windows programmer but SIMPL+ is still pretty new to me. I'm trying
to find a way to program a custom menu subsystem for my client and was
hoping someone could help me in building this in SIMPL+.

The client will be using an ML-600 and he's only going to be using
some basic inputs like: dirpad up/down/left/right/enter and page
up/down on the remote to navigate an on-screen display generated by a
TPS-GA-TPI. He wants to have the ability to control any zone in the
house. So I've created a GUI so he can select room control, source
control, lighting control, climate control, shade control and security
control.

In SIMPL Windows I am using a series of buffers and interlocks to
control when the dirpad up/down/left...etc. signals are in use for a
particular menu. I am also using a series of Ring Counter with Seed
symbols to allow him to navigate the on-screen menu using only the
dirpad on the ML-600. Example: the user selects "Choose Room" from
the primary menu, then uses the ring counter to scroll through the
floors, another ring counter controls the scrolling through rooms for
the selected floor.

As I'm building this project, I am noticing that my menu system, built
in SIMPL Windows, is creating a lot of signals and I'm concerned with
how well it will function after I've duplicated it for all zones which
require it (at least 16 zones). I know that if I were to build this
in SIMPL+ it would be much more efficient and easier to copy, but I am
confused on how I could write it as I'm not experienced in SIMPL+. I
thought of using an array to create a table where the first row would
contain values for the primary menu (rooms, sources, lights, etc.).
Then each column would contain values for each of the primary menu
items (ex: 1=first floor, 2=main floor, 3=upper floor, etc.). However
I do not understand how to buffer the dirpad up/down commands to
control the scrolling through the list. I keep thinking about using
an IF statement but then I'm writing a large amount of nested IF
statements to control when the up/down command is enabled for a
specific menu. Perhaps using a long SWITCH/CASE statement would work?

Any help you can provide would be greatly appreciated as I know I need
to get my head into SIMPL+ programming to become a better programmer.
Please try not to get too technical with your replies as I'm still
new to programming this way and can get lost quickly.

Thanks In Advance For All Your Help,

- Scates

P.S. I've read the SIMPL+ programming help PDF and it's helped me to
get this far. I really need to take some sort of programming class to
better learn this.


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:

agreed...in my non-Crestron circle of travels in the past, I have
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.....

having pointers in SIMPL+ would benefit, for example, those tasks
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

-----Original Message-----
From: fooguy89 <fooguy89@...>
Sent: Jan 23, 2009 10:53 AM
To: Crestron@...
Subject: [Crestron] Re: Question on finding the number of defined
array elements.

I'm pretty sure the reason Crestron doesn't do Pointers is because
of
support. They tend to perform a lot of support that doesn't seem
to
be "their problem" - issues that are clearly programming mistakes,
but
they do try to help resolve them (I know people knock TB for a lot,
but I mean they do try to be helpful if you get the right folks).

Can you just imagine the chaos of newbies trying to use pointers,
overwriting memory, blah blah blah, and Crestron trying to suck it
up
and fix it/teach them?

As a professional programmer, sure, it would be great to have, but
I
can definitely see why many things are limited.

Sometimes I don't understand the need to try to fix and assist with
blatant programming problems (If you were to call microsoft and
whine
about how your system crashed because you did a NULL pointer
access or
overwrite the bounds of your array, they'd probably just be like
"Uh....GO FIND AND FIX IT YOURSELF!!")


--- In Crestron@..., Joseph K. Vossen <jkv@> wrote:

the semi-colon after the if() is a valid statement from the
parser's
point of view; it just doesn't do what you want/expect

here is a simple example of how that is useful; the following 'C'
code copies a NULL-terminated string, where 'p' points to the
destination and
'q' points to the source:. The while() terminates when the NULL
terminating
byte is hit.

while (*p++ = *q++)
; // <- note
lone semi-colon

ya' just gotta love pointers...sure wish SIMPL+ had 'em.......

On Friday 23 January 2009 12:33 am, you wrote:
I would have expected to see a compiler error on the fatal ;
at the
end of an IF statement.

True, but I always put them in so that if I do add another
line I
don't mess up the execution order/nesting. (Didn't see
the ; -
fatal, but a trace should have shown 10 outputs rather than
just 1.)

Lindsay