How to reset all environment varible (In DBC) from 1 button (using panel) in CANoe - panel

I working in Canoe software and i try to reset my all environment variable , which is present in DBC(Database) and i create a button using panel in canoe software.
and try to insert this panel in one network node in configuration but i don't know how to insert this panel and how to reset my all environment variable using function in CAPL programming.
Please give me some suggestions.
Thank you .

There is no specific function to reset all envVars (or sysvars to that matter) to default values in CAPL.
You have only the Reset Now button in CANoe Options.
The only solution I see:
You open/create the panel in Panel Designer. You create the button through Toolbox, link it to the Sysvar specifically used for resetting envVars (in the buttons properties). You can create that sysvar in CANoe\Environment\System Variables.
Then, you create an on event trigger on that sysvar in a Simulation Node you choose (must be Active Simulation node).
on sysvar SYSVARName_YouCreated
{
putValue(EnvVar1, 0);
putValue(EnvVar2, 0);
putValue(EnvVar3, 0);
}
Hard code the setting of EnvVars to initial value by hand (brute, but will do the work).

Related

createGlobalMarker() doesn't create a marker in Vector CANoe in Offline Mode

I wrote a basic CAPL program and included it as programming node in a CANoe measurement configuration.
The node will check the content of a specific message and create a Global Marker via createGlobalMarker() if the conditions are met. A write() statement ensures that the code portion is being executed. The CANoe configuration is being used in offline mode (I don't have a licence on this machine, no vector nodes are attached, I just want to replay stuff and check it out).
In the graphics window, no marker is created. No warnings are present in the write window. Here is the code mockup:
on linframe myFrame
{
output(this)
if( /* some condition */ )
{
write("code being executed");
createGlobalMarker("A","test"); // in actual code, the name is dynamic to avoid forbidden name duplicates
}
}
From the docs,
Sets a marker in CANoe Trace Window, Graphics Window and State
Tracker. The set marker can be displayed with the shortcut menu Show
in the marker bar of these windows.
So I would naturally expect to see the markers. I can create one manually from the Graphics window, and that one is displayed. I can't find the shortcut menu being referred to.
The marker bar is visible in the Graphics window and I can create a new marker by double-clicking on it.
The markers are added whenever the function createGlobalMarker() is triggered.
To view the markers in the Trace Window, it has to be in chronological mode.
Now, to view the marker created by your code, you have to right-click on the marker area (grey bar) to bring up the shortcut menu and select "Show > A" or "Show All". This will show the markers which your code has generated (with a lock symbol in graphics window).

How to send values of Numeric Indicator to Numeric controler in LabVIEW

I need to get the showing value from numeric indicator and then put that value to the numeric controller to show in another numerical indicator in LabVIEW.
Normally we can get the values from numerical control to the numerical indicator.I need the opposite of that.
As shown in picture need a method to get values that show in numerical indicator to the controller.
Use a Property Node (Value), it has the error lines, so it is useful for dataflow control.
You can use a local variable or a property node.
Local Variable
Right click on the control or indicator, from the shortcut menu choose:
create->local variable
Once you've created that local variable you can right click on it and change it to write or read local.
Property Node
Right click on the control or indicator, from the shortcut menu choose:
create->property node->value
You can then right click on the property node and choose 'change to write' or 'change to read'.
Property Node vs Local Variable
Either will work in most cases. Local variables will perform better, providing faster access to the value, similar to that of the control/indicator terminal itself. Property nodes do provide error terminals that allow for taking advantage of data flow and ordering your operations. If you already have a property node in use for that control/indicator, adding a value terminal may not impact performance, otherwise use a local, if you need to control order of operations use a flat sequence structure and pass your error cluster through the structure.

Select Alias isn't changing to the proper alias

I have a combo box in a grid. The form has a lot of tables (opened in init and assigned aliases). The grid has property
LinkMaster=EVENT
RecordSource is set to HEAT
The column in the grid has controlSource set to Heat.Event_no and the current control is CmbEvent. The CmbEvent control source is set to heat.event_no. Everything works as it should in the grid except...
When I select an item out of the combo box, the following code runs as a procedure called from the Click event:
IF event.relay
SELECT RELAY
GO TOP IN RELAY
SET ORDER TO
GO OrigRelayRec IN RELAY
....
The issue that I am having is that unless I am stepping through the code, the alias() never goes to RELAY. No matter what alias it starts on (usually HEAT), if I put a break point in at GO TOP, the alias() shows up as EVENT. The only way it ever gets to RELAY is if I step through the code.
Any thoughts on why Select alias isn't actually selecting the alias?
Usually in cases like this I set the focus to a control other than the grid. The problem is since the grid has focus it will always keep the alias selected that's bound to the grids RecordSource.
So right before your SELECT you can do something like "Thisform.cmdOK.SetFocus()" (it can be any control on your form other than the grid). That should do the trick.

How to add a window to a specific node in Write window of CANoe

How can I a write window to a specific node in CANoe configuration? I can see a write window for node SSC EV but I wanted to add another one more for a node.
first of all take a look in CANoe manual
CANoe» Analysis Windows » Write Window
here you will find important note about limitations for lines in Write-Window.
Thereafter you can find short explanation about standard pages in Write-Window here:
Write Window » Views
There is also a link to CAPL function writeCreate() which can be used to create new page. The return value of this function shall be used as parameter for function writeConfigure() to write onto created page. See also example for this functions in help.

Setting Virtual Key/MouseButton State Without Triggering Events

Is it possible to set the virtual key state / mouse button state for all programs on a computer without triggering the associated events at the same time (like setting the left mouse button to be currently pressed without sending a mouse down event). Could this be achieved by setting up a fake keyboard or mouse driver for a fake keyboard or mouse that when queried as to the current state of a key would reply giving an answer of your choice or by any other means?
Edit:
This has to affect programs that I do not have the code for running in other threads ect...
Well, I don't have a complete answer for you but...
The Win32 function SetKeyboard State() changes the state of the keyboard for the thread that called it.
I know this does not affect the entire system, but if you only need the keyboard state changed for applications you are developing, then this could be called by each program, reading in the array passed to it from a temporary file on the harddrive.
Otherwise... don't know of anything else offhand...

Resources