Toolbox for IT

Toolbox for IT

Toolbox for IT

Toolbox.com

Members

Join Now / Sign In

Security Update

My Home

MessagesJournalBlogBookmarksConnectionsPostsProfileAccount / E-mails

People

Find MembersAlphabetical Directory

Vendors

Browse by VendorBrowse by Documents

Communities

Business
IntelligenceC
LanguagesCIOCRMDatabaseData WarehouseEAIEmerging
TechnologiesERPHardwareKnowledge
ManagementNetworkingProject
ManagementSCMSecurity

StorageWeb DesignWirelessBaanJavaLinuxOracleOracle CRMOracle
DatabasePeopleSoftSAPSiebelUNIXVisual
BasicWindows

Code Exchange Archives

Web Design Languages Wiki >
Code >
Code Exchange Archives

Toolbox.com has moved the code
library to Toolbox
for IT Wiki. The original CPP code exchange is preserved below; however, new
submissions are to be posted to Wiki. Visit Wiki to submit your
source code or view code samples.

Source: How to link a Win32 dll in Python

Author: mgh1472

Created
Date: 1/10/2005

Author Website: none

Code Demo URL: none

Compatibility: Python 2.3

Summary: This is used demonstrate how to link a Win32
dll into Python. Also, demonstrates how to use the piapi32.dll against a
PI2 or PI3 system.

View
comments

#! /usr/local/bin/python
###############################################################################
# piapi.pyw v1.0
# Written by Matthew Helle
# [email-masked]
# 08-DEC-2004
#
# BE CAREFUL EDITING THIS FILE, PYTHON IS INDENT SENSATIVE!!!!
#
# Notes:
# piapi.pyw is written in Python & used demonstrate how to connect &
# use the piapi32.dll against a PI2 or PI3 system.
# This was tested on Windows and not tested on any other platform....
#
# Program Location:
# 1. Anywhere\piapi.pyw
#
# Requirements:
# 1. ctypes (ctypes-0.9.2.win32-py2.3.exe) for Python 2.3
# Location: http://sourceforge.net/project/showfiles.php?group_id=71702
#
# 2. PI2 or PI3 Server
# Location: http://www.osisoft.com
#
# 3. PI-API LICENCE
# Location: http://www.osisoft.com
#
# Error checking:
# 1. None
#
# History:
# 1. 08-DEC-2004 Version 1.0 written by Matthew Helle
#
###############################################################################
from ctypes import *

#link the OSI piapi dll
piapi = windll.LoadLibrary("piapi32.dll")

#get pi system time
print piapi.pitm_systime()

Related Content
Jobs

Database
Architect

LAN
Network Engineer, Lead

Senior
Systems Coordinator - IT

Community
Content

How
to use FindExecutable from C# (Blogs)

General_Troubleshooting_Principles
(Wiki)

Why
.NET? (Groups)

Think this code should be
removed?
Submit a
feedback

User
Comments

12/5/2006 guest:
mirws
I wondering,.. how to applicated it in apache web server

About  /  Contact
us  /  Privacy  /  Terms of Use  /  Work at Toolbox.com  /  Advertise with Toolbox for IT
/  Provide Feedback

Communities:  Business
Intelligence  /  C Languages  /  CIO  /  CRM  /  Database  /  Data Warehouse  /  EAI  /  Emerging Technologies
/  ERP  /  Hardware  /  Knowledge
Management  /  Networking  /  Project
Management  /  SCM  /  Security  /  Storage  /  Web Design  /  Wireless  /  Baan  /  Java  /  Linux  /  Oracle  /  Oracle CRM  /  Oracle Database
/  PeopleSoft  /  SAP  /  Siebel  /  UNIX  /  Visual Basic  /  Windows

Also at Toolbox
for IT: Blogs /  Groups /  Wiki /  Events & Webcasts /  Job Center /  Vendor Research Directory

Copyright 1998-2009 Toolbox.com. All rights reserved.
All product names are trademarks of their respective companies. Toolbox.com is
not affiliated with or endorsed by any company listed at this site. Toolbox.com
is a subsidiary of the Corporate Executive
Board.