- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there
I am attempting to call a console executable file from a tcl script that should run before every compile. Here are a few iterations that I have tried, but nothing seems to make the tcl script run the executable: exec ConsoleApp.exe qexec ConsoleApp.exe exec BatchToRunConsoleApp.bat qexec BatchToRunConsoleApp.bat I am pretty desperate. I made the mistake of assuming that it would not be difficult to run an application from a tcl script and now I cannot seem to do it. Please help. Regards, Stu84Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
this works here:
qexec ipconfig
qexec quartus
also:
set cmd "qmegawiz -silent OPTIONAL_FILES=NONE ${file_name}"
post_message "cmd: ${cmd}"
if { } {
post_message -type error "couldn't run $cmd"
} else {
post_message -type info
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"qexec" is the command you should be using, and it works fine. You will need to supply more information about what doesn't work. Do you need to specify the path to the executable, or make sure your PATH includes a .dll it depends on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Hi, this works here:
qexec ipconfig
qexec quartus
also:
set cmd "qmegawiz -silent OPTIONAL_FILES=NONE ${file_name}"
post_message "cmd: ${cmd}"
if { } {
post_message -type error "couldn't run $cmd"
} else {
post_message -type info
}
--- Quote End --- Hi there DUESTERBERG I tried your code snippets, and much like mine, they appear to do absolutely nothing. It says in themessage window that the tcl script executed successfully, but no windows consoles execute or appear. Is it poosible that there is something else that I am missing? Thank you for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You'll get the results you describe if your executable doesn't produce any output to STDOUT.
Your script snippet works fine here. Changing your cmd variable to instead use Windows cmd.exe to run the "set" command, you get your environment dumped into Quartus messages.
set cmd "cmd /c set"
post_message "cmd: ${cmd}"
if { } {
post_message -type error "couldn't run $cmd"
} else {
post_message -type info "Command \"$cmd\" successful."
post_message -type info
}
If something basic as this doesn't work for you, not sure what next? Reinstall? If this works, then there's a problem with your .exe, or there is a problem executing your .exe from a script like this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- You'll get the results you describe if your executable doesn't produce any output to STDOUT. Your script snippet works fine here. Changing your cmd variable to instead use Windows cmd.exe to run the "set" command, you get your environment dumped into Quartus messages.
set cmd "cmd /c set"
post_message "cmd: ${cmd}"
if { } {
post_message -type error "couldn't run $cmd"
} else {
post_message -type info "Command \"$cmd\" successful."
post_message -type info
}
If something basic as this doesn't work for you, not sure what next? Reinstall? If this works, then there's a problem with your .exe, or there is a problem executing your .exe from a script like this. --- Quote End --- Thanks ted. I appreciate all the help everyone. After playing around some more, I found my problem: The tcl file runs in the project root directory and therefore saves the files there. When I run my app independently, the files are saved in the same directory as the app, hence the reason for my confusion. The code that uses "open" as described above does work, I still seem to be having some issues with qexec and exec, but this does not hinder my progress. Thanks again.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page