Forum Discussion
Altera_Forum
Honored Contributor
14 years agoHi,
--- Quote Start --- Jeff and I appreciate your suggestions for interfacing LabVIEW to the System Console. Per your suggestion, I've started down the path of implementing a Tcl server application within the System Console using Tcl's standard networking functions. I've noticed that the "fileevent" Tcl command, which is commonly used for receiving socket data on an event-driven basis, doesn't seem to be recognized by the System Console's interpreter. In your experience, does System Console only support a subset of the standard Tcl commands? We were looking for documentation on which standard commands were supported, but had no luck. Thanks. --- Quote End --- I've noticed that Altera has managed to screw up the System Console Tcl interpreter in other ways too ... Here's a snippet of code I use to detect the Tcl shell type# Tool (wish shell) detection
set toolname ]
if { == 0} {
# Toolname starts with 'wish'
set tool wish
} elseif { == 0} {
# Modelsim starts vish.exe
# (alternatively argv0 ends in vsim)
set tool modelsim
} elseif { == 0} {
# Quartus also has a global called quartus
# that can be detected using .
set tool quartus
# Quartus shells need to initialize Tk
init_tk
} else {
error "Tcl/tk tool detection failed!"
}
Start 'quartus_stp -s' and
tcl> info nameofexecutable
C:/software/altera/10.1/quartus/bin/quartus_stp.exe
tcl>
The above code snippet allows the display of Tk GUI elements when using quartus_stp, or the main Quartus GUI. However, I tried this in SystemConsole (Quartus v10.1) and the result of 'info nameofexecutable' is an empty string! On top of that, the TK widgets don't work (try typing tk_init, or help misc)! I get the impression that at Altera there are two different software development groups, and neither has bothered to talk to the other to ensure compatibility between tools. So, my recommendation is to use SystemConsole with caution (I know, I recommended looking at it ... sorry, I was too optimistic). The quartus_stp tool is reliable, but I'm not sure that the SystemConsole commands work there. They can be made to work, its just that I'm not sure that Altera provides a package with the Tcl commands. The majority of USB interfaces I have built up until now have used the Virtual JTAG interface, and I control that via quartus_stp. All is not lost. I've figured out how to communicate with the USB-Blaster directly from C/C++ code. In the next week or so, I'll finish documenting how to do this, and then I was going to put together a DLL that could be accessed from LabView code. This documentation would include HDL code for USB-to-Avalon-MM masters, so you can replace the components and Tcl interfaces provided by SystemConsole, with something you are free to change. You're welcome to be a guinea pig for that code :) Cheers, Dave