• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

need help: serial port control interface using VB

Status
Not open for further replies.

fvken2

New Member
good day everyone. i'm now doing a project of motor controlling. the overall concept is that i will do an user interface (by visual basic) for user to key in necessary input. after that, data will be transfered to DSP controller (MSK243) and hence control the motor.

i already developed the assembly code for motor controlling. besides, i also created the user interface. the problem is, i don't know how to link the VB program with the controller using serial port. due to reason that i'm so new in VB, i need guidance for the linking part. i just know the "monwin32.dll" is used for serial linking. yet, in order to use this library, i got to use with function "initcom", "exitcom" etc, but i don't know how to use those..

does anyone has this kind of experience? send me some information regarding this. help is very much appreciated. thank you
 

najeeb

New Member
Just mail me at [email protected]. I can give u one DLL (develped in VC ) and VB sample code which can be used very easily. it looks as follows

outport(portID, data)
val=inport(PortID)
where outport and inport are the functions definded in the DLL.

this will work well with serial port and parallel port
 

kinjalgp

Active Member
najeeb, does you DLL have facility to set baud rate, data bits, stop-bits etc. of serial port?
 

fvken2

New Member
interface

thanks guys for the info.. coz i'm newbie in interfacing or VB. i wonder if the MSCOMM is applicable for my controller (MSK243 controller, DSP TMS320F243) ?

in detail, rite now i developed the control panel (by VB6) for PWM space vector inputs, and they are PWM period, initialization value (degree, magnitude). all these variables are used to calculate T1 and T2 of vector. eventually value T1 and T2 have to be sent to controller

total values/data to be sent are T1, T2, stop bit. how am i going to do this?
 

fvken2

New Member
help out guys...

* can anyone help me to edit my prog using monwin32.DLL, which is already added as a module inside

in detail, rite now i developed the control panel (by VB6) for PWM space vector inputs, and they are PWM period, initialization value (degree, magnitude). all these variables are used to calculate T1 and T2 of vector. eventually value T1 and T2 have to be sent to controller

total values/data to be sent are T1, T2, stop bit. how am i going to do this?
besides, baud rate should be in 38400, can MSCOMM be used?

inside my VB program, there is already a MONWIN32.DLL, i actually don't know how to use that for communication, would you please show me some e.g on how to use that ? thanks


you can reply to me thru' this: [email protected]
 

Attachments

najeeb

New Member
I am sory, this DLL is not capable of setting data bits and baud rate. If you want your program to customize serial port settings , i recommend MSComm control. My DLL is created to simplify the use of port in VB just like in C. You can fix the baud rate and data bits by windows controls. or by the dos command MODE COM1, 9600,n,8,1
 

panic mode

Well-Known Member
I don't think mscomm32 will work with speeds higher than 19200bps.
Try looking for alternative (there are plenty of VB forums)
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top