caplcanoecanalyzer

CAPL- Get value of string defined sysvar


i defined a sysvar as a string in CANalyzer to use it with a panel. Then in a CAPL a would like to get the value of this variable and save the name,i tried as i usually do in CAPL with the numbers so: write("%s",@namespace::name_of_variable) But i got an error saying tha the '@' should be used only for integer or float variables. How can i get the value of this string and save it in a local variable to reused it in a CAPL? Thanks in advice.


Solution

  • The CAPL function you are looking for is sysGetVariableString

    Usage is as follows:

    char value[100]; //has to be big enough to hold the value
    
    sysGetVariableString(sysvar::namespace::name_of_variable, value, elcount(value));