how to define a CAPL function taking a sysvar argument











up vote
0
down vote

favorite












In Vector CANoe, is it possible to define a function that takes a system variable argument like the system function TestWaitForSignalMatch()?



For my use case it is not sufficient to supply the current value of the system variable because I want to pass the system variable to TestWaitForSignalMatch() or similar system functions.



The CANoe help seems to show examples:



long TestWaitForSignalMatch (Signal aSignal, float aCompareValue, dword aTimeout); // form 1
long TestWaitForSignalMatch (sysvar aSysVar, float aCompareValue, dword aTimeout); // form 3


I tried like this



void foo(sysvar aSysvar) {}
^


or this



void foo(sysvar *aSysvar) {}
^


but I get a parse error at the marked position of the sysvar keyword in both cases.



I successfully created functions that take a signal argument, but unlike the syntax in the CANoe help I have to use a pointer.
This works:



void foo(signal *aSignal) {}


Obviously the documentation in the help is not correct in this point. It results in a parse error after the signal keyword when I omit the * as shown in the help:



void bar(signal aSignal) {}
^


So what's the correct syntax for defining a function that takes a sysvar argument? (if possible)



In case the version matters, I'm currently testing with CANoe 9.0.53(SP1), 9.0.135(SP7) or 10.0.125(SP6).










share|improve this question









New contributor




