Is it possible to use USB device within a simulation

For general Flowcode discussion that does not belong in the other sections.
Post Reply
RGV250
Posts: 279
http://meble-kuchenne.info.pl
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 25 times
Been thanked: 30 times

Is it possible to use USB device within a simulation

Post 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

mnfisher
Valued Contributor
Posts: 984
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 105 times
Been thanked: 516 times

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

Post 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

RGV250
Posts: 279
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 25 times
Been thanked: 30 times

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

Post by RGV250 »

Hi Martin,
Unfortunately this is for a Raspberry Pi which AppDeveloper is not available for.

Bob

chipfryer27
Valued Contributor
Posts: 1178
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 417 times

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

Post 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

mnfisher
Valued Contributor
Posts: 984
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 105 times
Been thanked: 516 times

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

Post by mnfisher »


Steve-Matrix
Matrix Staff
Posts: 1269
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 168 times
Been thanked: 283 times

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

Post 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

Post Reply