Downloading Strategy to Controller via .Net Application

Is there any code (C# or VB.Net) that will allow us to download a strategy to a controller? We have a lot of remote clients that will occasionally need their strategy updated based on our changes and our normal process is they have to send in their controller and we update it here but what we’re attempting to do is create an application that we can send them and they can run that will do it automatically. I’ve looked under the SDK’s but didn’t see anything that would work (unless I missed something) so I’m hoping someone can help us out.

Thanks in advance!

Hello BBousman,

Welcome to the OptoForums! PAC Project includes a command-line version of PAC Terminal, which you can call from your custom software. You’ll give it the Control Engine Download File, which you can generate in PAC Control under: Compile > Compile Control Engine Download File.

From a DOS box, you can try it out, call with -h to get the help. Shown here in the default installation location:


For more details and instructions (about which dlls you’ll need, etc.) see this post.

Hope that helps!

-OptoMary

So there’s no DLL or SDK that I can use to integrate it? I have to use that Terminal application?

No SDK for that. However, another option (assuming you have fairly modern SNAP-PAC-R or -S controllers, which have a microSD card slot), would be to have your software FTP that Control Engine Download File to the appropriate directory on the installed SD card.

Or, you could mail those remote locations a microSD card loaded with the appropriate files. Many of our customers are using that feature for remote maintenance since the person on-site doesn’t need any software or even a PC, they just insert that card.

The User’s Guide for your SNAP-PAC-S or -R controller includes instructions for using the microSD.

What if we store the strategy in flash memory instead of on the card? I take it that won’t work then?

We are using the SNAP-PAC-R controllers which do have a card but there’s no strategy folder under sdcard0 on it.

The mechanism to load the new strategy only looks at this microSD. However, if you’re seeing that /sdcard0 folder that means you have a card in there, and you can upload/create the appropriate files from there (using FTP in your custom software, or even using PAC Manager).

I created the “strategy” folder under the /sdcard0 folder and added the .CDF file to it and it changed the name to “PAC_NEXT.PAC” but the strategy on the Controller didn’t change. Is this not how it’s supposed to work or did I misunderstand your last comment?

My last comment was meant only to address the fact that your hardware IS new enough (has an sd slot), and clarify this feature works only with the sd card (not the built-in flash).

There are a few more steps/details to the process, check out the SNAP PAC R-Series User’s Guide, search for “testing a strategy” (step 5 talks about the rules for naming, must end in .cdf, for example).

Also, some changes were made to that functionality in the last few years. Do you know the firmware versions of your remote SNAP-PAC-Rs? (Vs. what the one you’re using for testing?) If they’re not all the same, you might also want to check out the info in that manual about updating firmware from the sd card.

Ah okay, yeah, we store everything on the built in flash so I guess that’s not really an option for us.

I was able to get the PacTerminal command line application to work so we can just use that.

Thanks!

Excellent! Lots of folks use that arguably simpler approach–the command-line method is less flashy. HAR! Bad geek pun! (Sorry, couldn’t resist.)

Yeah, the only downside is that we don’t want our clients to be able to access our strategy files which is why we want to stream the new file to the controller but we’re not able to do that with the PacTerminal command prompt application but hopefully it won’t be that big of an issue.

Actually, you might notice that -dp option termcl, which lets you download an encrypted (e.g. SSD) file. Ta-da! More info on that PAC Project option here.

However, your .cdf, although it’s text, is a COMPILED strategy–not something that could be opened up in PAC Control. I would recommend setting the PAC Control option: Configure > Minimal Debug before you generate your Controller Download File. That will make it more compact/cryptic for a would-be snooper.

FYI, that SSD option was built specifically for folks worried about intellectual property concerns, so contact your friendly neighborhood OptoSales person (or one here at headquarters) if you’re interested.

Will do! Thanks for your help!