<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Typhoon HIL Forum - Recent questions in Test Automation</title>
<link>https://typhoon-hil.com/forum/?qa=questions/test-automation</link>
<description>Powered by Question2Answer</description>
<item>
<title>KeyError: &#039;time_data_type&#039; in stub.py when stop_capture() is called</title>
<link>https://typhoon-hil.com/forum/?qa=432/keyerror-time_data_type-in-stub-when-stop_capture-called</link>
<description>Hi all,&lt;br /&gt;
&lt;br /&gt;
I am going to use the start_capture() and stop_capture() functions from the Typhoon HIL API 1.30.0 and Typhoon Control Center 2023.3. Based on the code examples from documentation I prepared a small test to verify if it works as expected and got the following error:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def recv_time_data(socket, flags=0, copy=False, track=True):&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;&amp;quot;&amp;quot;recv a numpy array or a dict with a numpy array and scalars&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# first receive a metadata as json&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;md = socket.recv_json(flags=flags)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print(md)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# time data are sent as dictionary&lt;br /&gt;
&lt;br /&gt;
&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if md[&amp;quot;time_data_type&amp;quot;] == &amp;quot;dict&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^^^^^^^^^^^^^^^^^^^^&lt;br /&gt;
&lt;br /&gt;
E &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;KeyError: &amp;#039;time_data_type&amp;#039;&lt;br /&gt;
&lt;br /&gt;
.venv\Lib\site-packages\typhoon\api\hil\stub.py:56: KeyError&lt;br /&gt;
&lt;br /&gt;
I printed the md structure and it shows the following data:&lt;br /&gt;
&lt;br /&gt;
[WARNING] [CAPTURE MESSAGE] stop_capture() will be ignored since desired number of samples are already captured!&lt;br /&gt;
&lt;br /&gt;
{&amp;#039;dtype&amp;#039;: &amp;#039;float64&amp;#039;, &amp;#039;shape&amp;#039;: [100000]}&lt;br /&gt;
&lt;br /&gt;
so it is right that the key &amp;nbsp;&amp;quot;time_data_type&amp;quot; does not exist.&lt;br /&gt;
&lt;br /&gt;
Is this a bug in the HiL API or incompability issue?&lt;br /&gt;
&lt;br /&gt;
After replacing the key: &amp;#039;time_data_type&amp;#039; with &amp;#039;dtype&amp;#039; it works as expected.&lt;br /&gt;
&lt;br /&gt;
The code snipped I used for testing:&lt;br /&gt;
&lt;br /&gt;
def test_typhoon_recorder():&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;import typhoon.api.hil as typhoon_hil&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;import time&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trigger_settings = [&amp;quot;Forced&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timeout = 2&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;capture_settings = [10, 2, 1e5]&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;channel_settings = [[&amp;quot;TestOC.IaOCTest&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;quot;TestOC.IcOCTest&amp;quot;], []]&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;buffer = []&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;typhoon_hil.set_text_mode(typhoon_hil.RM_SYSTEM)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;typhoon_hil.load_model(MODEL_NAME)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;typhoon_hil.load_settings_file(RUNX_SETTINGS)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;typhoon_hil.start_simulation()&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;typhoon_hil.start_capture(&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;capture_settings,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trigger_settings,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;channel_settings,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dataBuffer=buffer,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timeout=timeout,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;typhoon_hil.stop_capture()&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print(buffer)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;typhoon_hil.stop_simulation()</description>
<category>Test Automation</category>
<guid isPermaLink="true">https://typhoon-hil.com/forum/?qa=432/keyerror-time_data_type-in-stub-when-stop_capture-called</guid>
<pubDate>Wed, 30 Jul 2025 08:23:45 +0000</pubDate>
</item>
<item>
<title>Does the THIL API support setting a fixed circular buffer size (FIFO overwrite) for captures?</title>
<link>https://typhoon-hil.com/forum/?qa=376/support-setting-fixed-circular-buffer-overwrite-captures</link>
<description>&lt;p&gt;Our capture system needs to:&lt;/p&gt;&lt;ol start=&quot;1&quot;&gt;&lt;li&gt;&lt;p&gt;Limit memory to ~50MB&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Automatically overwrite oldest data when full (circular buffer behavior)&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;Currently uses &lt;code&gt;clstub().start_capture()&lt;/code&gt; with a Python &lt;code&gt;Queue&lt;/code&gt; (pure FIFO)&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;p&gt;&lt;span data-teams=&quot;true&quot;&gt;We need something like&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span data-teams=&quot;true&quot;&gt;# Python API example hil.set_capture_buffer_size(&quot;signal_name&quot;, buffer_size=1000)&amp;nbsp;&amp;nbsp;# 1000 samples&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;</description>
<category>Test Automation</category>
<guid isPermaLink="true">https://typhoon-hil.com/forum/?qa=376/support-setting-fixed-circular-buffer-overwrite-captures</guid>
<pubDate>Thu, 03 Apr 2025 12:37:26 +0000</pubDate>
</item>
<item>
<title>I keep getting exceptional errors, how do I solve this?</title>
<link>https://typhoon-hil.com/forum/?qa=351/i-keep-getting-exceptional-errors-how-do-i-solve-this</link>
<description></description>
<category>Test Automation</category>
<guid isPermaLink="true">https://typhoon-hil.com/forum/?qa=351/i-keep-getting-exceptional-errors-how-do-i-solve-this</guid>
<pubDate>Wed, 19 Feb 2025 09:19:58 +0000</pubDate>
</item>
<item>
<title>Missing SchematicAPI get_model_init_code method</title>
<link>https://typhoon-hil.com/forum/?qa=349/missing-schematicapi-get_model_init_code-method</link>
<description>Zdravo, kako ste? :)&lt;br /&gt;
&lt;br /&gt;
I have been trying to parametrize some of the variables defined in the model&amp;#039;s initialization script for the purpose of testing.&lt;br /&gt;
&lt;br /&gt;
I have found set_model_init_code exists, while getter method is missing in the Typhoon HIL Control Center 2020.3 API.&lt;br /&gt;
&lt;br /&gt;
How should I then go about executing the following operation sequence?&lt;br /&gt;
- Get current value of the variable in the model initialization script&lt;br /&gt;
- Update the value&lt;br /&gt;
- Set variable value&lt;br /&gt;
- Compile the model and execute tests&lt;br /&gt;
&lt;br /&gt;
Best,&lt;br /&gt;
Radovan</description>
<category>Test Automation</category>
<guid isPermaLink="true">https://typhoon-hil.com/forum/?qa=349/missing-schematicapi-get_model_init_code-method</guid>
<pubDate>Tue, 18 Feb 2025 13:14:56 +0000</pubDate>
</item>
<item>
<title>How to import plot from Matplotlib into PDF report in Typhoon Test IDE</title>
<link>https://typhoon-hil.com/forum/?qa=335/how-import-plot-from-matplotlib-into-pdf-report-typhoon-test</link>
<description>Hi everybody,&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ve created a test script in Typhoon Test IDE and created some plots with the matplotlib library. I exported them and stored them as a .png. &lt;br /&gt;
&lt;br /&gt;
Can I import this .png into the automatic generated PDF Report ? &lt;br /&gt;
&lt;br /&gt;
I already figured out how to import them into allure but not in the PDF.&lt;br /&gt;
&lt;br /&gt;
Thanks!</description>
<category>Test Automation</category>
<guid isPermaLink="true">https://typhoon-hil.com/forum/?qa=335/how-import-plot-from-matplotlib-into-pdf-report-typhoon-test</guid>
<pubDate>Mon, 10 Feb 2025 12:55:22 +0000</pubDate>
</item>
<item>
<title>Typhoon Schematic (or any) API solution for multiple devices connected to the PC</title>
<link>https://typhoon-hil.com/forum/?qa=237/typhoon-schematic-any-solution-multiple-devices-connected</link>
<description>&lt;p&gt;Hi!&lt;br&gt;&lt;br&gt;Been pondering on this issue for some time now with our automated software team.&lt;br&gt;Our setup has both HIL600 and HIL606 connected.&lt;br&gt;Most of the automated tests are using models dedicated to HIL606, but some are developed for HIL600. Both v2020.3 (supporting HIL600) and v2024.1 (supporting HIL606) Typhoon HIL Control Center pieces of software work as intended and detect respective HILs in Device manager.&lt;br&gt;We haven&#039;t been able to utilize API for HIL600. The problem with&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color:#dcdcaa&quot;&gt;detect_hw_settings&lt;/span&gt;()&lt;/p&gt;&lt;p&gt;method is that it always returns&lt;br&gt;&lt;br&gt;&amp;nbsp; Hardware settings: [&#039;HIL606&#039;, 3, 1]&lt;br&gt;&lt;br&gt;and so the automated script only connects to the HIL606.&lt;br&gt;Do you have any other approach in connecting to HIL device defined within v2020.3&#039;s integrated API version?&lt;br&gt;&lt;br&gt;Thanks!&lt;/p&gt;</description>
<category>Test Automation</category>
<guid isPermaLink="true">https://typhoon-hil.com/forum/?qa=237/typhoon-schematic-any-solution-multiple-devices-connected</guid>
<pubDate>Tue, 19 Nov 2024 19:21:14 +0000</pubDate>
</item>
<item>
<title>Assistance Required for Integrating Reinforcement Learning Model with Typhoon HIL</title>
<link>https://typhoon-hil.com/forum/?qa=177/assistance-required-integrating-reinforcement-learning</link>
<description>&lt;p&gt;&lt;span style=&quot;font-family:&amp;quot;Times New Roman&amp;quot;; font-size:14px&quot;&gt;I&#039;m currently working on a project that aims to replace conventional LVRT mechanisms using reinforcement learning. I have successfully developed the reinforcement learning environment using Python to simulate LVRT. However, I am facing challenges in integrating this RL model with the simulation environment in Typhoon HIL. As far as I understand, the custom block in Typhoon requires code in C, whereas reinforcement learning models are typically implemented in Python. I am seeking your guidance on how I can integrate the machine learning/reinforcement learning model into the Typhoon HIL simulation environment, given this constraint. Your assistance would be greatly appreciated.&lt;/span&gt;&lt;/p&gt;</description>
<category>Test Automation</category>
<guid isPermaLink="true">https://typhoon-hil.com/forum/?qa=177/assistance-required-integrating-reinforcement-learning</guid>
<pubDate>Thu, 24 Oct 2024 16:27:30 +0000</pubDate>
</item>
</channel>
</rss>