Advertisement

11.15.2007 at 09:40AM PST, ID: 22963538 | Points: 500
[x]
Attachment Details

Need a simple batch/exe file to run switch

Tags: program, batch, simple, close, exe
I am a private school teacher (Small school) and I purchased a USB analog switch to run our bell system. Only problem is, no software.
So, I have a simple alarm clock that initiates programs. If I had a script/batch.exe file that would initiate the switch that would do it for me.

Here is the switch: http://www.phidgets.com/products.php?product_id=1014

If you could write a simple script or a progaram that would close the switch for 2 seconds that is all I need, Then I would use the alarm to initiate the program every time it was needed.
Start your free trial to view this solution
Question Stats
Zone: Software
Question Asked By: ambantin
Question Asked On: 11.15.2007
Participating Experts: 1
Points: 500
Views: 0
Translate:
Loading Advertisement...
11.15.2007 at 05:58PM PST, ID: 20295073

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.16.2007 at 07:51AM PST, ID: 20299108

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.16.2007 at 11:40AM PST, ID: 20300795

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.16.2007 at 11:52AM PST, ID: 20300918

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.16.2007 at 12:20PM PST, ID: 20301174

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.16.2007 at 02:57PM PST, ID: 20302178

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.16.2007 at 04:31PM PST, ID: 20302647

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.16.2007 at 06:46PM PST, ID: 20303044

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.16.2007 at 07:57PM PST, ID: 20303165

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.17.2007 at 04:45AM PST, ID: 20304123

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.17.2007 at 04:45AM PST, ID: 20304126

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.17.2007 at 09:03AM PST, ID: 20304729

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.20.2007 at 04:56PM PST, ID: 20324733

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.20.2007 at 05:09PM PST, ID: 20324782

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
11.20.2007 at 05:55PM PST, ID: 20324961

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.21.2008 at 05:23AM PDT, ID: 21400838

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
11.15.2007 at 05:58PM PST, ID: 20295073

Rank: Wizard

First, you need to download and install the Phidget Framework from the following page (I assume you are running Microsoft Windows operating system):

  http://www.phidgets.com/downloads.php?os_id=1

This framework will install the components needed to program the switch using various programming languages.

Next, you need to create a simple VBScript that would close the switch for two seconds. Try saving the following code to a .VBS file (for example, "close_switch.vbs"), and then execute it by double-clicking the file, and see if it works.

_________________________________________________

Dim IKit
Set IKit = CreateObject("Phidget21COM.PhidgetInterfaceKit")
IKit.Open
IKit.OutputState(1) = True
Delay 2
IKit.OutputState(1) = False
IKit.Close

Sub Delay(DelaySeconds)
      SecCount = 0
      Sec2 = 0
      While SecCount < DelaySeconds + 1
            Sec1 = Second(Time())
            If Sec1 <> Sec2 Then
                  Sec2 = Second(Time())
                  SecCount = SecCount + 1
            End If
      Wend
End Sub

_________________________________________________

Note: I have never seen an actual switch! :) Therefore, you need to take care of the following:

1. As far as I could understand, the switch has 4 different outputs. Check whether the index of the first output is 0 or 1 (you can do that check by replacing OutputState(1) in the above code with OutputState(0), and see which one will close the first switch.

2. Check whether sending True or False would close the switch. You can do that check by trying the above code, and if it does not work as expected, swap the True and False values and try again.

_______________

  Nayer Naguib
 
11.16.2007 at 07:51AM PST, ID: 20299108
Script Error

Activex component can't create object: 'Phidget21COM.PhidgetInterfaceKit'
code: 800A01AD
Source: Microsoft VBScript runtime error
 
11.16.2007 at 11:40AM PST, ID: 20300795

Rank: Wizard

You need to install the Phidget Framework first using the URL provided above. The installer requires Microsoft .NET Framework 2.0 to be installed on your system, so you might need to install it before running the installer.

_______________

  Nayer Naguib
 
11.16.2007 at 11:52AM PST, ID: 20300918
It is installed the Phidget Framework, I have tested it with the supplied program. All is functioning properly. But I still am getting the same error when I initiate the script.
 
11.16.2007 at 12:20PM PST, ID: 20301174

Rank: Wizard

Check the following:

1. The "Ph" icon should be displayed in the Windows task bar to indicate that the library is correctly installed.

2. Double-click the "Ph" icon, and make sure that the displayed name of the library is Phidget21 (this should be just below the "Library Information:" line. If the displayed name is different, then you need to download and install the latest version using the URL provided in my first post.

_______________

  Nayer Naguib
 
11.16.2007 at 02:57PM PST, ID: 20302178
That is what I have...

Ok.. Now what?
 
11.16.2007 at 04:31PM PST, ID: 20302647

Rank: Wizard

Looks like for some reason, the COM component that comes with the Phidget Framework might have not been successfully registered. Check that the file Phidget21COM.dll exists in the installation folder of the framework (default folder is "C:\Program Files\Phidgets"), and then open a command prompt window and issue the following command:

  regsvr32 "C:\Program Files\Phidgets\Phidget21COM.dll"

You may need to replace the path in the command above with the actual path on your file system if the framework was installed to a different folder. Double quotes enclosing the path should also be typed.

If you get a message saying that registration was successful, then you should be able to execute the script without errors.

_______________

  Nayer Naguib
 
11.16.2007 at 06:46PM PST, ID: 20303044
registration was successful !!!

but... same error
 
11.16.2007 at 07:57PM PST, ID: 20303165

Rank: Wizard

I'm not sure why this is happening, but OK. Let's try doing the job using VB.NET!

Save the following code to a file with the .VB extension (for example, C:\close_switch.vb):

____________________________________________

Imports System.Threading

Module Module1

    Sub Main()
        Dim IKit As New Phidgets.InterfaceKit
        IKit.open()
        IKit.outputs(0) = True
        Thread.Sleep(2000)
        IKit.outputs(0) = False
        IKit.close()
    End Sub

End Module

____________________________________________

Now open a command prompt window, and issue the following command:

  cd \Windows\Microsoft.NET\Framework\v2.x.xxxxx

Where 2.x.xxxxx is the name of the directory that contains the Microsoft .NET 2.0 compilers and runtime files (replace 2.x.xxxxx with the actual version that you have, which you can determine by navigating to the folder C:\Windows\Microsoft.NET\Framework using My Computer or Windows Explorer).

Now issue the following command:

  vbc.exe /r:"C:\Program Files\Phidgets\Phidget21.NET.dll" C:\close_switch.vb

Where C:\close_switch.vb is the path to the VB file that you have created in the first step.

Now open My Computer, navigate to the folder containing the VB file (C:\ in the above example), and double click the EXE file that has just been created (for example, close_switch.exe).

Hope it works this time!

_______________

  Nayer Naguib
 
11.17.2007 at 04:45AM PST, ID: 20304123
ok... just did it remotely... no error... will have to be there tomorrow or monday to check it out...

Thanks
 
11.17.2007 at 04:45AM PST, ID: 20304126
any idea what was wrong with the first script?
 
11.17.2007 at 09:03AM PST, ID: 20304729

Rank: Wizard

I'm not sure about the cause of the problem. Usually, this error occurs because of any of the following:

1. The name of the component is not typed correctly in the code.
2. The component is not registered.
3. The DLL file is corrupt.
4. The user does not have Read/Execute NTFS rights on the file.

In your case, I doubt it could be any of the above, but maybe you could check the rights you have on the DLL file in case it is on an NTFS file system.

_______________

  Nayer Naguib
 
11.20.2007 at 04:56PM PST, ID: 20324733

Rank: Wizard

Any updates?

_______________

  Nayer Naguib
 
11.20.2007 at 05:09PM PST, ID: 20324782
sorry... on family leave... father died... will get back next wednesday
 
11.20.2007 at 05:55PM PST, ID: 20324961

Rank: Wizard

I am very sorry.Condolences.
 
04.21.2008 at 05:23AM PDT, ID: 21400838
This question has been classified as abandoned as it has no comments in the last 21 days.  I will make a recommendation to the moderators on its resolution in approximately four days.  I would appreciate any comments by the experts that would help me in making a recommendation.

It is assumed that any participant not responding to this request is no longer interested in its final disposition.

If the asker does not know how to close the question, the options are here:
http://www.experts-exchange.com/help.jsp#hi111

Venabili
EE Cleanup Volunteer
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628