Bodo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    up vote
    0
    down vote

    favorite












    In Vector CANoe, is it possible to define a function that takes a system variable argument like the system function TestWaitForSignalMatch()?



    For my use case it is not sufficient to supply the current value of the system variable because I want to pass the system variable to TestWaitForSignalMatch() or similar system functions.



    The CANoe help seems to show examples:



    long TestWaitForSignalMatch (Signal aSignal, float aCompareValue, dword aTimeout); // form 1
    long TestWaitForSignalMatch (sysvar aSysVar, float aCompareValue, dword aTimeout); // form 3


    I tried like this



    void foo(sysvar aSysvar) {}
    ^


    or this



    void foo(sysvar *aSysvar) {}
    ^


    but I get a parse error at the marked position of the sysvar keyword in both cases.



    I successfully created functions that take a signal argument, but unlike the syntax in the CANoe help I have to use a pointer.
    This works:



    void foo(signal *aSignal) {}


    Obviously the documentation in the help is not correct in this point. It results in a parse error after the signal keyword when I omit the * as shown in the help:



    void bar(signal aSignal) {}
    ^


    So what's the correct syntax for defining a function that takes a sysvar argument? (if possible)



    In case the version matters, I'm currently testing with CANoe 9.0.53(SP1), 9.0.135(SP7) or 10.0.125(SP6).










    share|improve this question









    New contributor




    Bodo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      In Vector CANoe, is it possible to define a function that takes a system variable argument like the system function TestWaitForSignalMatch()?



      For my use case it is not sufficient to supply the current value of the system variable because I want to pass the system variable to TestWaitForSignalMatch() or similar system functions.



      The CANoe help seems to show examples:



      long TestWaitForSignalMatch (Signal aSignal, float aCompareValue, dword aTimeout); // form 1
      long TestWaitForSignalMatch (sysvar aSysVar, float aCompareValue, dword aTimeout); // form 3


      I tried like this



      void foo(sysvar aSysvar) {}
      ^


      or this



      void foo(sysvar *aSysvar) {}
      ^


      but I get a parse error at the marked position of the sysvar keyword in both cases.



      I successfully created functions that take a signal argument, but unlike the syntax in the CANoe help I have to use a pointer.
      This works:



      void foo(signal *aSignal) {}


      Obviously the documentation in the help is not correct in this point. It results in a parse error after the signal keyword when I omit the * as shown in the help:



      void bar(signal aSignal) {}
      ^


      So what's the correct syntax for defining a function that takes a sysvar argument? (if possible)



      In case the version matters, I'm currently testing with CANoe 9.0.53(SP1), 9.0.135(SP7) or 10.0.125(SP6).










      share|improve this question









      New contributor




      Bodo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      In Vector CANoe, is it possible to define a function that takes a system variable argument like the system function TestWaitForSignalMatch()?



      For my use case it is not sufficient to supply the current value of the system variable because I want to pass the system variable to TestWaitForSignalMatch() or similar system functions.



      The CANoe help seems to show examples:



      long TestWaitForSignalMatch (Signal aSignal, float aCompareValue, dword aTimeout); // form 1
      long TestWaitForSignalMatch (sysvar aSysVar, float aCompareValue, dword aTimeout); // form 3


      I tried like this



      void foo(sysvar aSysvar) {}
      ^


      or this



      void foo(sysvar *aSysvar) {}
      ^


      but I get a parse error at the marked position of the sysvar keyword in both cases.



      I successfully created functions that take a signal argument, but unlike the syntax in the CANoe help I have to use a pointer.
      This works:



      void foo(signal *aSignal) {}


      Obviously the documentation in the help is not correct in this point. It results in a parse error after the signal keyword when I omit the * as shown in the help:



      void bar(signal aSignal) {}
      ^


      So what's the correct syntax for defining a function that takes a sysvar argument? (if possible)



      In case the version matters, I'm currently testing with CANoe 9.0.53(SP1), 9.0.135(SP7) or 10.0.125(SP6).







      vector capl canoe






      share|improve this question









      New contributor




      Bodo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Bodo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited Nov 9 at 13:21





















      New contributor




      Bodo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Nov 8 at 10:40









      Bodo

      32




      32




      New contributor




      Bodo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Bodo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Bodo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          Yes, you can. Just define a bit further your sysvar type, not just sysvar.




          System variables, with indication of type and *. Possible types:
          Data, Int, Float, String, IntArray, and FloatArray. Example
          declaration: sysvarFloat * sv




          You didn't specify the CANoe SP version, so it may not be supported in older versions, but to make sure of this, search for Function parameter in Help/Index, then you should get the full list of possible function parameters you can use in your current CANoe setup. Should start like this:




          • Integers (byte, word, dword, int, long, qword, int64) Example
            declaration: long 1

          • Integers (byte, word, dword, int, long, qword, int64) Example
            declaration: long 1

          • Individual characters (char) Example declaration: char ch

          • Enums Example declaration: enum Colors c

          • Associative fields Example declaration: int m[float]. Associative
            fields are transferred as reference automatically.


          .............




          • System variables, with indication of type and *. Possible types:
            Data, Int, Float, String, IntArray, and FloatArray. Example
            declaration: sysvarFloat * sv






          share|improve this answer





















          • Thank you. I added the exact version numbers to my original question. I successfully compiled a sample function using sysvarFloat* in CANoe 9.0.53(SP1).
            – Bodo
            Nov 9 at 13:22













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Bodo is a new contributor. Be nice, and check out our Code of Conduct.










           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206007%2fhow-to-define-a-capl-function-taking-a-sysvar-argument%23new-answer', 'question_page');
          }
          );

          Post as a guest
































          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote



          accepted










          Yes, you can. Just define a bit further your sysvar type, not just sysvar.




          System variables, with indication of type and *. Possible types:
          Data, Int, Float, String, IntArray, and FloatArray. Example
          declaration: sysvarFloat * sv




          You didn't specify the CANoe SP version, so it may not be supported in older versions, but to make sure of this, search for Function parameter in Help/Index, then you should get the full list of possible function parameters you can use in your current CANoe setup. Should start like this:




          • Integers (byte, word, dword, int, long, qword, int64) Example
            declaration: long 1

          • Integers (byte, word, dword, int, long, qword, int64) Example
            declaration: long 1

          • Individual characters (char) Example declaration: char ch

          • Enums Example declaration: enum Colors c

          • Associative fields Example declaration: int m[float]. Associative
            fields are transferred as reference automatically.


          .............




          • System variables, with indication of type and *. Possible types:
            Data, Int, Float, String, IntArray, and FloatArray. Example
            declaration: sysvarFloat * sv






          share|improve this answer





















          • Thank you. I added the exact version numbers to my original question. I successfully compiled a sample function using sysvarFloat* in CANoe 9.0.53(SP1).
            – Bodo
            Nov 9 at 13:22

















          up vote
          0
          down vote



          accepted










          Yes, you can. Just define a bit further your sysvar type, not just sysvar.




          System variables, with indication of type and *. Possible types:
          Data, Int, Float, String, IntArray, and FloatArray. Example
          declaration: sysvarFloat * sv




          You didn't specify the CANoe SP version, so it may not be supported in older versions, but to make sure of this, search for Function parameter in Help/Index, then you should get the full list of possible function parameters you can use in your current CANoe setup. Should start like this:




          • Integers (byte, word, dword, int, long, qword, int64) Example
            declaration: long 1

          • Integers (byte, word, dword, int, long, qword, int64) Example
            declaration: long 1

          • Individual characters (char) Example declaration: char ch

          • Enums Example declaration: enum Colors c

          • Associative fields Example declaration: int m[float]. Associative
            fields are transferred as reference automatically.


          .............




          • System variables, with indication of type and *. Possible types:
            Data, Int, Float, String, IntArray, and FloatArray. Example
            declaration: sysvarFloat * sv






          share|improve this answer





















          • Thank you. I added the exact version numbers to my original question. I successfully compiled a sample function using sysvarFloat* in CANoe 9.0.53(SP1).
            – Bodo
            Nov 9 at 13:22















          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          Yes, you can. Just define a bit further your sysvar type, not just sysvar.




          System variables, with indication of type and *. Possible types:
          Data, Int, Float, String, IntArray, and FloatArray. Example
          declaration: sysvarFloat * sv




          You didn't specify the CANoe SP version, so it may not be supported in older versions, but to make sure of this, search for Function parameter in Help/Index, then you should get the full list of possible function parameters you can use in your current CANoe setup. Should start like this:




          • Integers (byte, word, dword, int, long, qword, int64) Example
            declaration: long 1

          • Integers (byte, word, dword, int, long, qword, int64) Example
            declaration: long 1

          • Individual characters (char) Example declaration: char ch

          • Enums Example declaration: enum Colors c

          • Associative fields Example declaration: int m[float]. Associative
            fields are transferred as reference automatically.


          .............




          • System variables, with indication of type and *. Possible types:
            Data, Int, Float, String, IntArray, and FloatArray. Example
            declaration: sysvarFloat * sv






          share|improve this answer












          Yes, you can. Just define a bit further your sysvar type, not just sysvar.




          System variables, with indication of type and *. Possible types:
          Data, Int, Float, String, IntArray, and FloatArray. Example
          declaration: sysvarFloat * sv




          You didn't specify the CANoe SP version, so it may not be supported in older versions, but to make sure of this, search for Function parameter in Help/Index, then you should get the full list of possible function parameters you can use in your current CANoe setup. Should start like this:




          • Integers (byte, word, dword, int, long, qword, int64) Example
            declaration: long 1

          • Integers (byte, word, dword, int, long, qword, int64) Example
            declaration: long 1

          • Individual characters (char) Example declaration: char ch

          • Enums Example declaration: enum Colors c

          • Associative fields Example declaration: int m[float]. Associative
            fields are transferred as reference automatically.


          .............




          • System variables, with indication of type and *. Possible types:
            Data, Int, Float, String, IntArray, and FloatArray. Example
            declaration: sysvarFloat * sv







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 9 at 7:42









          VioletVynil

          9217




          9217












          • Thank you. I added the exact version numbers to my original question. I successfully compiled a sample function using sysvarFloat* in CANoe 9.0.53(SP1).
            – Bodo
            Nov 9 at 13:22




















          • Thank you. I added the exact version numbers to my original question. I successfully compiled a sample function using sysvarFloat* in CANoe 9.0.53(SP1).
            – Bodo
            Nov 9 at 13:22


















          Thank you. I added the exact version numbers to my original question. I successfully compiled a sample function using sysvarFloat* in CANoe 9.0.53(SP1).
          – Bodo
          Nov 9 at 13:22






          Thank you. I added the exact version numbers to my original question. I successfully compiled a sample function using sysvarFloat* in CANoe 9.0.53(SP1).
          – Bodo
          Nov 9 at 13:22












          Bodo is a new contributor. Be nice, and check out our Code of Conduct.










           

          draft saved


          draft discarded


















          Bodo is a new contributor. Be nice, and check out our Code of Conduct.













          Bodo is a new contributor. Be nice, and check out our Code of Conduct.












          Bodo is a new contributor. Be nice, and check out our Code of Conduct.















           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206007%2fhow-to-define-a-capl-function-taking-a-sysvar-argument%23new-answer', 'question_page');
          }
          );

          Post as a guest




















































































          Popular posts from this blog

          Schultheiß

          Verwaltungsgliederung Dänemarks

          Liste der Kulturdenkmale in Wilsdruff