the motion control company
(888) 777-1826
+1 (818) 222-9200
Home About Us Videos Site Map Contact Us
Products
Motion Controllers
Linear/ Rotary Actuators and Stages
Motors -  Stepper, Servo
Motor Drivers - Stepper, Servo
Solenoid Control Electronics
Power Supplies
Accessories
Knowledge Center
Motion Control Block Diagram
About Us
Site Map
Movies

 

Host Controlled Operation

 

In this mode, the host will send a series of commands to the controller over the RS-232 serial port. The controller process to the incoming commands and responses with the proper messages.
 

Programming Example in Visual BASIC 

The following example sets the linear acceleration to 500000 Steps / sec, step rate at 100 KHz, and the distance to travel equal to 200,000 steps. Then the controller is commanded to make an absolute move on the X Axis.

Private Sub Command1_Click()

'Function Prototype
Declare Function SioPuts Lib "WSC32.DLL" (ByVal Port As Long, ByVal Buffer As String, ByVal Size As Long) As Long

Dim Code As Long
Dim StringToBeTransmtd As String

' Set the linear acceleration of X Axis to 500,000 steps / sec / sec
StringToBeTransmtd = "accx 500000" + vbCr
Code = SioPuts(ThePort, StringToBeTransmtd, Len(StringToBeTransmtd))

' Set the linear velocity of X Axis to 100,000 steps / sec
StringToBeTransmtd = "velx 100000" + vbCr
Code = SioPuts(ThePort, StringToBeTransmtd, Len(StringToBeTransmtd))

' Set the position to move of X Axis to 200,000 steps 
StringToBeTransmtd = "posx 200000" + vbCr
Code = SioPuts(ThePort, StringToBeTransmtd, Len(StringToBeTransmtd))

'Command the X Axis of the controller to make an absolute move
StringToBeTransmtd = "movax" + vbCr
Code = SioPuts(ThePort, StringToBeTransmtd, Len(StringToBeTransmtd))

End Sub

Programming Example in 'C'

The following example sets the acceleration at 10  Million Steps / sec2   , step rate at 100 KHz, and the distance to travel equal to 100,000 steps. Then the controller is commanded to make an absolute move.

void send_command(void)
{

char StringToBeTransmtd[80];

// Set the linear acceleration of X Axis to 500,000 steps / sec / sec
strcpy(StringToBeTransmtd,"accx 500000\n");
SioPuts(Port,StringToBeTransmtd,strlen(StringToBeTransmtd));

// Set the linear velocity of X Axis to 100,000 steps / sec
strcpy(StringToBeTransmtd,"velx 100000\n");
SioPuts(Port,StringToBeTransmtd,strlen(StringToBeTransmtd));

// Set the position to move of X Axis to 200,000 steps 
strcpy(StringToBeTransmtd,"posx 200000\n");
SioPuts(Port,StringToBeTransmtd,strlen(StringToBeTransmtd));

// 'Command the X Axis of the controller to make an absolute move
strcpy(StringToBeTransmtd,"movax\n");
SioPuts(Port,StringToBeTransmtd,strlen(StringToBeTransmtd)); 


 



Home | Products | Accessories | Knowledge Center |About Us | Testimonials |Terms of Use | Videos |Site Map | Contact Us
                                             
Optimal Engineering Systems, Inc.
Los Angeles, California, USA

       Toll Free Number (888) 777-1826 in USA

+1 (818) 222-9200
 

oes@oesincorp.com

Copyright ©  1998 - 2012 Optimal Engineering Systems, Inc., All Rights Reserved