Home AMX User Forum AMX General Discussion
Options

^RAF command - loading images?

Has anyone used the ^RAF command?

I need to display images loaded on the Netlinx master to the touchpanel.
I know I can do this if I add a Dynamic Images URL in the touchpanel, but I need to have changing image names.

Here's what was in Software History:
Example:
SEND_COMMAND Panel,"'^RAF-New Image,%P0%HAMX.COM%ALab/Test_file%Ftest.jpg'"
Adds a new resource.
The resource name is 'New Image',
%P (protocol) is an HTTP,
%H (host name) is AMX.COM,
%A (file path) is Lab/Test file,
%F (file name) is test.jpg.


I've tried all combinations with no luck!
Thanks
«1

Comments

  • Options
    Joe HebertJoe Hebert Posts: 2,159
    Do you need to create a new Dynamic Image resource or do you just need to change the image of an existing Dynamic Image? If the latter, try the ^RMF command. I haven't come across the need yet to use the ^RAF command so I can't confirm that it works but I do know the ^RMF command does its job.
  • Options
    viningvining Posts: 4,368
    If you're downloading pictures for things like radar or satellite images you can leave the filename as a fixed name like RAD_1.png, RAD_2.png,.... on the master and the dynamic image file name and path just stays the same on the TP. Then you download the new image into the existing file on the master and then do a refresh ^RFR command or the elusive ^RFRP which I can't find any more.
  • Options
    GSLogicGSLogic Posts: 562
    Here's the big idea!
    I'm programming a home with 34 touchpanels (like mine :) ) and I'd like to upload all the tv icons (245 png) to the Netlinx server image folder, then have code select the proper icons the user setup and ftp/load them to the touchpanel using the names of the files that were stored on the Master. This way I can update/add whatever icons I need without having to upload all 34 touchpanels.

    I already use an icon favorites - the user can select from 245 different icons which get stored for recall, but the images have to be loaded on the touchpanels.

    I use the ^BBR command to upload/refresh images with my picture frame module, but I have preset dynamic names setup in the panels (image1/image2/image2) when selecting the image?, the panel receives the image over ftp from the Netlinx server, the user and just replace the images thru ftp as long as they have the same names.
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    34 touch panels? Holy crap, Batman! :)

    So what part isn't working? Are you trying to change the filename of the dynamic image?
  • Options
    viningvining Posts: 4,368
    Joe Hebert wrote:
    34 touch panels? Holy crap, Batman!
    I'll 2nd that!

    What you're trying to do makes sense and using the ^RMF command as Joe suggested would be the way to go. Don't think you need the ^BBR command if all you're doing is changing channel icons to match the users selection to existing dynamic image resource names like FAV_1 - FAV_10. Just tuse the ^RMF commnad to change the file name of the selected FAV_x and then do the ^RFR command but the button with the dynamic image will most likely have to be in focus to actually refresh. The ^RFRP command I mentioned ealier is supposed to work whether in focus or not but that command appeared and then disappeared.

    If using the ^RFR command you can always just display a 5 x 5 pixel button with a low opacity to accomplish the refresh and no one would be the wiser.
  • Options
    GSLogicGSLogic Posts: 562
    vining wrote:
    Joe Hebert wrote:
    What you're trying to do makes sense and using the ^RMF command as Joe suggested would be the way to go.
    Have you ever wanted to just erase a thread that you started... well here is one for me.
    After I read your post the light bulb went on. As you both suggested ^RMF works fine.

    Thanks for both of your help!
    -Gary
  • Options
    DHawthorneDHawthorne Posts: 4,584
    I tried this on a smaller scale, and found even then that the performance was unacceptably slow. Loading images from the master takes forever. I was using it on the dynamic channel list module I have posted here (somewhere), and half the icons would render, and the rest not, and even the ones that did took 5-10 seconds to appear. When the images are loaded on the panel, it is instantaneous. There are similar issues with cover art on media server pages, where it can't be avoided. They just don't seem to be designed efficiently in this regard.
  • Options
    GSLogicGSLogic Posts: 562
    DHawthorne wrote:
    I tried this on a smaller scale, and found even then that the performance was unacceptably slow. Loading images from the master takes forever. I was using it on the dynamic channel list module I have posted here (somewhere), and half the icons would render, and the rest not, and even the ones that did took 5-10 seconds to appear. When the images are loaded on the panel, it is instantaneous. There are similar issues with cover art on media server pages, where it can't be avoided. They just don't seem to be designed efficiently in this regard.
    I would have loved to have read your post earlier... I found the exact same thing, VERY slow and unusable. It is such a cool idea! It works fine for my picture frame mod but that's only loading one image at a time.
    I ended up changing my OLD code around so the tv/music logo icons look at the png image name instead of the panel icon slot number. I can now update the logo icons or add new ones without having the array slots shift position.
  • Options
    I've got a number of 8400's where the customer wanted the option to change the background pictures at will, so we set it up with the ^RMF command. 30 touchpanels last fall - no problem. One touchpanel last week, couldn't get it to work. Tried everything to no avail. Same program as teh reset, same touchpanle file. even tried the same graphics as the other ones.

    Ends up there is a bug in the current firmware that is preventing ^RMF from working if the image is stored in teh root directory of the master. You have to store the image in a sub folder (like the Images folder already there - now why didn't I think of that) Then include the sub folder in teh ^RMF command.

    Of course I didn't find this out until I was 3 hours from the job site on my way home Friday afternoon.
  • Options
    GSLogicGSLogic Posts: 562
    JohnMichnr wrote:
    Ends up there is a bug in the current firmware that is preventing ^RMF from working if the image is stored in teh root directory of the master. You have to store the image in a sub folder
    I had all the tv_icons in a sub folder in the images folder.
    The problem happens when you start to send commands to load different files. They stop loading after 3-5 images(4k files).
  • Options
    DHawthorneDHawthorne Posts: 4,584
    GSLogic wrote:
    I had all the tv_icons in a sub folder in the images folder.
    The problem happens when you start to send commands to load different files. They stop loading after 3-5 images(4k files).

    I likewise had a subfolder. It didn't help. I think it's more a matter of multiple images being loaded sequentially.
  • Options
    viningvining Posts: 4,368
    On my satellite and radar images I'm not having any of these problems and the only part that really takes a long time is the initial download from the website. I first download the current HTML page and parse that to get the current image file names and then go get each file. Once I have all the files downloaded to the master I transfer them to the panel and during this time I show the file progress bargraph with the file names just like when loading TP files, same bargraph. These files are I think 90-100k files, 9 in total and they all refresh fine.

    When I get some time I'll double check what I did but I do recall it be a little convoluted.
  • Options
    GSLogicGSLogic Posts: 562
    VAV

    I was loading tv icon images (png files) from the Netlinx master over FTP. It should work but it doesn't, the files are only max 5k each. The problem is in the Netlinx, the first 3 to 5 images load fine and MAYBE 1 or 2 would load 30 seconds later and then stop. Like I said before I have no problem load larger images that are stored on the master for my picture frame, it's the quantity of small images.

    I hope AMX fixes this problem, as storing all your icon on the master is the way to go!
  • Options
    viningvining Posts: 4,368
    Gary,

    I'm updating all 9 Rad/Sat images at the same time too and all though I would like it to be faster it's not all that bad and they all do update. Which is very noticeable when switching from standard images to IR or water vapor images.

    At least since they increased the TPs RAM the Rad/Sat animation works much better.

    Right now I'm so busy my head hurts otherwise I'd play with it some more or at least go through my code and see if I can figure out what I did.
  • Options
    viningvining Posts: 4,368
    I decided to take a break from doing paperwork and take a look and it appears I'm using the ^RFRP command not the ^RFR. I've only been able to find this command documented in the MVP-8400i manual but it appears to work on the other panels I've recently installed. I assume is just another one of those deals where AMX feels if you need to use it you can find it on your own and if you don't find it you probably didn't need it. Just like when they change baud rates and don't publish that fact but that's an old sore spot.

    I've attached a screen shot image pulled from the 8400i manual. I'm doing some other goofy $hit in my code so this by itself may not help.
  • Options
    GSLogicGSLogic Posts: 562
    Vin

    Correct me if I'm wrong but, I'm pulling the images from the Netlinx master over FTP. I think you're pulling from the internet over HTTP.
  • Options
    viningvining Posts: 4,368
    I pull the image files from the internet and store on the master and then use a FTP dynamic images on the TP to pull from the master. So a side from the initial downloading stuff I'm doing the same thing as you with 9 or 10 images but 100k file sizes not 5k.
  • Options
    DHawthorneDHawthorne Posts: 4,584
    That suggests the problem is not in the panel, but in the master, and in storing images on the master. It wasn't my first thought because cover art from a MAX or Escient suffers the same way, but it could be they share connection conventions. I think it's a connection issue, not a file transfer one - the connection itself is taking too long to negotiate to display the images properly.
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    Gary,

    Have you considered using HTTP instead of FTP with your dynamic images? I used dynamic images configured for HTTP for a movie module that I wrote. One of the things the module did was grab movie posters for movies that were playing in the area (near the zip code entered by the user), from the web, and stored them on the Netlinx master (pre DUET). On the Now Showing page I displayed 6 posters at a time (100x150 .jpg approx 4K each) and they displayed without any problems. When the user hit next page the dynamic images updated with the next set of 6 posters that were stored on the Netlinx master. This worked fine on an old MVP-8400 without any memory upgrade. I?m not sure if it will make a difference for you but it may be worth a shot to try switching from FTP to HTTP. My images were .jpg and you say you?re using .png. I wouldn?t think that should make a difference but maybe it does. Or maybe it?s DUET vs. non DUET issue.

    You many also want to consider dropping the ^RFR command since the dynamic image will update on its own when it?s displayed or whenever the URL is changed with the ^RMF command. Ever since Dave Hawthorne made mention of this a long while back I haven?t had the need to use it. I?m not saying the ^RFR command (or ^RFRP) is bad or shouldn?t be used. I?m just saying for my instances I haven?t needed it. Maybe your dynamic images are doing twice the work they need to do.

    I have noticed that the very first time dynamic images are displayed it sometimes take forever and a day to load. If you wait for the images to load, then leave the dynamic images page, and then come back to it later it updates much quicker. It?s just the very first time it?s ever used.

    I'm not holding my breath but I hope some of this fodder is of some use.
  • Options
    viningvining Posts: 4,368
    Joe Hebert wrote:
    My images were .jpg and you say you?re using .png. I wouldn?t think that should make a difference but maybe it does.
    I seem to recall recently reading AMX recommendations to minimize use of R4 resources and they suggested using .jpg files instead of .png files. At least that's want I think I read so maybe there is something to using one file typre over the other.

    I just check my files and my animated radar uses .png and my satellite images are .jpg so who knows?
  • Options
    jjamesjjames Posts: 2,908
    vining wrote:
    Joe Hebert wrote:
    34 touch panels? Holy crap, Batman!
    I'll 2nd that!
    In MICHIGAN no less!! That deserves a DOUBLE HOLY CRAP, BATMAN! from me considering the shape of MI . . . then again - the rich always stay rich. ;)

    Edit: silly me should have read the SECOND page of the thread . . . oops.
  • Options
    GSLogicGSLogic Posts: 562
    Vin, Dave, Joe or any other code junkies!

    If you send me an email, I'll send you a link to download a small test program/panel/icons in a zip file to test on your systems. It doesn't work here and I think I've tried everything. I get the same results that Dave said in his post, some display and some don't.
    File to large to upload here (5mg).
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    Gary,

    Hopefully you got my emails with some new code that I sent you. I got it working perfectly using HTTP, a modified loop, and a Timeline to space out the ^RMF commands (sans ^RFR). Each page of 8 loads in less than a second and a half and it hasn?t missed a one. I tested the same code using Dynamic Images with FTP and there is definitely a difference (at least on my system) FTP doesn?t work nearly as well as it misses image updates every other page flip or so. I can?t make it miss with HTTP.

    Great idea with the icons. I?m going to have to steal it now. :D
    GSLogic wrote:
    Vin, Dave, Joe or any other code junkies!

    If you send me an email, I'll send you a link to download a small test program/panel/icons in a zip file to test on your systems. It doesn't work here and I think I've tried everything. I get the same results that Dave said in his post, some display and some don't.
    File to large to upload here (5mg).
  • Options
    nhercnherc Posts: 34
    Joe would you mind sharing? Maybe attaching some of your code?
  • Options
    viningvining Posts: 4,368
    Joe Hebert wrote:
    Great idea with the icons. I?m going to have to steal it now.
    I wouldn't mind stealing it either and would like to see the before and after versions.

    Sinced it's fixed sharing may not be as desierable as before but if if you are still so inclined send to: viningele@msn.com .

    Gary, I also understand you have a module for UPBs. Would you be willing to sell an open source version? If so, email the desired $$.
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    Can?t be secure?

    As a follow up, I can?t get any images to load in the TP if I enable HTTP password protection on my NI-700 (DUET latest firmware). When I do a Get Live Feed test for the Dynamic Image with TPD4 I get an error that reads: Unable to load image file; file may not exist or may not be a PNG or JPG image.

    I have the correct user name and password entered in the Dynamic Image settings. If I disable HTTP security then the images load perfectly in the TP. If I enable HTTP security I get zip, nada, nothing. :( Anyone have any ideas on why that is?

    Regarding posting the code, it won?t do much good without the entire project (which is too big to post here) and I?d rather not post anything without Gary?s permission. All I did though is add a Timeline event to pace out the ^RMF commands and modified the loop a bit.
  • Options
    GSLogicGSLogic Posts: 562
    Here's what I've learned... it doesn't work!

    The images won't load with HTTP if you have Netlinx password is on (which is a must in all my systems). They will load with FTP, just VERY slow and sporadic. Even when you turn OFF Netlinx password it's not smooth.

    As of now:
    I let the user select from over 200 icons that are stored on each panel (pic1). This is a HUGE waste of time when it comes to updating or adding icons. Once the user has selected/changed their icons, the panel will only display their choices (pic2) which only needs to be loaded once when the panel comes ONLINE.

    Need to do:
    Have all icons (tv/dss/cable/xm/sirus) reside on the Netlinx master, not in the touchpanels. Updating and/or adding icon will be very easy.

    Send me your email and I'll send you a link to the test code. gary@gslogic.net
  • Options
    jjamesjjames Posts: 2,908
    Why does it need to reside on the master? Why can't it reside on a personal website?
  • Options
    GSLogicGSLogic Posts: 562
    jjames wrote:
    Why does it need to reside on the master? Why can't it reside on a personal website?
    I'm trying to set this up for all my clients, icons will change in different cities/states and most of all I can't trust a website/internet connection to always be online.
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    GSLogic wrote:
    Here's what I've learned... it doesn't work!

    The images won't load with HTTP if you have Netlinx password is on (which is a must in all my systems). They will load with FTP, just VERY slow and sporadic. Even when you turn OFF Netlinx password it's not smooth.
    Yep, I experienced the same with HTTP password protect enabled as I stated in my previous post. Sucks for sure. :( However if you?re saying that it doesn?t work perfectly with HTTP and password protect disabled then I assume you?re still blasting the ^RMF commands in a FOR loop and didn?t try the Timeline code. If I switch over to FTP with password protect and use your FOR loop then the images do appear VERY slow and sporadic as you said. If I use a Timeline then the images load quickly but 1 or 2 do miss sometimes which is still not acceptable. I?d love to find out from AMX why we can?t retrieve any image from the master via HTTP with password protect enabled.

    Bottom line though I think is you can?t just blast away that many ^RMF commands to on screen dynamic images with a FOR loop (at least with the firmware as it stands now.) You have to throttle them somehow with a Timeline or queue or you?re going to continue getting undesirable results.
Sign In or Register to comment.