Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Free serial port activex control
#1
Here's a link to a free serial port activex control. Most others are about $60. It works well with QM. I'm using it to link to a servo controller.
http://home.comcast.net/~hardandsoftware/NETCommOCX.htm
Matt B
Reply
#2
Matt,

Could you post a QM example how this works?

Thanks,
jimmy Vig
Reply
#3
Well, *exactly* 3 years later, I do have an example. Big Grin That ActiveX control, NETCommOCX, broke when I updated to Windows 7. I lost interest for a while. I just got StrokeReader to work great with QM on Win 7 and XP this weekend. Every other solution I found was too expensive. StrokeReader is free for demo or $7 per user.
Some steps:
  • Install the StrokeReader ActiveX control.
  • Create a smart dialog in QM and add the control to the dialog.
  • Click the COM control in the dialog.
  • Click the events button.
  • Then click Apply and Close. Much of the code to register and initialize the control is created for you.
  • To create an event handler, under the WM_INITDIALOG case statement, type the name that QM gave the new StrokeReader control for your dialog (mine was st3), then type “.” and select CommEvent from the list. Some code, a folder, and an event handler function will be automatically generated.
  • Use the StrokeReader website to help with initialization and configuration of the serial port.
  • The event handler function will be called when the StrokeReader control receives data, connects, disconnects, etc. Handle the event based on the data passed to the function.


My dialog looks like this so far:
Function MultiScroll_Config_GUI
Code:
Select All      Help
;\Dialog_Editor
typelib StrokeReaderLib {ED7AED90-6B75-406A-A856-CEFDC6E021FB} 1.76
function# hDlg message wParam lParam
if(hDlg) goto messages


;BEGIN DIALOG
;0 "" 0x90C80AC8 0x80 0 0 53 14 "MultiScroll"
;1 Button 0x54030001 0x4 14 0 26 12 "Exit"
;3 ActiveX 0x54030000 0x0 32 2 18 10 "StrokeReaderLib.StrokeReader {7E42B8C5-73BE-4806-8904-FF4080A696EC}"
;END DIALOG
;DIALOG EDITOR: "" 0x2030307 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,StrokeReaderLib.StrokeReader st3
,st3._getcontrol(id(3 hDlg))
,st3._setevents("st3__DStrokeReaderEvents")
,st3.BaudRate=4800
,st3.DataBits=8
,st3.DataMode = 1 ;;1 text, 0 is binary
,st3.PARITY = 0 ;;none
,st3.STOPBITS = 0 ;;1 stop bit
,st3.Port = 6
,st3.RecvIntervalTimeout=1
,st3.RecvSizeThreshold=1
,st3.Connected = 0
,st3.Connected = 1
,
,case WM_DESTROY
,,st3.Connected = 0
,,
,case WM_COMMAND goto messages2
ret

;messages2
sel wParam
,case IDOK
,,st3.Connected = 0
ret 1

err+
,st3.Connected = 0
Matt B
Reply
#4
There is a windows 7 installer on the website given in the original post: http://home.comcast.net/~hardandsoftware/NetcommW7.zip

I did piece together from other serial port examples on the QuickMacros site and got it working on Windows 7. I still have some kinks to work out working with serial data.


-Jim
Reply
#5
I had no idea a newer version had been released. Thanks for that! I’ll probably stick with StrokeReader though. I had issues with NETCommOCX crashing QM if I didn’t shut down the thread prior to disconnecting the USB device. StrokeReader sends an event on disconnect, but just reconnects and resumes after the device is plugged back in.

Glad you got it working! What sort of device are you communicating with?
Matt B
Reply
#6
I'm working with a parallax propeller microcontroller connected via USB to interpret and send data in shift registers.

Essentially this setup allows me to use buttons and switches to control relays and other logic controlled devices via QuickMacros.

The parallax "SPIN" language is pretty simple and straight forward. Via the OBEX serial driver; binary, hex, and text can be sent to QuickMacros.

Real world manipulation.

-Jim
Reply
#7
Awesome! That is fun stuff.

I initially needed serial comms to interface with my 4 scroll wheel mouse/pad. Each wheel has a different function depending on current active window. Local volume, HTPC volume, brush size in GIMP, elevator trim in Flight X, zoom, normal scroll. It works well, but I enjoy perfecting it. I used a PIC microcontroller to read the rotary encoders and handle the serial comms. QM handles everything else.

Currently I’m using serial comms as one of many links in the chain to allow me to unlock my front door from my phone via the internet. It’s coming along.
Matt B
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)