We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Embedded Software

Embedded Software

Scade One Variant Types

    • SolutionSolution
      Participant

      Introduction

      This blog entry is special: we have a video for you!

      Aubanel, our director of Ansys Customer Excellence, demonstrates a new construct in Swan, the modeling language used in Scade One, called variant types.

      Variant types?

      A variant type defines a data structure holding a value that can take on several different, but fixed, types. The generated C code uses union in a safe, MISRA-compatible way, by using a tag field to know which type is in use.

      In short, a variant type is a type that can be this or that or something else.

      In the video, Aubanel showcases this with a shape type that can be either a rectangle, a circle or a polygon.

      This makes it easy to design generic operators that perform calculations on shapes, with no need to duplicate our logic to handle various cases for various shape types:



      Demo time 🎬

      Want to know more?

      In this video, you saw how variant types can power cleaner, easier-to-maintain models.

      If you’d like to find out more about Scade One, request a demo today over at https://www.ansys.com/products/embedded-software/ansys-scade-one.