Hey all !! I've made a controlpad like one you can find schematics to on this page; http://diba.hotbox.ru/comctrl/index.html and I've tried that software on the page also... I would like to ask all of you who I know can help. Is there anyone who got programming code for use with these buttons... for VISUAL BASIC up to 6.0. I looked around at www.pscode.com and found some ****ty codes... But I guess you elit peeps here can help me right?? I thought of something that takes a look on the serial port for shortout, it should be something like that when buttons are pressed right? (my bad english ) well anyway, and it check for certain combinations and then make the correct action for each button... anyone who understand me?? anyone who could help?? please do thank you BT peeps!!
I need a program or source that can read out the serial port to see if I press a button... I will connect 15 buttons like the scheme on this site; http://diba.hotbox.ru/comctrl/index.html and then it will do a different action for each button... if you understand?
Add the MSCOMM component to you project. Drag a timer and an MSCOMM component to you form. Add a command button and a textbox to your form. Change the caption of the command button to "Start" Set the enable property of the timer to enabled=false and set the interval to 1 Set the multiline property of the text box to true and the scrollbar property to both Then add following code to your command button Code: Private Sub command1_Click() If command1.Caption = "Start" Then If MSComm1.PortOpen = True Then MSComm1.PortOpen = False timer1.Enabled = True command1.Caption = "Stop" Else command1.Caption = "Start" timer1.Enabled = False End If End sub Add the following code to the timer Code: Private Sub Timer1_Timer() Dim s As String If MSComm1.PortOpen = False Then MSComm1.PortOpen = True s = MSComm1.Input text1.Text = text1.Text & s End Sub This code will display your cominput in a textbox. Just check the input messages and then update your code to incorporate the messages!
oh damn... I love you mate and on Xmas also... I hope you have the greatest Christmas!! Merry Christmas and a Happy New Year to ya!!
just had a looksie at the schematic on the link you gave Now without even checking the PIN numbers i can tell you thats using the rs-232 port, but its not sending the data in serial manner. Your using the status lines (its ok) for the data. This means the code above won't work, because the data isn't been sent as serial. What your doing, is when a button is pressed, setting the Data Set Ready Carrier Detect Clear to Send Ring Indicator pin high. As such the comm object won't ever think any data has been recived (or when u poll it manually?) This means that you can't use the MSComm1.DataRecived (or what ever vb wants too call it) event to tell when data has been recived. As such there is going to be a hudge CPU overhead, as you will have to poll the ports . Yukie... Anyway this yukie yukie yukie way, which i feal dirty typing. According to my MSDN these are 3 properties that will tell you if that respective input CTSHolding // pin 8 CDHolding // pin 1 DTRHolding // pin 6 As for Ring Indicator, well, i don't know!, i can't find a RIHolding property on the MSDN for this object, if there isn't you can get it the grown up way from GetCommModemStatus. If no one can find out how u get the Ring Indicator property, thats what you will have to do.
well... that is not the schematic that I use... it's the 15 button schematic I use... but I guess that one is like the same?
I wrote a guide for a mag on this a while back, didn't get round to writing my own software though. I did look into a lil' dll though that will be very helpful to you "port.dll", i'm sure you should be able to find it on the web somehwere along with info on how to use it. These are the lines you need... If CTS() = 1 Then 'whatever If DSR() = 1 Then 'whatever If DCD() = 1 Then 'whatever If RI() = 1 Then 'whatever
tbh i can't see the need for a dll! it would be more effort registering the function call backs. The "propper" way of doing this, would be to create a new thread with an algo' like this: WaitForCommEvent (win32 api call, blocks until theres a comm event) GetCommModemStatus (&structure) now you just react. I was thinking of designing a system service for a rotary encoder, for which i would make the code available for. It realy is that simple
ok... but did you understand what kind of control I had which I connect to the serial port?? do you got any source for vb to use?
ya it could... if I got the scematic well... I can see what I can do... be back in a few hours I hope...
should do, u see how their using diodes to force binary on the control lines. they use the diodes because u don't want to allow the high voltage from one handshaking line to goto another. so each of the handshaking lines gets pulled to the Request To Send line.