Sending a serial command to SSC-32 using Mscomm in VB6

Can someone please give me some pointers on using a serial command IN VB6 to send a command string like " #1 P1750 S200 "

Now I know folks are using the “special VB enterprise” but I’d need to use the more powerful VB6 professional using the Mscomm component

(The following “@#$#$” means “cotten picking” because I am frustrated)

I’ve tried everything and the @#$#$ thing wont work!
Funny thing is I can get the @#$#$ thing to work with a SSCII vb program. But the old SCII doesn’t allow you to shut off the @#$#$ servos off or control speed.

That’s why I am trying this @$#$% SSC-32!

The @$#$% SSC-32 works fine with the Visual Sequencer. Now i just want send a serial command from my @$#$% VB6 application.

Can someone out there @$#$% help me?

Thank you kindly…
:slight_smile:

There are a couple of things that could be wrong, and there are a couple of things you can do to help troubleshoot them.

Do you check for an error return when you open the com port?

Have you verified that you are setting the baud, character size, parity, stop bits, and no flow control correctly when you initialize the com port?

Are you including a carriage return character at the end of the string you are sending to the comm port?

If you have accomplished all of these things then it would be helpful to see what you are actually sending to the ssc-32. If you have access to a second computer and a null-modem cable then open a hyper-terminal session on the second computer, configure it for the same baud and serial settings as the ssc-32, connect the two ports together using the null-modem cable, and run your program to see what is being sent.

You may need to start googling for vb6 serial port code examples like below. The last time I looked at vb6 there was a little telephone icon in the IDE that handled the serial port activities.

programmers-corner.com/sourcecode/111
bitwisemag.com/copy/vb/vb1.html
pencomdesign.com/support/rel … xample.htm

Frustrated or not, we don’t need the profanity or even the simulated profanity.

Alan KM6VV

Okay

I apologise. I am a vulgar man but my work is not. Its just my personality to lighten things up. thank you kindly Robot guru for your help. It is working fine.

Check out my stuff on youtube: Creaturebotman

Robots, AI and a lot of silly stuff.

Peace!

Private Sub Form_Load()
With MSComm1
'make sure the serial port is not open (by this program)
If .PortOpen Then .PortOpen = False
'set the active serial port
.CommPort = 1
'set the badurate,parity,databits,stopbits for the connection
.Settings = “9600,N,8,1”
'set the DRT and RTS flags
.DTREnable = True
.RTSEnable = True
'enable the oncomm event for every reveived character
.RThreshold = 1
'disable the oncomm event for send characters
.SThreshold = 0
'open the serial port
.PortOpen = True
End With 'MSComm1
With Text1
'set the properties for the displaying textbox
.BackColor = vbCyan
.Locked = True
.Text = “”
End With 'Text1
With Text2
'set the properties for the ‘send’ textbox
.TabIndex = 0
.Text = “”
End With 'Text2
With Command1
'set the properties for the ‘send’ command button
.Caption = “&Send”
.Default = True
.TabIndex = 1
End With 'Command1
End Sub

Private Sub Form_Resize()
Dim sngWidth As Single, sngHeight As Single
Dim sngDisplayHeight As Single
Dim sngTxtWidth As Single
Dim sngCmdWidth As Single, sngCmdHeight As Single
'calculate the inner size of the form
sngWidth = ScaleWidth
sngHeight = ScaleHeight
With Command1
'resize and reposition the command button
sngCmdHeight = .Height
sngCmdWidth = .Width
sngDisplayHeight = sngHeight - sngCmdHeight
sngTxtWidth = sngWidth - sngCmdWidth
.Move sngTxtWidth, sngDisplayHeight, sngCmdWidth, sngCmdHeight
End With 'Command1
'resize and reposition the label
Text1.Move 0, 0, sngWidth, sngDisplayHeight
'resize and reposition the textbox
Text2.Move 0, sngDisplayHeight, sngTxtWidth, sngCmdHeight
End Sub

Private Sub MSComm1_OnComm()
Dim strInput As String
With MSComm1
'test for incoming event
Select Case .CommEvent
Case comEvReceive
'display incoming event data to displaying textbox
strInput = .Input
Text1.SelText = strInput
End Select
End With 'MSComm1
End Sub