Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
ibm
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 28th, 2008, 03:22 PM
Roadzill Roadzill is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 1 Roadzill User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 48 sec
Reputation Power: 0
Step Motor Control Command

I have very little programming experience but I would like to learn to use visual basic. I iave VB6 I guess I could also try the new express edition. I'm trying to control movement of a Step motor. with rs232 communication, some commands shown. I can configure most items via it’s gui, but I can’t perform run cycles, just one for one travel commands, so I need to perform a loop cycle. I would like to at least configure the serial port and make the motor move for now, I'd be thrilled!

Very basic for now, I’ll learn other implementations later…

All I need for now
• Configure
• Move
• Write
• Loop

Each comand has to end with a carriage return chr$(13) but I'm not sure how to contruct with VB, they had a breif example but do not know how to configure port ect.

any help will be greatly appreciated. See Below


******************************************
I. configure serial port
• Baud Rate: 38400
• Parity: None
• Data Bits: 8
• Stop Bits: 1
• Flow Control: none

II. Send index to motor:
"@0N1_500” & Chr$(13)


III. loop

‘where 0=address,N=Index Command 500=IndexTravel chr$(13)=carriage rtn


For count = 0 to 4449
‘Set Direct = cw
"@0+” & Chr$(13)

‘Move Motor * Index Number - move motor up position
"@0G1” & Chr$(13)

‘Set Direct = ccw‘
"@0+” & Chr$(13)

‘Move Motor * Index Number – move motor down position
"@0G1” & Chr$(13)

Count = count+1
write (count, pc date & time) stamp to text file
Next Count






























Brief overview:

N - Index Number
Format: N#_[value] - where # is the motion profile number 1 or 2
Sample: N1_10000 Index number of profile 1 equals 10000
Description: This command sets the number of pulses to index for the motion profile. This value must
be set before motion begins. These values are saved in the EEProm for stand-alone use.
Range: 0 - 8,388,607


Unit Selection
In order to select a unit the @ command followed by 0 (address of the unit) must be sent.
NOTE: There should be no spaces between the @ and the 0.
How to select the unit:
@0 (Unit is selected)
How to get a response from the unit:
@0$ (Carriage Return)
After the $ command, the pulse generator will return a SMSI30 + the current version number.
Note: In direct talk mode each command is followed by a carriage return.
The unit communicates in half duplex mode, therefore proper setup of hyper terminal is necessary to view characters,
if characters are to be echoed back to the screen.
Instructions
All instructions require that no spaces be sent between the command and the parameter followed by a carriage
return. The commands are also case sensitive and are all sent as capitals.
Command Summary:
A - Acceleration/Deceleration
B - Base Speed
G - Go (Index)
H - Hard Limit
M - Max Speed
N - Index Number
R - Microstep Resolution
S - Soft Limit
T - Complete Time
V - Verify
+ - Clockwise Direction
- - Counterclockwise Direction
$ - Version Number Register
! - Error Codes Register
% - Verify Controller Address
~ - Set Controller Address




*** The only Programming Example They Have *********

This Example is for Axis=0, and Profile=1
DimConst DefaultTimeout As Single = 0.5
frmMain.MSComm1.Output = "@0A1_100000. & Chr$(13) .Set Acceleration
Pause DefaultTimeout
frmMain.MSComm1.Output = "@0B1_1000. & Chr$(13) .Set Base Speed
Pause DefaultTimeout
frmMain.MSComm1.Output = "@0M1_4000. & Chr$(13) .Set Maximum Speed
Pause DefaultTimeout
frmMain.MSComm1.Output = "@0N1_500. & Chr$(13) .Set Index Number
Pause DefaultTimeout
frmMain.MSComm1.Output = "@0T1_100. & Chr$(13) .Set Complete Time
Pause DefaultTimeout
frmMain.MSComm1.Output = "@0R8. & Chr$(13) .Set Microstep Resolution
Pause DefaultTimeout
frmMain.MSComm1.Output = "@0+. & Chr$(13) .Set Direction CW
Pause DefaultTimeout
frmMain.MSComm1.Output = "@0G1. & Chr$(13) .Start the Index
Pause DefaultTimeout

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Step Motor Control Command


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway