Hi guys,
I've been playing with VB6 and flowcode and have a nice little Slave USB setup but would appreciate if anyone can confirm a couple of points.
Using an ECIO 40P
VB6
A) ECIO_OPEN, the return 'status' value is 0 for a successful connection? Not specified in the help but seems to be this way.
FlowCode
B) Under what conditions will the micro-controllers flowcode slave service routine stop and return to the main program, is the only (proper) option to call the Stop_Slave_Service macro from within the running service macro? If I simply disconnect the USB cable to the Microcontroller, the Micro appears to just wait for the USB to e reconnected. Its not a big problem as i guess I'll just need to add a 'release micro' routine, activated when it sees a specific message from the PC.
Cheers,
When I've tidied the whole lot up, I'll post some of the project as it been quite a learning process.
J.
Slave USB Questions
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Slave USB Questions
Hello,
I seem to remember that this returned a 1 when connecting successfully. I could be remembering it wrong though if its currently working for you and returning a 0.A) ECIO_OPEN, the return 'status' value is 0 for a successful connection? Not specified in the help but seems to be this way.
The only way to get the microcontroller back to the main program is to use the stop_slave_service macro with the USB connected. Disconnecting and re-connecting the USB may be resetting the device which is why the code is working for you ok. You could maybe add a input to the micro that checks to see if the USB 5V is present. If it is no longer present then you could call the end slave service macro as part of a timer interrupt.B) Under what conditions will the micro-controllers flowcode slave service routine stop and return to the main program, is the only (proper) option to call the Stop_Slave_Service macro from within the running service macro? If I simply disconnect the USB cable to the Microcontroller, the Micro appears to just wait for the USB to e reconnected. Its not a big problem as i guess I'll just need to add a 'release micro' routine, activated when it sees a specific message from the PC.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel