Slave USB Questions

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
User avatar
Jay Dee
Posts: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

Slave USB Questions

Post by Jay Dee »

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.

User avatar
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

Post by Benj »

Hello,
A) ECIO_OPEN, the return 'status' value is 0 for a successful connection? Not specified in the help but seems to be this way.
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.
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.
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.

Post Reply