Page 1 of 1

Is it possible to use USB device within a simulation

Posted: Tue Nov 14, 2023 10:32 pm
by RGV250
Hi,
In Labcetner VSM they have a component called COMPIM which allows you to connect the simulation with a real serial port so the simulation can use real time data.
In the real project I am using a Raspberry Pi and I have a USB device that sends a serial string for the data. I was wondering if such a thing exists in FC so when I simulate the project on the PC I can connect to the USB serial device to use real time data.

If not would it be worth putting the post in the feature request to see if other people thing it would be useful.

Bob

Re: Is it possible to use USB device within a simulation

Posted: Wed Nov 15, 2023 9:09 am
by mnfisher
Hi Bob,

Yes - it's possible using the SCADA options - at least for some boards. See new project - AppDeveloper - Templates - API - Scada for some examples.

The board needs to have the SCADA firmware loaded on it. See https://www.flowcode.co.uk/wiki/index.p ... _Developer for an intro.

Martin

Re: Is it possible to use USB device within a simulation

Posted: Wed Nov 15, 2023 11:28 am
by RGV250
Hi Martin,
Unfortunately this is for a Raspberry Pi which AppDeveloper is not available for.

Bob

Re: Is it possible to use USB device within a simulation

Posted: Wed Nov 15, 2023 12:18 pm
by chipfryer27
Hi

If only during simulation then depending on the component you are using, under properties there will be a simulation setting in which you can specify options such as a Comms port or Human Interface etc

Hope this helps,

Regards

Re: Is it possible to use USB device within a simulation

Posted: Wed Nov 15, 2023 1:16 pm
by mnfisher

Re: Is it possible to use USB device within a simulation

Posted: Wed Nov 15, 2023 4:14 pm
by Steve-Matrix
App Developer's main function is to produce PC-based apps and not really a simulation of an embedded target. You would typically use it to create apps that interact with hardware you have designed (e.g. using those API components) or with 3rd-party hardware.

When simulating an embedded app (i.e. using Flowcode with an Embedded project rather than an App Developer project), there should be ways for the simulation to interact with "real" serial data. For example, if you are using the UART component in your project then there is a "Data Source" property under the "Simulation" group of the component properties that should allow you to link directly with the USB device that is usually connected to the Raspberry Pi. The reference for this component's properties are here:

https://www.flowcode.co.uk/wiki/index.p ... _reference