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).
vector capl canoe
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.
add a comment |
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).
vector capl canoe
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.
add a comment |
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).
vector capl canoe
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
vector capl canoe
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.
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.
add a comment |
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Bodo is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password