K8096 Stepper Motor Controller With VBA (Not VB) or Serial

Hi folks.

I’m attempting to use a K8096 Stepper Motor Controller card with VBA (Visual Basic for Applications, in this case excel’s in built VB not “real” VB).

VBA will happily use some DLL’s and any serial ports stuff but I’m not having any luck with the stepper motor DLL.

So:-

Q1 - Does anyone have any experience using this board with VBA?

Q2 - Failing that can I abandon the DLL approach and send serial commands to the virtual port instead? I’m happy writing a VBA class module to handle this providing I know what commands to send…

Thanks for your attention.

Owen S.

OK, Looks like the serial approach may be the way to go.

Snooping on the example application’s coms shows the following message formats:-

Move (Motor 1, 1 step, speed 10, to the right):-

FF 05 81 7A 00

followed by

FF - Start TX
0A - Length of instruction
01 - Steps (LSB)
00 - Steps
00 - Steps
00 - Steps (MSB)
0A - Speed
01 - Dir (1 = Right, 0 = left)
EA - Checksum
00 - End TX

Torque on:-
FF 05 FF FC 00

Torque off:-
FF 05 00 FB 00

Stop:-
FF 05 81 7A 00

So…

[b]Q3 - Are my assumptions of the message format correct?

Q4 - What method is used to generate the checksums?
[/b]
Cheers for any help.

Owen S.

OK, checksum seems to be:-

Sum bytes then xor LSB with HFF

Cheers, OS

Howdy folks.

Just in case anyone was wondering it is indeed straightforward to control the USB card simply by sending a few hex bytes to the virtual serial port.

So far I’ve only got move(dir, steps, speed), torque on, torque off and stop.

Next up, need to interogate the inputs, anyone know the commands or the format of the return?

Cheers,

Owen S.

OK - Card returns the complete status in one 7 byte message which is nice, the input status is in the first 5 bits of the 5th byte.

What I can’t find is how to instruct the card to return the status.

The demo software (MotorDemo) has a constant stream of returns but I can’t see a write that triggers them. (The vb example code uses the DLL so nothing to see there.)

Please - Does anyone know a serial command I can send to the card to trigger it to retun the status message?

So close to having this usable but close doesn’t really cut it :frowning:

Cheers,

Owen S.