Wednesday, December 23, 2015

Happy Holidays and Happy New Year!













Best wishes to all our customers, partners and friends for a wonderful holiday season and a successful new year.

We would like to express our sincere appreciation for letting us work with you in 2015. We look forward to launching many exciting projects in 2016!

Our offices are closed December 24 through January 4. We will see you in 2016!
 

Tuesday, December 8, 2015

Is your ECU running out of I/O? Extend its capabilities!

Are you a developer who uses ECU's to accomplish different tasks?  Whether Automotive or other realms, ECU's can be used to drive many systems.  What happens when that ECU runs out of I/O for the specific application being tested?  With off the shelf tools from ETAS, that problem can be solved quickly and seamlessly.  For this example, an ETAS FlexECU was used, but this can be interchanged with most ETK enabled ECU's with some initial prep work.

External bypass with the FlexECU is accomplished by first having the necessary hardware and software.  For this example, an ES910 with ES410 is used to enable additional analog input channels to be used by the FlexECU for development purposes.  Additionally, INTECRIO must be used to configure the ES910 for bypass, as well as EHOOKS and INCA for configuring the FlexECU.  This example uses all hand coded C, but can easily be used with both ASCET and Simulink modeling tools.
       
External bypass is first configured on the ES910 using INTECRIO.  Because this bypass is one way, and we are only providing data to the FlexECU, a few considerations must be made when configuring this project.  First, open and create a new INTECRIO project.  Once a new project is created, add a new hardware system (ES910) and configure both the ES4xx device being used, and the ETK_BYPASS device.  More information on creating this system can be found in the INTECRIO user documentation.

With this system created, we can now configure the EHOOKS a2l to be imported into INTECRIO.
       
Open the EHOOKS configuration that will be used for bypass.  We must first create an On-Target bypass task to run the external bypass code in C.  To do this, add a new function in the “On-Target Bypass” tab.  For this example, ExtByp_C is used.


With this task created, we can now create our C code to make the function call and grab the bypass data.  Navigating to the build tab, we need to create two files.  We must have an .ehdef and .c file.  The .ehdef file is where we will create and configure our bypass variables, and our .c file we will make the necessary function calls to grab the bypass data from the ES910 and assign it to the FlexECU variables.  In order for the FlexECU variables to be seen by INTECRIO, “RP” must be checked.  This makes them visible to the rapid prototyping tool.


For this example, Byp_Test_Var1 is the variable that data will be written to from the ES410.  We must be sure to set the correct data type, and it must be consistent between the two platforms.  Heartbeat is used to ensure our bypass task is running.  Once all of the variables needed are added, we can look at C code.  Opening the new C file, it should be empty.  EHOOKS needs the basic setup for new On-Target Bypass tasks, which can be found in the “Example Code” window in EHOOKS.

This example code is the framework of our function.  This must first be added to our C file.
       
Once this is added, we can go ahead and add our heartbeat counter.

Once we have added our heartbeat counter, an enabler is added to allow for enabling or disabling of the External Bypass.

Bypass is done by making a function call in EHOOKS to grab the data defined at that location in memory.  Once we have built this new A2L file with our “RP” variables, it will be then imported into INTECRIO.  INTECRIO will then know the locations in memory to write the external bypass data, and the EH_Get call will grab that data.  More details on the necessary function call can be found in EHOOKS here:

By adding the EH_GetExtFloat32() call, it will grab the data written from INTECRIO to the specific place in memory defined by the FlexECU.  An example of this can be seen here, as I am grabbing a float32 and assigning it into a new variable, byp_read_test_var1.  It is then assigned to the variable defined in our .ehdef file, Byp_Test_Var1.

Once all variables have been added to this task, build the project.  The resulting A2L file will now be imported into the ETK_BYPASS device in INTECRIO.



Once imported, you will see the variables you added “RP” in your .ehdef file. 

Now that the variables are in INTECRIO, we need to set up the system.  Under “Systems”, double click on your ES910 system.  To create the link from the ES410 channel and ETK output channel, simply drag and drop the input you want from under the “Systems” dropdown, and similarly for the “ETK_Bypass” variable.

Once the variables to be used are found, simply drag them into the system workspace.

Once added, simply connect the output of the daisychain to the input of the bypass variable.

This creates the link. 
      
 Lastly, we must configure the OS to run the bypass without a condition.  To do this, move the ETK_Bypass send commands from “Software Tasks” to the 10ms task by dragging and dropping.  This will trigger the INTECRIO Bypass task every 10ms.


       
All that is needed now is to build this INTECRIO project, and create a new INCA workspace with both the FlexECU and ES910 simulation targets.  For more information on creating INCA projects, please consult the INCA user documentation.