Home AMX User Forum NetLinx Studio

Touchpanel executes commands out of order

Okay so I have the following three commands in a button_event, firing one after the other.
SEND_COMMAND BUTTON.INPUT.DEVICE, '@PPX'; // line A.  Clears any popups that might be around from other stuff
SEND_COMMAND BUTTON.INPUT.DEVICE, 'PPON-VIDEO_BG'; // line B.  Shows the background for video
SEND_COMMAND BUTTON.INPUT.DEVICE, "'PPON-VIDEO_SRC_',cSomeStackVariable"; // line C.  Shows whatever specific device page
99.9% of the time this code acts as expected. But there have been 2 reported cases, 1 of which was confirmed by me, that sometimes the button pops up the device popup without the video_bg popup. It looks ugly.

I can think of two possible scenarios:
1) the touchpanel, a modero 8400 in both cases, failed to execute line B due to an ICSP packet drop. So the video_bg popup was never popped up.
2) the touchpanel got packets A, B, and C, but executed them out of order. It popped up the video_bg, then cleared all popups, then popped up the source popup. Both the commands getting swapped are very short. Maybe ICSP has timestamps on the packets that are only accurate to a 10th of a second, and when it gets packets that are sent within the same 10th of a second, it just guesses.

Scenario 2 seems more plausible to me (despite Occam's Razor) so I plan to add a meaningless command ('WAKE') in between lines A and B. (I would just use waits but that gets complicated due to the stack variable) That way adjacent commands switching is no longer a concern.

Also, everything in this post is a guess, I don't have any inside knowledge of how ICSP works. Does anyone here have experience with commands to TPs being switched? If so, what did you do?

Comments

  • I'd love to see the theories on this too. I've got wired 17" panels where this happens a lot. Pop-ups don't pop up where there supposed to, but it's inconsistent.

    --John
  • a_riot42a_riot42 Posts: 1,624
    I'd love to see the theories on this too. I've got wired 17" panels where this happens a lot. Pop-ups don't pop up where there supposed to, but it's inconsistent.

    --John

    I've never seen this. I have sometimes thought I did, but it was always traced back to something. I use the @PPN command rather than PPON, but I am not sure that would make any difference. You could try it. You can also turn on page tracking and capture what the panel is doing and see if it is executing the commands in the correct order. Another thing you could do is combine the two popups into one and just call it.
    Paul
  • DHawthorneDHawthorne Posts: 4,584
    I've noticed a considerable delay in rendering pages that have a lot of graphics, and that the page itself doesn't show until all its components are in video memory. There is some caching, so subsequent displays go faster until enough other stuff has happened to push it out of the cache.

    I think that is what you are seeing. The commands are executing in order, but the rendering of the pop up is delayed when it has to load its images into the cache ... just enough for it display after the one that was called before. That would also explain the inconsistencies .. the state of the cached images.
  • ericmedleyericmedley Posts: 4,177
    DHawthorne wrote: »
    I've noticed a considerable delay in rendering pages that have a lot of graphics, and that the page itself doesn't show until all its components are in video memory. There is some caching, so subsequent displays go faster until enough other stuff has happened to push it out of the cache.

    I think that is what you are seeing. The commands are executing in order, but the rendering of the pop up is delayed when it has to load its images into the cache ... just enough for it display after the one that was called before. That would also explain the inconsistencies .. the state of the cached images.

    This is indeed the case. I don't use pages myself and have found that the popups will appear in inverse proportion to their graphic complexity. All of my popus use some kind of show and hide animation. You can see anomalies(sp?) when the delay time of that animation is high.
  • That explanation makes sense. In my case the panels and pages where that is happening have not just graphics, but streaming video loading. Also, there are occasions where you can see the pop up for a moment, then it disappears which is probably happening when the streaming video pop up renders even though the streaming video pop up was called first.

    Is your case graphic intensive Matt? I wonder if a short wait between your SEND_COMMANDS would work.

    I'll try that too and then write a function to queue the pop up commands to the panel if it works.

    --John
  • mpullinmpullin Posts: 949
    That explanation makes sense. In my case the panels and pages where that is happening have not just graphics, but streaming video loading. Also, there are occasions where you can see the pop up for a moment, then it disappears which is probably happening when the streaming video pop up renders even though the streaming video pop up was called first.

    Is your case graphic intensive Matt? I wonder if a short wait between your SEND_COMMANDS would work.

    The second popup is more graphically intensive than the first. Basically the first popup has some bitmaps, and volume controls on the side. The second popup is source control for whatever source the room is on. The problem is not that the two popups come up out of order, it's that I think the PPX command is being executed after the first popup comes up. The two popups are not in the same group, so if they both were issued they would both appear.

    I stuck a WAKE command after the PPX command just to buy a teeny bit of time. If that doesn't work I will need to build a queue like you did. (again, can't just use a wait because I need to use a stack variable in the 3rd command)
Sign In or Register to comment.