External CAN Interface via an API

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
jay_dee
Posts: 130
http://meble-kuchenne.info.pl
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 46 times
Been thanked: 29 times

External CAN Interface via an API

Post by jay_dee »

Interfacing with external devices via an API, this may be more involved to implement than I appreciate.

Both PEAK and KVASER offer an API to interface with their USB based CAN interfaces.
I'm thinking this would strongly complement FAD applications as you could pull realtime CAN messages and process them localy.

I've worked sucessfully with a PIC reading CAN messages and I could pass this over to FAD via USB.
But my PIC programming would need to be top notch to avoid missing data, applying filters etc.

Some years ago, we had a standalone interface written that used the PEAK C# API and this seemed to handle the CAN data seemlessly.... so you got really good CAN reading performance for relativly tiny cost.

PEAK CAN modules are reliable and quite well supported, they are also not crazy money (from a commercial perspective)
Microchips CAN tool was cheaper but also seemed to drop data at higher rates.
Thanks, J.
(I've had a weekend of trying ideas out on FC/FAD...thus a monday morning mind dump on the forum! )

User avatar
p.erasmus
Valued Contributor
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: External CAN Interface via an API

Post by p.erasmus »

Hi jay_dee
Microchips CAN tool was cheaper but also seemed to drop data at higher rates
The user manual expicitly specify that the tool is for interactive development so slow incoming and logging signals it is not intended for High speed and High bus load logging as the Peak ,Kvaser or vector modules for that matter :D :D
Regards Peter - QME Electronics

jay_dee
Posts: 130
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 46 times
Been thanked: 29 times

Re: External CAN Interface via an API

Post by jay_dee »

Hi,
We have a couple of projects in the pipeline using CAN and think that App Developer could be a useful way to graphically represent the states and values of the CAN data to end users.
Currently using the low cost PCAN-USB device by Peak Systems. Peak also provide a API for the device.

We have previously worked on a custom 'display' applications using this PCAN-Basic API (there are API examples in C++, C#, C++/CLR, Delphi, VB.NET, Java, and Python 3.x) but each time the project updated or new values needed to be shown to the end user and it would require a re-write of the application.

It occurs to me that there may be a better way and worth looking at making the Peak Interface communicate with somthing like App Developer. User display programs would then be a simple matter to develop or update.

Is there a process to allow third party software to interface with App developer?

Steve-Matrix
Matrix Staff
Posts: 1234
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: External CAN Interface via an API

Post by Steve-Matrix »

jay_dee wrote:
Mon Jan 17, 2022 4:06 pm
Is there a process to allow third party software to interface with App developer?
You can call DLLs from within an App Developer project. The wiki has some info on this:
https://www.flowcode.co.uk/wiki/index.p ... LL_Support

jay_dee
Posts: 130
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 46 times
Been thanked: 29 times

Re: External CAN Interface via an API

Post by jay_dee »

Hi,
Just playing about with DLLs in AppDev.
This example is created from an example in the Wiki and retrieves the system Time.
DLL_DateTime_Example.fcsx
(11.41 KiB) Downloaded 104 times
There is a second Wiki, which briefly covers creation of a demo DLL in C++. Is there a compiled copy of DemoDLL.DLL available? ;)

Given my lack of coding I think I will have to outsource the DLL creation for my project but are there any opensource / documented DLLs that I get used to working with within AppDev.
There are plenty of examples on the web about DLL creation but I can find anything that is a Documented and Compiled DLL, with which to practice interfacing with.
thanks, J.

jay_dee
Posts: 130
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 46 times
Been thanked: 29 times

Re: External CAN Interface via an API

Post by jay_dee »

Ah.. I found a reference to MIAC DLL but could not find any documentation to this. I've got a few MIACs and a V3 dsPIC MIAC left over from another project so it would be agreat platform to play with.
Failing that there is the Velleman interface board and seems to have sensible doucmentation, at least enough to play with.

Post Reply