Page 1 of 1

External CAN Interface via an API

Posted: Mon Nov 01, 2021 11:02 am
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! )

Re: External CAN Interface via an API

Posted: Wed Nov 10, 2021 10:13 am
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

Re: External CAN Interface via an API

Posted: Mon Jan 17, 2022 4:06 pm
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?

Re: External CAN Interface via an API

Posted: Mon Jan 17, 2022 4:37 pm
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

Re: External CAN Interface via an API

Posted: Sun Jan 23, 2022 12:09 pm
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 110 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.

Re: External CAN Interface via an API

Posted: Sun Jan 23, 2022 1:43 pm
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.