Friday, March 16, 2007

Buffer Hell

So you'd think you would see the signal coming out of this symbol going high when the buffer is enabled, 100% of the time, right?



Guess what? Not so much! Let's digress for a second before we show you what condition just might make "target_signal" never even hiccup in this program.

Look at this symbol:


If you haven't tried this in a 2-series processor, you might not realize that when "button_press" goes high, "target_signal" never does. Here's why - when the 2-series logic processor sees "button_press" go high, it evaluates all the logic immediately connected to it and doesn't return the results until after it is done. (Many will recognize this concept as a "logic wave")

In the process of evaluating this lone buffer symbol, the logic processor sees two results for "target_signal" - the first one where it comes out high from the 1 on input 1 - and the second, where it becomes low from the 0 on input 2. Since the logic processor doesn't return any results until after all the evaluations are done, we (and any other symbols that may have "target_signal" as an input) only ever see "target_signal" as being low.

But I started out saying that you can have a buffer with a single 1-enabled input not propogate a high signal on the enable line to the output, right? How's that happen? Well, what I forgot to tell you is that there's another symbol in this program:



This doesn't look all that different from the previous example, and even though our activitiy is split between two different symbols, the results are the same.

Remember what we said about the logic processor - it evaluates any/every symbol initially triggered by "button_press" going high, and doesn't return the result until it's done. In this case, the single "evaluation event" covers both buffer symbols, and the final evaluation of the state of "target_signal" - in this case the low level derived from the 0 input on the second symbol in the program - is not passed back until the entire evaluation is complete. You could put as many similarly configured buffers you want (or a single buffer symbol with multiple inputs like the first example) and arrange the high and low level input values however you want - the end result is that the last evaluation, based on the order of signals/symbols in the program, is the result returned by the logic processor and passed on to the next logic or device symbol.

At this point some of you are probably saying "Well, duh, that makes sense" or "yeah, I knew that", but this is really for the rest - the ones that someday might stare at a 1-enabled buffer in SIMPL Windows and can't figure for their lives why the output isn't going high when they trigger the enable while watching for the results in Test Manager/SIMPL Debugger. If/when that day comes, remember to F2 that signal and look to see if it happens to be coming from a buffer further down in the program tree from the one you're currently looking at. You'll probably find that buffer is keeping that signal level low.

One last note - this little tidbit applies to 2-series processors only. If you happen to come across this while working with an X-series or earlier processor, you have a different problem. The logic processor in pre-2-series controllers will actually propogate the signal value to other symbols each/any time it changes while being processed.

10 Comments:

Anonymous Anonymous said...

Hi Chip,
I'm a beginner in Crestron programming and i do have a few questions about it.
Really appreciate if you can tell me how to get in touch with you so ask you about some of the issues I'm currently facing.

Thanks.

Regards,
C.K

3:17 AM  
Anonymous Anonymous said...

Any digitally jammed signal has what you would call Transition Gate style behavior. Whatever the last transition on that signal is, is what will take effect. So if you have a button-presser and a stepper (both legal to jam) tied together, you'll potentially see something like this if one tries to drive a signal low while the other currently has that same signal high. The compiler does warn about a lot of jammed signals, but there are many that are legal to jam - such as 2 buffers. It's a convenience to jam that's for sure, but it's something you *still* have to be careful of - lest you start seeing the problems described in the above blog entry.
-FooGuy89

1:47 PM  
Blogger Unknown said...

hello,

i cant find anything for starters here.............
can you please help me to do control the extron mps112 switcher by using mp2 processor?
kindly looking forward your reply

8:13 AM  
Anonymous Anonymous said...

hello... hapi blogging... have a nice day! just visiting here....

6:30 PM  
Anonymous driving school worcester said...

As all of us know, driving while talking on the phone can be dangerous. Texting while driving is extremely dangerous, and now against the law in many states, the same fundamentals apply while we taxi on the airport surface.

11:24 AM  
Blogger wahyud said...

thanks for interesting post... i really enjoy to visit this site :)
agen ace maxs jakarta

9:12 PM  
Anonymous Anonymous said...

I've just tested this on an MC3 (3-series) and am seeing the same behavior.

HTH

1:07 PM  
Anonymous obat pelangsing alami said...

hi,, i like to visit this site,, have a nice day :)

2:46 AM  
Anonymous Anonymous said...

And this is why I don't jam digital signals.... ever

7:16 AM  
Blogger Jr. Williams said...

Pedalboard setup for guitar?
pedal switcher

5:59 AM  

Post a Comment

<< Home