The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
Hi all,
I wanna run some script in my already opened HM session. Is there any way we can access the HM session and execute the tcl script?
NOTE: I have the HM Session PID where I wanna run the script
Regards
Saumya
Yes, your hm session must work as a server. Use dde or socket command
hi tinh
can you kindly explain through an example?
Refer above.
In your case, this way may be simpler:
Your hm session (eg. with pid 1234) must pre-run a timer (write it in c:/users/name/hmcustom.tcl)
That timer checks a file eg. 1234.tcl
If file existing, source it, then clear the file!
So everytime you want to excute a script, put it in 1234.tcl
A such timer:
proc ::p_MonitorFile {{path {}}} {
set path_ $path
after cancel [list ::p_MonitorFile $path_]
if {$path==''} {
set path [file join $::env(HOME) [pid].tcl]
}
if {[file exists $path]} {
catch {source $path} err
file delete $path
puts 'Executed $path got $err'
after 3000 [list ::p_MonitorFile $path_]
hi tin
That works . Thanks for the help
Join us for a community conversation on Pulse Width Modulation (PWM), a fundamental technique in electric motor control, and explore how different PWM strategies can yield significantly different results. This webinar provides a comparative analysis of various PWM methods and their effects on motor efficiency, torque…
Join us for a community conversation to discover the Advanced Iterative Solver(AIS) in Simcenter Feko and its application to electrically large and computationally demanding electromagnetic models. The session will provide a general overview of how iterative solution methods can help improve efficiency of large scale…
Join us for a community conversation on how High-Performance Computing (HPC) and Simcenter PSIM work together to meet the increasing demands of modern power electronics simulation. During this one-hour technical session, you'll discover how leveraging HPC can speed up simulations, improve scalability, and empower engineers…