I am trying to create a skill function to automate updating the stackup in Allegro PCB Designer using an IPC-2581. The program will grab an ipc2581.xml file that was previously updated earlier in the skill program and import it into Allegro PCB Designer.
I have tried two approaches but both fail to meet my needs.
The first attempt was to make a system call to execute the ipc2581_in command.
board = axlCurrentDesign() ; test.brdsprintf(command "ipc2581_in ipc2581.xml -x -o %s" board)system(command)
The issue with this process is the stackup for test.brd in Allegro does not reflect the changes from the import once the import complets. The ipc2581_in function parses the xml file and the brd file. It then deletes the brd file and creates a new one (this is because they are both named the same thing). After the process is complete the skill function exits and I am returned to the PCB Designer window. Opening up the stackup window displays the same data that was there before the import. If I close the design (without saving) and open the board back up, the stackup will then reflect the changes from the import. For this process to work I would need to alter the above block of code to somehow refresh the board but I am unaware of a function that does this. NOTE: When you utilize the Cadence built in IPC2581 import function this is what appears to occur because the Cadence command window states
PC2581 In completed successfully, use Viewlog to review the log file.Opening existing design...
My second attempt was to use the axlShell function to run the ipc2581 command but this also does not work. I can run
axlShell("ipc2581 in") ; note there is no underscore
which will open up the Cadence IPC2581 In Gui but that defeats the purpose of automating the process since the designer now needs to still manually complete the process. I also tried running something similar to attempt 1 but without luck
board = axlCurrentDesign() ; test.brdsprintf(command "ipc2581_in ipc2581.xml -x -o %s" board) ;axlShell(command)
I tried the code above using "ipc2581 in" which just opened the Cadence gui and ignored all the text after the word in and I also tried using "ipc2581_in" which resulted in Allegro complaining there is no such command.
Any help would be greatly appreciated!!
I got a fresh pair of eyes to look at my code and they came up with an alternate solution using a script. I am still open to other ideas if anyone has one particularly if it strictly uses skill to avoid any issues in the future if an Allegro update would break the scr syntax.
The alternate solution was to convert the jrl file to a scr file. I performed the actions within Allegro to import a stackup file. I then extracted just the IPC-2581 import commands from the jrl file and stored them in a test.jrl file. I used the Allegro Script generate function to convert this into a test_jrl.scr file which contained the following:
generaledit ipc2581 in setwindow form.ipc2581_inFORM ipc2581_in browse fillin "test_ipc2581.xml"FORM ipc2581_in layer_feature NO FORM ipc2581_in layer_stackup YES FORM ipc2581_in execute setwindow pcbsetwindow form.ipc2581_inFORM ipc2581_in cancel setwindow pcbgeneraledit
From my skill program I replayed this script by using the command
This executed as expected running the "ipc2581 in" command, selecting the xml file, setting the fields in the form, and then importing the file thus updating the stackup.
In reply to ottodude125:
Dave Elder, Tait Communications
In reply to eDave:
The test stackup I'm importing is extremely simple. I ran an ipc2581 export and changed the thickness on the top copper layer to 1 inch (a ridiculous number that will easily pop out).
I tried that command you mentioned but it does not completely work. I ran the skill commands:
axlSetVariable("wait_debug" nil)axlRunBatchDBProgram("ipc2581_in" "ipc2581_in 631-301-03_a_ipc2581v3_cross_section.xml -x -o 631-301-03_a.brd" ?startMsg "Starting ipc2581 in" ?reloadDB t)
Which gave the cadence command line output:
Starting Starting ipc2581 in...cmd= ipc2581_in 631-301-03_a_ipc2581v3_cross_section.xml -x -o 631-301-03_a.brdipc2581_in completed successfully, use Viewlog to review the log file.Opening existing design...ipc2581_in completed successfully, use Viewlog to review the log file.
After the program completes I go to the xsection gui and it still lists the old values. Looking in Windows Explorer the brd file has been updated and has a new modified date. If I copy that brd file to another directory and open it up in a new instance of Cadence the xsection gui does show the correct thickness for the top layer. So the brd file gets updated but the Allegro PCB Designer gui does not get updated.
Dave that appears to work. It has a small byproduct of closing the axlForm that I have open which contains the button to start the import process but I can work with that. I scoured the Skill reference PDF and I overlooked the axlRunBatchDBProgram function and it doesn't contain the axlOpenDesign function. Thank you very much!! You are a huge help!
Glad to be able to help.
Even better, you can keep the form open by using axlUIWperm