Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

about how to use PIL

0 votes
699 views
hello

When trying to use PIL, I looked at the demo documents of FOC and NPC, and needed to download a. Ehx file first, then configure PIL, and finally modify the C file to re-down to DSP.Is this.ehx file common to all simulations, or is it a FOC and NPC demo?If I want to create a new model, how do I get this.ehx file?Is this EHX file used to initialize DSP communication to communicate with PLECS?

In addition, the demo document mentioned that "PIL Prep Tool" software was used to generate some required C files. However, there was no function in the generated file after I clicked on it, and only "WARNING!All changes made in this File will be lost!"So how does this software work?

There are too few official documents on the usage of PIL, and we have no idea how each step should be carried out, how to communicate with DSP, and how to modify The C code.Do you have relevant instructions for use?

Contact: +86 18004767455

WeChat: 18004767455

thank you
asked Jun 18, 2020 by ning_electronics (12 points)

1 Answer

+1 vote

The “*.ehx” files provided with the PIL demos are of the "extended hex" format used by the C2Prog Flash utility. We use this format as it includes all the programming settings and makes flashing an evaluation board and running PIL demos quick and straightforward.

However, it is not necessary that you use this format for your own application. You can program “*.out” files from CCS, UniFlash or C2Prog. None of the PIL functionality depends on the ehx format.

The role of the PIL Prep Tool is to create the information (debug symbols) that PLECS uses to interface with the embedded application. This tool therefore has to be executed at each build, which is achieved by using a CCS pre-build step to call the “buildsteps.bat” script.

You can find the comprehensive PIL manual on our documentation website.

I recommend that you work with the demos provided and review the documentation in conjunction with the sample code.

Also, feel free to contact our support team via email if you have specific questions or need help with converting your project for PIL.

answered Jun 18, 2020 by Beat Arnet (68 points)
Thanks for your reply,

I modified the buildsteps in the CCS project as per the document you gave me, but at compile time, the pil_symbols_c.inc and PIL_symbols_c.inc generated displayed the following: the correct probe code should not have been generated.What is the reason?

#error Error during parsing of 'calib.pilpp': syntax error in line 176 before '_Pragma'
#error Error during parsing of 'control.pilpp': syntax error in line 176 before '_Pragma'
#error Error during parsing of 'main.pilpp': syntax error in line 157 before '_Pragma'
#error Error during parsing of 'pil_ctrl.pilpp': syntax error in line 157 before '_Pragma'
#error Error during parsing of 'pu.pilpp': syntax error in line 228 before '_Pragma'
#error Error during parsing of 'ain_2837x.pilpp': syntax error in line 203 before '_Pragma'
#error Error during parsing of 'canbus_2837x.pilpp': syntax error in line 176 before '_Pragma'
#error Error during parsing of 'dio_2837x.pilpp': syntax error in line 215 before '_Pragma'
#error Error during parsing of 'dispatcher_2837x.pilpp': syntax error in line 181 before '_Pragma'
#error Error during parsing of 'gatedriver_rtbox.pilpp': syntax error in line 176 before '_Pragma'
#error Error during parsing of 'hal_2837x.pilpp': syntax error in line 177 before '_Pragma'
#error Error during parsing of 'power.pilpp': syntax error in line 176 before '_Pragma'
#error Error during parsing of 'pwm_2837x.pilpp': syntax error in line 268 before '_Pragma'
#error Error during parsing of 'qep_2837x.pilpp': syntax error in line 179 before '_Pragma'
#error Error during parsing of 'sci_2837x.pilpp': syntax error in line 176 before '_Pragma'
#error Error during parsing of 'spi_2837x.pilpp': syntax error in line 176 before '_Pragma'
#error Error during parsing of 'F2837xS_Adc.pilpp': syntax error in line 127 before '_Pragma'
#error Error during parsing of 'F2837xS_DefaultISR.pilpp': syntax error in line 130 before '_Pragma'
#error Error during parsing of 'F2837xS_DevInit.pilpp': syntax error in line 117 before '_Pragma'
#error Error during parsing of 'F2837xS_GlobalVariableDefs.pilpp': syntax error in line 130 before '_Pragma'
#error Error during parsing of 'F2837xS_Gpio.pilpp': syntax error in line 129 before '_Pragma'
#error Error during parsing of 'can.pilpp': syntax error in line 183 before '_Pragma'
#error Error during parsing of 'interrupt.pilpp': syntax error in line 177 before '_Pragma'
...