Posted on January 14, 2010 by Thor
Yes – this can be done in tool eventhandlers. Modify the endExecute event.
def endExecute(self):
# use self.name to get this tool instance
# Return 1 for OK, 0 for error
t=GetTool(self.name)
t.visible =
(t.getIntValue('Count') >= GetIntValue('Setup.PelletsLimit'))
return 1
The tool visible property is True if the Count is high.
Filed under: Python | Leave a comment »
Posted on January 12, 2010 by berntr
The is a STC – Scorpion Tool Component.
Filed under: Python | Leave a comment »
Posted on December 27, 2009 by Thor
There are numerous examples for using .Net with Scorpion in Scorpion Online Help
Information on how to convert a .Net 1.1 sample to .Net 2.0.
Filed under: Profiles, Python | Leave a comment »
Posted on December 27, 2009 by Thor
.Net with Scorpion opens up Scorpion to the large .Net Framework and the possibility to easily integrate your own .Net object expanding the capabilities of Scorpion Vision Software. The main new features are:
- Add custom status information to Scorpion tab-pages
- Add custom dialog and status windows to Scorpion
- Implement project specific GUI
- Add high performance – high priority image aquisition and custom interfaces to external devices
The use of .Net with Scorpion is based on Python for .Net (http://www.zope.org/Members/Brian/PythonNet). The “readme” page here is an important source for information regarding the use of .NET components from python scripts.
Python for .NET is a near-seamless integration of the Python runtime with the .NET Common Language Runtime (CLR). It lets you script and build applications in Python, using CLR services and components written in any language that targets the CLR
- Scorpion Vision 4.2 to 7.3 supports .Net Framework version 1.1
- Scorpion Vision 8.0 support .Net Framework 2.0
Read more in Scorpion Online Help.
Filed under: General, Python | 1 Comment »
Posted on December 8, 2009 by Thor
Using the built-in tcp/ip communication protocol this is easy. The following python method makes it even easier:
def RemoteScript(destination,script):
ExecuteCmd('ImCmd',
'destination='+destination+':'+'Script;Name='+script)
Usage:
RemoteScript('localhost:8701','Start()')
Filed under: I/O, Python | Leave a comment »
Posted on November 20, 2009 by Dagrun
Python is the glue between vision tools and the system states. It provides a unique flexibility – when configuring Scorpion any business logic can be defined. From Python one can for example access the Draw API providing overlay graphics or the kernel API giving access to all the image processing results.
Python examples in Scorpion Online Help.
Filed under: Python | Leave a comment »
Posted on November 20, 2009 by Dagrun
Yes this is possible to do. To do this install Python and the Win32 python extensions on the PC. The following function will then run a macro in Excel:
from win32com.client import Dispatch
def RunExcelMacro(name):
myExcel = Dispatch('Excel.Application')
myExcel.Visible = 0
myExcel.Workbooks.Add('c:Termoetiketter1_2.xls')
myExcel.Run(name)
myExcel.DisplayAlerts = 0
myExcel.Quit()
Filed under: Python | Leave a comment »
Posted on November 20, 2009 by Dagrun
Python is used in many situations where a great deal of dynamism, ease of use, power, and flexibility are required. In the area of basic text manipulation core Python (without any non-core extensions) is easier to use and is roughly as fast as just about any language, and this makes Python good for many system administration type tasks and for CGI programming and other application areas that manipulate text and strings and such.
Filed under: Python | Leave a comment »
Posted on November 20, 2009 by Dagrun
Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various window systems, and is extensible in C or C.
Python is also usable as an extension language for applications that need a programmable interface. Finally, Python is portable: it runs on many brands of UNIX, on the Mac, and on PCs under MS-DOS, Windows, Windows NT, and OS/2.
Filed under: Python | Leave a comment »
Posted on November 20, 2009 by Dagrun
Visit the official python web site. The python faq contains valuable information.
Do you need help to start scripting – use the non programmer’s tutorial. The latest python versions are found at the Python Download. Sourceforge.Net contains large resources of modules and programs.
On the Scorpion CD a directory contains the latest Python versions. How to install Python?
Filed under: Python | Leave a comment »