Author Topic: AM-1S PROGRAMMING  (Read 12938 times)

Tom

  • Engineer
  • ***
  • Posts: 79
AM-1S PROGRAMMING
« on: May 14, 2021, 05:48:55 PM »
It has been a frustrating few day with my new AM-1S and instructions for “Creating Custom Accessory Projects” in hand.  The “project” is to create an accessory project that will turn on and off a flashing RR crossing signal and bell.  The idea was to write a program to turn on power to the circuit board that came with the crossing signals, thereby avoiding having to create flashing light effects for each signal light, and start the .wav file with the ringing bell.  After failure trying both light and bell, I opted to precisely follow the directions to “Make a Button on the Screen Play a Sound” only.  This did not work either. So here is situation:
All software is up to date
Project
Project.png

“Crossing Bell” .wav file copied to HC-2
“Crossing Signal” Project copied to HC-2
“Crossing Bell” .wav file copied from HC-2 to AM-1S
“Crossing Signal” Project file copied from HC-2 to AM-1S
Access Accessories from Main Page, Press Bell button, nothing.  Caution info: “Sound File Not Found.”

Additionally, when trying to delete the Project from the HC-2, there is no option to do that: only Pictures, Sounds and Lights.  The “Crossing Bell” .wav file is available to delete under Sounds. This is exactly the same result when trying to delete files from the AM-1S: the only options are Pictures, Sounds and Lights, and the .wav file is there to delete.
Since the .wav file is on the AM-1S it has to be something with the program.  Does anyone proficient with the AM-1S programming have a clue as to what I am doing wrong?

G8B4Life

  • Signalman (Global Mod)
  • Conductor
  • *****
  • Posts: 1237
  • I'll think of a catchy tag line one day
Re: AM-1S PROGRAMMING
« Reply #1 on: May 14, 2021, 10:12:52 PM »
Yes, I can see what's wrong. You got the Sound File Not Found error because of a naming error. When you type in the sound name you must be exact and include the CF symbol as it's part of the filename for user created content (sounds, accessory projects, light effects).

rp_acc_project_soundfile_naming.png

Additionally, when trying to delete the Project from the HC-2, there is no option to do that...

