# Naming convention ------------------- [TOC] `__` ## Type Type is indicated by the first letter, like in **s**VcEc_D_EngState. * **y** = global bool (model interface to suroundings). * **x** = local bool (internal model signals). * **s** = global variable, non bool (float, uint ...). * **r** = local variable non bool. * **c** = constant. * **t** = table. * **m** = map. ## Prefix Two For example s**Vc**Ec_D_EngState. Original meaning was **V**ehicle **C**ontrol. In Volvo Cars, it is today used to signify that the signal is defined by VCC. ## Module For example sVc**Ec**_D_EngState. Shows the signal origin. Insignal from supplier software partition uses **Ec** (Engine control), **Di** (Driver interface), **Bc** (Brake control). Outsignal use the model name, for example *VcDeScl* will have out signals named *sVc**DeScl**\_X\_\**. ## Quantity See table. You can find the allowed abbreviations in the file SPM_Units.xls in the ConfigDocuments folder in your project. | Abbreviation | Meaning | Standard Unit | |--------------|------------------------------------------|-----------------------| | a | Acceleration | m/s2 | | ad | Deriv of Acc | m/s3 | | an | Angle | CA, deg, rad | | and | Angle/s | CA/s, deg/s, rad/s | | Ar | Area | m2, mm2 | | B | Boolean, flag 0/1 | - | | D | Discrete (enumeration type) | - | | E | Energy | J, kJ, kWh, mWh, Wh | | ef | Efficiency | - | | Enm | Enumeration (string type, implicit enum) | - | | Eta | Viscosity Dynamic | mPa s, Pa s | | F | Force | N | | fac | Factor | - | | Fd | Force Rate | N/s | | fq | Frequency | Hz | | Gear | Gear | - | | I | Current | A, mA, uA | | Id | Current Rate | A/s | | J | Inertia | kgm2 | | L | Distance, Length | m, km, mm | | lam | lambda | - | | lk | Distance, Length | m, km | | m | Mass | g, kg, mg, mg/stk | | m | Mass per Revolution | g/rev | | md | Massflow | g/s, kg/h, kg/s, mg/s | | mu | Viscosity Kinematic | cSt, m2/s | | n | Revolution Speed Number | rpm, krpm, rps | | nd | Revolution Acceleration | rpm/s | | p | Pressure | bar, hPa, kPa, MPa | | pd | Pressure Rate | kPa/s | | Pw | Power | W, kW | | Pwd | Power Rate | kW/s | | Q | Flow | l/h, l/min, l/s, m3/h | | q | Quantity | mg, mg/stk | | Qd | Heat Change | | | Qf | Quality Flag | - | | R | Electrical Resistance | mOhm, Ohm | | rho | Density | - | | rt | Ratio | - | | rtd | Change of Ratio | 1/s | | t | Time | s, min, ms, ns, us | | tc | Time Constant | s | | Te | Temperature | deg C, K | | Ted | Temperature Change | deg C/s | | Tq | Torque | Nm | | Tqd | Torque Rate | Nm/s2 | | Tqi | Accumulated Torque Over Time | Nms | | ts | Sample Time | s | | U | Voltage | V | | v | Velocity | km/h, m/s, mph | | vi | Accumulated Speed Fault Over Time | m/s s | | vol | Volume | cm3, l | | w | Angular Velocity | rad/s | | wd | Angular Velocity Rate | rad/s2 | | X | Share | % | | xb | Burned Fraction | - | | Xd | Change of Share | %/s | | Xi | Accumulated Percentage Over Time | %s | | Z | Non Standard Quantity | any | | Z | Concentration | ppm | | Zd | Non Standard Quantity Change | any | ## Description It can be useful to look at the AUTOSAR name conventions, that might be the only useful from Autosar. An AUTOSAR name consists of four parts, see table. ![autosar_name.jpg](../images/target_link/autosar_name.jpg) ### Structure ![structure.png](../images/target_link/structure.png) Example: ![example_name.png](../images/target_link/example_name.png) ![device_name.png](../images/target_link/device_name.png) The subfunction of a model shall be seen as a ”Device”, e.g. EgrMonr for the Egr Flow monitor, EgrClrMonr for the Egr Cooler monitor etc. If the model does not have sub functions, the Device can be chosen according to the standard. ![action_name.png](../images/target_link/action_name.png) Usually quantity and position. * MFlw – Mass Flow. * VolFlw – Volume Flow. * P – Pressure. * T – Temperature. * Lam – Lambda. * Tq – Torque. * Ag – Angle. * Ar – Area. * Pos – Position. * Pwr – Power. * Ti – Time. * U – Volatge. * I – Electric Current. * Rat – Ratio (duty cycle ratio). There are more, see AUTOSAR. For example PAmb (Ambient pressure), TIntk (Temperature in the Intake), TDs (Temp Downstream) and MFlwUs (Mass Flow Upstream). ![condition_name.png](../images/target_link/condition_name.png) Calculated Signals. * Sp – Setpoint: Base mappning (MR also uses ”Req” – Requested). * Tar – Target: Limited Setpoint values. * Est – Estimated: An estimation of a value. E.g. rVcAesObd_T_SupChrgrMonrTDsEst. * Raw – Raw – Unprocessed sensor data. Replacement Values. * Rvlu – Replacement value. Running Conditions. The limits for determening running conditions shall use the following naming: [Hi/Lo/Min/Max]EnaLim. E.g. *EgrMonrAmbPMinEnaLim*, *SupChrgrMonrPDrpLoEnaLim* [Super Charger Pressure Drop Low Enable Limit]. Boolean result from the limits shall use the Condition ”Enable” – ”Ena”. E.g. *EgrMonrAmbPMinEna*, *SupChrgrMonrPDrpLoEna*. Test Values. The test values shall use the following naming: [Hi/Lo/Min/Max]TstVlu. E.g. *EgrMonrArMinTstVal* [Egr Monitor Area Min Test Value], *SupChrgrMonrPTstVal* [Super Charger Pressure Test Value]. The completion of a test value calculation shall be named: [Hi/Lo/Min/Max]TstVluCmplt. E.g. *EgrMonrArMinTstValCmpl* [Egr Monitor Area Min Test Value Complete], *SupChrgrMonrPTstValCmpl* [Super Charger Pressure Test Value Complete]. Error/Ok information faults shall be called "Errors", short name is "Err". Passed shall be called Ok (Ok). Determening faults conditions: "Error Threshold", i.e. the condition shall be [Hi/Lo/Min/Max]ErrThd. E.g. *EgrMonrArErrThd*, *BoostMonrPHiErrThd*. Monitor Error Flag - \*Err, e.g. *EgrMonrArErr*. Monitor Pass Flag – \*Ok, e.g. *EgrMonrArOk* [Egr Area Ok], *VVTMonrPosnMaxOk* [VVT Position Max Ok]. ## Rename Simulink Block Sometimes it is useful to be able to rename signals in Simulink. This can be achieved by creating a new mask, e.g. called "Rename_Signal", which can contain a "TL_Inport" followed by an outport block. The "TL_Inport" block can be configured with an appropriate name as wel as appropriate [variable_classes](./variable_classes.md).