Add Vars via Command Line Interface

Ok, cudos on the CLI. Works pretty much as advertised.

I know there are a gajillion people out there that have been waiting for this and yes it’s here. You can now use your command prompt to add a boat load of vars at one time.

I have done so with Excel, created about 600 vars and then using the /f switch dumped them into Pac Control 9.6a no problem. I found that going into your Win10 config you can add environment vars to make your paths to both Pac Control 9.6 and your project path easier to deal with. Don’t for get to put the path in quotes (if it has spaces and it probably does) and I put the path in quotes inside the windows env vars as well which allowed me to use %pac96% %Tunnel% together these open the project then using the /f switch and a txt file that I paste all the CLI commands into starting with “/av” on each line.

Pac control has to be closed when you use this and the CSV file that gets generated every time you run the script also has to be closed.

I’m sorry for the mistake, I misread the docs or just had a senior moment…CLI does do timers.

I haven’t tried 9.6 yet. I’m definitely interested in checking out the command line options.

Have you checked out my post on using autohotkey? - It can do all PAC variables.

1 Like

Fantastic Phil. Thanks, that’s just what I was looking for.

Nice work Phil, the ahk worked like a charm. I noticed that if you already have a var in Pac that the routine will stop on a message that it needs a longer timer value which means it timed out because the configure variable dialog responded with an error message.

In the CSVImport.ahk file, near the top, there is a variable called DialogWait. You will need to increase the value for your machine. I have it set to 0.5 on mine (an 8 year old machine) and it works fine, can’t imagine your machine being much slower, but try increasing the value and see if it works for you.

The downside to increasing the DialogWait variable is that AHK will wait longer to time out when their is an already existing variable, so if you are adding new variables to an already existing CSV file, it will wait that much longer for each one that already exists.

The script is supposed to detect the error that the var already exists and skip over it. It will then open a text document showing you all the variables it was not able to create.

Yes and what I did was just restart the same csv file with the first couple of entries taken out (vars already created) and it worked without any mods to the timer.
This PC is only 2-3 years old running a gen6 i7 4970 with dual nvidia 970 cards, so it’s still pretty fast.

That machine will definitely outperform my desktop here. I wonder if it has to do with your strategy - does it already have a lot of variables and charts? I was only testing the script on an empty strategy - and it’s conceivable that adding variables slows down when a strategy grows.

I was thinking it might still be a timing issue since this PC is still pretty fast, I suspect it was outrunning the script. The tunnel program is in infant stages but probably already has over a thousand vars. I’m doing the entire fan control via pointers. There are 20 - 60hp fans and each fan has 8 RTDs that I’m doing hihi,hi, lo, lolo set points for so there are 640 alarm points just for motor temp…

Okay, found the bug, the balloon popup on newer versions of PAC Control that indicates a duplicate variable now gets the focus, so when the AHK script sends the ESC key, it dismisses the balloon and not the add variable dialog as the script is expecting. I modified the script to detect this. I tested it on 9.3 and 9.5. Updated the with the new script.