This was noted a long time ago as a bug (even though it's more of a missing feature than a bug). If I recall correctly the official response was along the lines of "Meh, they're only really small files". It's one of the reasons I use a CI-1 and HC Sim for all copying and downloading.

- Tim

Tom

  • Engineer
  • ***
  • Posts: 79
Re: AM-1S PROGRAMMING
« Reply #2 on: May 15, 2021, 02:36:47 PM »
Thanks Tim,

Sweet smell of success - initially.  The bell now rings and I got the flashing crossing signals to work also, by connecting Output 5 to the circuit board.  The problem now is that when the Bell button is pressed again the Bell shuts off but the lights keep flashing.  So I revised the program, as seen below, but the lights still do not shut off.

Project2.png

When copying the program with the same name from Internet to HC and from HC to AM-1S it seemed to go awfully quickly.  I am wondering that if the revised program is named the same as before, the copying really does nothing.  If you think the revised program looks good, I will rename it and copy it but I would like to have some confidence that that is the problem rather than the program since there are now a lot of undeletable projects on the HC and AM-1S.
I think being able to delete Projects would be good for RailPro business.  Not being able to delete them is a problem for anyone wanting to get started with “Projects.”

G8B4Life

  • Signalman (Global Mod)
  • Conductor
  • *****
  • Posts: 1237
  • I'll think of a catchy tag line one day
Re: AM-1S PROGRAMMING
« Reply #3 on: May 15, 2021, 10:38:48 PM »
Not sure why that is, I've never actually used an accessory program. You may need to separate the Set Output instruction from the IF statement. Also your IF Bell = 0 statement does nothing.

First remove the IF Bell = 0 statement from your current program you posted and see if it works. If that doesn't work give this version a shot and see if it works.

rp_acc_project_crossing_signal.png

Quote
When copying the program with the same name from Internet to HC and from HC to AM-1S it seemed to go awfully quickly.

The copying goes quickly because the program is small, probably less that 100 bytes.

Quote
I am wondering that if the revised program is named the same as before, the copying really does nothing.  If you think the revised program looks good, I will rename it and copy it but I would like to have some confidence that that is the problem rather than the program since there are now a lot of undeletable projects on the HC and AM-1S.

If something is named the same as something else of the same type then it will be over written when copying, so an accessory project named Crossing Signal will overwrite another accessory project of the exact same name when copying.

As far as I know the Accessory Modules can only have one accessory program on them at a time, so if you had a project named "Flashing Lights" on it and then copied the program "Crossing Signal" to the AM "Flashing Lights" would be overwritten with "Crossing Signal". This would be the only time a file overwrites another file of a different name.

Quote
I think being able to delete Projects would be good for RailPro business.  Not being able to delete them is a problem for anyone wanting to get started with “Projects.”

No argument here but he just doesn't seem to have any will to do it. Not trying to change you but again, one of the reasons I (and many) use the CI-1 and HC Sim to do copying and downloading, HC Sim can be blown away and reinstalled at any time, so if you filled it up with useless projects you could easily start again with a clean slate.

In fact, I'd suggest downloading and installing HC Sim, even if you don't have a CI-1 just so you can use it to download the other accessory projects from Ring so you can study the ready made examples without filling up the physical HC with programs you can't delete.

Note: Edited post for clarity.

- Tim
« Last Edit: May 16, 2021, 03:46:31 AM by G8B4Life »

Tom

  • Engineer
  • ***
  • Posts: 79
Re: AM-1S PROGRAMMING
« Reply #4 on: May 16, 2021, 02:39:11 PM »
Thanks again.  I will keep working on it.  Seems like if an output can be turned on it ought to be able to be turned off.  In this case by pressing the Bell button again.  Maybe there is some other way.

G8B4Life

  • Signalman (Global Mod)
  • Conductor
  • *****
  • Posts: 1237
  • I'll think of a catchy tag line one day
Re: AM-1S PROGRAMMING
« Reply #5 on: May 17, 2021, 01:19:33 AM »
Yes, the output can be turned off, and pressing the button so it's in the off state is the way to do it. Did you try the program as I posted? That should work. Looking at your program again with my programming cap on I can see (I suspect) why the outputs are not turning off. I should have seen it right away  :-[

With your program, when the Bell button is pressed to turn it on the IF  Bell = 1 statement is true so the two DO TASKS are run, playing the bell sound and turning on Output 5. When the Bell button is pressed again to turn it off the IF  Bell = 1 statement is now false so the two DO TASKS are not run so Output 5 never gets it state changed to off (even though the sound stops playing).

That's classic programming for sure and I should have seen it straight away but the Play Sound function threw me as it stops when the IF condition is false instead of having to be turned off specifically.

If you still can't get it to work it'll be Thursday before I can test any of this.

- Tim

Tom

  • Engineer
  • ***
  • Posts: 79
Re: AM-1S PROGRAMMING
« Reply #6 on: May 17, 2021, 12:01:04 PM »
Tim, it worked perfectly, although I will have to consider the programming logic some more to make sure I fully understand it.

An added bonus not expected is that, for whatever reason, the crossing signal picture I installed shows up under locomotives as well as Accessories so it can be accessed by pressing the engine picture without having to exit the page and go to Accessories.  When exiting the crossing signal (either left running or off) the HC goes back to the Main Page and then the engine that was running has to be selected again.  The AM-1S option seems workable, usable for other Projects, and less expensive than some of the more sophisticate stuff out there like Signalogic Systems.  Grandson will love the flashing lights and bell.

Tom

  • Engineer
  • ***
  • Posts: 79
Re: AM-1S PROGRAMMING
« Reply #7 on: May 17, 2021, 04:48:48 PM »
I miss wrote above.  After selecting crossing signal picture from locomotive list I wrote that pressing the Exit Page button takes the HC back to the Mail Page, which is true.  But pressing the crossing signal picture takes the HC back to the locomotive list.  Once there, the original locomotive can then be selected again.  Slightly easier than I originally thought.