Write a VB Code

Write a VB Code

Postby Wisko » 20 Feb 2008, 12:48

Hi
First, sorry that my English is not so well like my Spanish or German.

So, I have a Big Problem, I have to write a Visual Basic Code to control my step motor, (I'm using the Visual Studio 2005 Platform)

I bought the TMCM-110 Control and It work's perfect with the TMCL Language.

But I can't present my project with the TMCL Language, I have to make it with Visual Basic.

The communication between PC and TMCM Controller is a USB-COM converter, also RS232 Port.

I need only to know, how can I do, to move the Motor to left and Right,

Pleas HELP !!!!!!

Thanks
Muchas Gracias !!

Nico W.
Wisko
User
User
 
Posts: 4
Joined: 20 Feb 2008, 12:01
Location: Frankfurt

Postby Olav Kahlbaum (TRINAMIC) » 21 Feb 2008, 09:05

You can either send the command bytes through the RS232 interface yourself (just open the interface, then send the commands as described in chapter 2 of the TMCL reference manual). I think that the MSComm component can be used to do that job (I do not know much about VB), but be careful: the most common mistake made with VB is that the bytes are not being sent as binary values, but as strings containing hexadecimal numbers. But this is worng, they must be sent as binary values.
Some examples (module address 1 assumed):

For ROL 0, 1000
send the following bytes: 01 02 00 00 00 00 03 E8 EE.

For ROR 0, 500
send the following bytes: 01 01 00 00 00 00 01 F4 F7.

For MST 0
Send the following bytes: 01 03 00 00 00 00 00 00 04.

You can also see the binary representation of a command in the "Direct Mode" dialogue of the TMCL-IDE: Just choose your command and enter the values, then click the "Copy" button, and you will see the binary representation of the command in the "Manual Instruction Input" section.

Another way would be to use the TMCL RS232 wrapper DLL that can be found on our website and on the TechLib CD. Please see also one important hint concerning this DLL:

http://www.trinamic.com/ttdg/viewtopic.php?t=866
User avatar
Olav Kahlbaum (TRINAMIC)
Site Admin
 
Posts: 3359
Joined: 11 Aug 2006, 08:02


Return to Trinamic Motion Control Language (TMCL)

Who is online

Users browsing this forum: No registered users and 1 guest

cron