How to create new environment variable for CAN database in CANoe for CAPL and Panels? - capl

I am new to CAPL and CANoe.
I want to access some particular signals from CAN database.
I am able to create new system variables for Panel designing, but for some specific scenario, I want to use CAN signals directly as environmental variables.
I am unable to add new environment variables in the database, could anyone help me?

I want to access some particular signals from CAN database.
You can do this easily from a CAPL script or a Panel. In CAPL script, start typing the name of the signal, or its identifier. If you set up a dbc file with that CANoe configuration, you'll have access to auto-complete functions.
From a Panel, select a suitable UI control, then go into properties and see that you can link it to a given signal, provided you set up a dbc for that CANoe configuration.
I am able to create system variables for PANEL designing , but for
some specific scenario , i want to use CAN signals directly as
environmental variable .
You can create System Variables, but are not interested in them. You want to use CAN signals as Environment variables.
CAN signals are meant to be physical signals transmitted over a bus (CAN, LIN etc..). Environment Variables are digital signals living in the CANoe simulation. They will never be transmitted over a bus. On a side note, you can map a signal over a variable using the Environment > Signal Mapping function of CANoe, from the ribbon.
I am unable to add database in environmetal variable
Many pages of the help are referring to env vars being usable only if they were added to the Database, but then again via the CANoe Ribbon there is no way of adding new Environment Variables, and this is were you are confused.
To set new Environment Variables, you'll need CANdb++. To see existing Environment Variables, go View > List > Environment Variables. From here, you can add new env vars to the database.
Env Vars are typically used as interface between network nodes and specifically in panels as handles.

More details at : https://support.vector.com/kb?id=kb_article_view&sysparm_article=KB0012412&sys_kb_id=e63502681b2614148e9a535c2e4bcbb1&spa=1
Starting from CANoe and CANalyzer 12 no more new Environment Variables can be created in CANdb++ Editor.
Since CANoe/CANalyzer 7.0 System Variables are supported as a successor of Environment Variables for configurations in CANoe and CANalyzer.
It is still possible to use existing configurations and database files which contain Environment Variables. But it is recommended to use System Variables instead.

As per the vector documentation Environment variables can not be created from the version 12 but can be if there are already created variables. Environment variables are replaced by system variables. But still we have back door to create one. video in the following link
https://www.youtube.com/watch?v=Jhoj2f-XQ18
gives more details about how to create ev variables in CANoe version above 12, But it is good to migrate to system variables, because vector can stop supporting ev variable at any point of time.

Related

Teamcity default system properties not set

In my gradle script I try to use the default system properties. The documentation tells me that teamcity.buildType.id and teamcity.build.id is only set in the system properties an not as environment variables, so my only way is to access them via System.getProperty("%system.teamcity.buildType.id%"). But it tells me it is not defined.
I tried to reference to %system.teamcity.buildType.id% via my own environment variable but it tells me this Parameter "env.teamcity.buildType.id=%system.teamcity.buildType.id%" is not fully resolved, using as is.
I also printed out every system and environment variable. It printed a whole list but not any of the default system properties which should be set by teamcity.
How can I access them and why aren't they not set automatically?

jvm.options IBM LIBERTY

I search a lot on the web, almost all links says define JVM custom variables in jvm.options also placed it on ${server.config.dir}/jvm.options.For example I added a variable called -DAPP_ENV=PROD. But this is getting as NULL after server startup.
Any idea?
It looks like you want to define an environment variable, so you have two options.
1. Use an Environment variable
In this case, you can define an environment variable (like $PATH) and load it in your app. Note this is not a JVM argument, and it will be set in the bin/server shell command used to start the server.
In the file:${server.config.dir}/server.env
Add the following line: APP_ENV=PROD
Access the value with:
System.getenv("APP_ENV"); -> PROD
2. Use a System property
This is what you are trying to do, so I am not sure why it doesn't work for you, but here's how:
In the file:${server.config.dir}/jvm.options
Add the following line: -DAPP_ENV=PROD
Access the value with:
System.getProperty("APP_ENV"); -> PROD
Note that in both cases these values are set at server start-up, and they are not changed dynamically (most Liberty configuration is dynamic). The JVM options and environment are sourced and set during the start script so a restart is required if you want to change either one.
My personal recommendation is go to the server.env route - its more generic and (to me) feels more appropriate since you are trying to influence the execution environment of the process, rather than defining behaviors or configuration of the JVM.

How to display IBM BPM snapshot environment variables using wsadmin?

I need to display all existing environment variables for snapshots installed on BPM. Is there a way I can do this using the wsadmin command ?
I don't think we have a wsadmin command to display all existing variables for a snapshot. If this is something that would be useful, I would suggest opening a Request for Enhancement(RFE) with BPM development for their consideration. Here is a link on how to do this:
https://developer.ibm.com/answers/questions/175980/how-do-i-submit-an-enhancement-request-or-rfe-for.html
Thanks!
I agree with Paula, there is no wsadmin cmd to display env variables.
However, you can check out:
BPMSetEnvironmentVariable:
https://www.ibm.com/support/knowledgecenter/SSFPJS_8.5.6/com.ibm.wbpm.ref.doc/topics/rref_bpmsetenvironmentvariable.html
And REST call to get env variable:
https://www.ibm.com/support/knowledgecenter/SSV2LR/com.ibm.wbpm.ref.doc/rest/bpmrest/rest_bpm_wle_v1_system_env_variable_get.htm
This can be achieved by the BPM REST Interface APIs.
Use this API to retrieve the list of process applications, in which you can find the ID of the snapshot you are interested in.
https://<bpm_host_or_ip>:9443/rest/bpm/wle/v1/processApps
Use this API to retrieve the envrionment variables and their default values.
https://<bpm_host_or_ip>:9443/rest/bpm/wle/v1/processAppSettings?snapshotId=2064.11a398d0-c6b8-41e4-b8eb-daaef864be14"
You can easily use jq in a Linux environment to parse out the information you are interested in.
Finally use this API to retrieve the current value of a given environment variable.
https://<bpm_host_or_ip>:9443/rest/bpm/wle/v1/system/env/variable?processAppAcronym=<APP_ACRONYM>&name=<ENV_VAR_NAME>

Clarity on teamcity parameters and its types

I'm trying to understand about variables in teamcity. My understanding is there are 3 kinds of variables(System,Env,Config)
But in jetbrains documentation I saw more variables. Looks like agent variables and server side variables are separate.
But in TeamCity, parameters section when I select "kind" config or system or env, all kinds of values are populated (I Expected only relevant values should come)
Not really clear about when we have to use which variable. Is TeamCity having 6 variables for parameters(Serverside:env,sys,config and Agent:env,sys,config).
There are three types of parameters, they differ in a way they might be used in a build:
env parameters are passed to the build process (spawned by TeamCity) as environment variable
sys parameters set tool-specific variables (and therefore passed to the build scripts of the supported runners)
config parameters are meant to be used for build configuration customization
There're predefined parameters exposing server build properties, agent properties, agent build properties etc. These parameters are passed to the build as system parameters, some of them are also copied to the environment variables.
In addition, parameters might be defined
for a certain build via "Run Custom Build" dialog
in Parameters section of build configuration/project or build configuration/project template
in buildAgent.properties file on the agent
More details might be found in the docs.

Is a race condition possible when updating the environment variable PATH? Is it avoidable?

If two or more applications running on Windows are trying to append a folder name to the environment variable PATH at the same time, is it possible to get a race condition such that one of the values being appended is lost?
What is the standard way to avoid these race conditions?
No, there's no danger of this. Every process has its own environment. So they'll just update their own copy of the PATH environment variable. Such changes are also not persisted and disappear when the process terminates.
Making global changes to the environment requires writing the registry. Otherwise exposed in the System applet in Control Panel. Such changes require a logout + login to be effective for every process.

Resources