Products for USB Sensing and Control
It is currently Sun May 19, 2013 7:50 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Feb 03, 2011 4:32 pm 
Offline
Fresh meat

Joined: Thu Feb 03, 2011 4:04 pm
Posts: 2
I need to write a program for a 1014 InterfaceKit 0/0/4. I have VS C# Express installed on my computer and can manually control the 0/0/4 with the Phidget Control Panel.

My goal is to sound a time clock buzzer at various times of the work day. Ex: Turn the buzzer on at 7:00 AM and off 5 seconds later.

I am new to programming and find that the code examples on the Phidgets website are much more complex that what I need. Would someone be willing to give me a code snippet that would do what I need it to do or tell me where to look for one?

Another idea would be to use a .bat file that would be initiated by a Windows Scheduled Task. I could create a task for every time the buzzer is needed then the batch file could turn the buzzer on for 5 seconds then off.

Can .bat files control this board?

Thanks!


Top
 Profile Send private message  
 
PostPosted: Fri Feb 04, 2011 10:31 am 
Offline
Phidgeteer!

Joined: Wed Nov 26, 2008 3:52 pm
Posts: 64
Location: Norway (East)
My suggestion:

Make a simple app to turn the buzzer on at x seconds (seconds by commandline).
Then add the app to the scheduler..


Top
 Profile  
 
PostPosted: Fri Feb 04, 2011 10:45 am 
Offline
Fresh meat

Joined: Thu Feb 03, 2011 4:04 pm
Posts: 2
I like the idea of letting the scheduled task control when the app runs.

When you say to create a simple app, are you suggesting that this be a C# app or is there something simpler that I could do?

My knowledge of C# is extremly basic and I can't find examples similar to what I need the program to do.


Top
 Profile Send private message  
 
PostPosted: Fri Feb 04, 2011 12:07 pm 
Offline
Phidgeteer!

Joined: Wed Nov 26, 2008 3:52 pm
Posts: 64
Location: Norway (East)
Use the language you are most comfortable with.

The setup would be something like:
App start:
-Run the buzzer in x seconds (received from command line).
-Terminate


Last edited by Cerwell on Sat Feb 05, 2011 4:48 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Feb 04, 2011 3:43 pm 
Offline
Phidget Mastermind

Joined: Wed Mar 31, 2010 8:34 am
Posts: 111
C# and .Net can do that with only a little work.

Create a method that will ring the buzzer for 5 seconds.

Next, create a timer for the time you want it to ring. The timer will trigger an event when that time is reached. Hook into that event and call the buzzer method.

Should take all of 20 minutes.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group