Running a Blf file in constant Loop for Emulation using CAPL - can-bus

I want to run a .blf file using the Replay Block in CANalyzer . I want to run this file in a constant loop for emulation purpose. Is it possible using CAPL or can some one instruct me how to do this even without CAPL.

You don't need CAPL to replay a log file in a loop.
Right click the Replay block
In the "General" tab, enable "Repetitive output sending mode"

Related

How to automize an UDS command by a CAPL script

For test automatization in my current project it is necessary to automize the sending of UDS commands with a simple CAPL script inside of CANoe. The possible UDS commands are given by a ODX file.
How can I write and execute such a CAPL script and how can I transform the UDS commands inside of the ODX file to the CAPL script.
I'm relatively new here in the automotive sector, so that my question might by a bit unspecific. Can someone give assistance and suggest some further readings.
I would recommend you to configure the Diagnostics Console, using the Diagnostic/ISO TP Configuration. Provide it with a Diagnostic Description file, as well as a DLL containing the keys needed to enter the different sessions on the ECU.
After you have succesfully set default values, such as timing and ID messages for the requests and responses of the ECU, you can call the Diagnostic Services through the Diagnostic Console and CAPL.

Is there any way to get data from logitech lua log console?

I'm doing some code for my logitech mouse with lua but I can't find any way to communicate with my pc at all. No lib available here so I can't even send smth to cmd, write file, launch .bat and etc. At least I wasn't successful at this.
The only place where you can output some info is the log window. So the title asks main problem of this topic: Is there any way to get data from logitech lua log console?
To run a .bat file from LGS Lua script:
Create a shortcut action
Run 'Logitech Gaming Software' application
Open 'Customise buttons' tab
Select profile
In the left side you will see the 'Commands' pane (list of bindable actions such as keyboard keys, macros, etc), press the big 'plus' sign to add new command.
In the 'Command Editor', select the 'Shortcut' in the left pane
Set the 1st text field 'Name' to RUN_BAT_FILE
Set the 2nd text field 'Enter a shortcut' to your_bat_file.bat
Set the 3rd text field 'Working Directory' to C:\Path\to\folder
Press 'OK' button to close the 'Command Editor'
Now you can:
either bind this action to a mouse button (drag-n-drop action RUN_BAT_FILE from Commands pane to the big picture of the mouse)
or invoke this action from your LGS Lua script by PlayMacro("RUN_BAT_FILE")
Please note that console window will be brought to the front, and your game will switch off fullscreen mode and will lose keyboard focus.
That is a very nasty thing while you're playing.
But you can invoke windowless applications without interfering the game.
To pass a long message from LGS Lua script to external program:
You can send strings by invoking OutputDebugMessage in your LGS script
and receive them in your external program by means of LGS Debug Interceptor.dll.
To pass information from your external program to your LGS Lua script:
The best way I'm aware of is the following:
Your external program can create a .lua-file and your LGS Lua script can execute it and receive the result (a tuple of Lua values returned by this script)
data = dofile[[c:\some_script.lua]]

Love2d console on PyCharm only writes to console after closing

I'm using PyCharm community edition to create a love2d application. I've created a hotkey that runs a .bat file to run it with lovec.exe which is opens the console as the app runs, then i've created an external tool to run the .batfile through a keyboard shortcut, when i use it, the console opens within PyCharm, which doesn't write anything, and after closing the app, everything that was meant to have been written appears, when i run the .bat file outside of PyCharm it functions perfectly.
I would like to know if there's either an obvious fix to that or, just how to run the console outside of pycharm through an external tool.
This issue is due to the way Lua delays writing files, known as "buffering." To change it, put the following command at the top of your file:
io.stdout:setvbuf( 'no' ) -- Switches buffering for stdout to be off
Read more in Lua's manual:
file:setvbuf (mode [, size])
Sets the buffering mode for an output file. There are three available modes:
"no": no buffering; the result of any output operation appears immediately.
"full": full buffering; output operation is performed only when the buffer is full or when you explicitly flush the file (see io.flush).
"line": line buffering; output is buffered until a newline is output or there is any input from some special files (such as a terminal device).
For the last two cases, size specifies the size of the buffer, in bytes. The default is an appropriate size.

How to integrate CANOE with Jenkins?

I want to integrate CANOE with Jenkins. Can anybody please tell me how to do that. For now I am able to open CANOE window through Jenkins. But it shows a disclaimer on startup. I want to click on "I accept" button automatically through Jenkins using any command. Can you please tell me how to do that or what is that command?. Is there any other way to click on that button without pressing the key?
CANoe is implemented as a COM-server. Using the COM-interface, you can start CANoe from a script and thus bypass the disclaimer. I have managed to do this either using C# or python with pywin32. The CANoe help-section contains some help on what COM-server commands are available to get you started.
edit:
If CANoe is associated with cfg-files as standard application, you can call the cfg-file directly and have it launch CANoe. That will still require you to manually click the disclaimer dialog though. In a script, such as the one I mentioned earlier, you can create it in such a way that you are able to specify which cfg-file to use as an input parameter. It can also be written so that you can specify certain test-suites containing your CAPL-scripts. It can basically give you access to most CANoe features necessary to run test-suites with different settings. However, I've not tried a lot of them yet.
Unfortunately, none of your examples can be achieved without creating this kind of script.
CANOE simply loads a .cfg configuration file. For jenkins, I am using the Visual Basics script and same triggering into the Jenkins job.
In this was it bypasses the "I accept" and other windows and loads the desired configuration also also using same kind of VB scirpt you can close the application.
'ToStart CANoe_Start.vbs
Set App = CreateObject("CANoe.Application")
dim fso: set fso = CreateObject("Scripting.FileSystemObject")
dim CANoe_config
CANoe_config = fso.BuildPath(fso.GetAbsolutePathName("."), "<target.cfg>")
App.Measurement.Start()
After that you can add the operations in jenkins jobs; to close the same appilcation use :
'ToStop CANoe_Stop.vbs
Set App = CreateObject("CANoe.Application")
App.Quit()
This worked for me. You can call the vbs's over jenkins jobs.

How can I stop executing .wlua files?

Is it possible to force stop a .wlua file? I figured that I would have to use the Lua Command Line to do this, but I can't seem to find out how to stop them.
If it's possible, how can it be done?
Because wlua.exe doesn't open the console window (that's the purpose) and you can't send Ctrl-C, the only way to terminate such application is to use Processes window in Task Manager. Note, however, that the process name will be wlua.exe for every file opened that way.
Of course, it's meant only to be used when the application isn't responding. Your GUI application should provide a way to close it, such as close button, listening for ESC key etc.

Resources