FAD and DLL calls

Discuss PC Developer and Web Developer projects and features here.
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

FAD and DLL calls

Post by jay_dee »

Hi, I've been playing a bit with DLL calls and getting values from thirdparty software/devices.

With my current examples, I setup a DLL call within a Macro component. It allows multiple parameters to be sent to the DLL and a single return variable.

Is there a way to recieved a block of values, with a single DLL call?
In my case, I would be loooking at recieving a processed CAN message, this might contain around 12 bytes. 8 data, DLC, ID etc...

Would I just recieve a string and then chop it up into its constituant parts, breaking out the 12 seperate data bytes.
thanks, J.

BenR
Matrix Staff
Posts: 1726
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 438 times
Been thanked: 602 times

Re: FAD and DLL calls

Post by BenR »

Hello,

If the macro parameter has an array of bytes or ints etc then this is passed by ref and so you can basically pass blocks of data in or out of a DLL by using this method. A return string basically does the same thing but probably should be avoided as any 0's in the data would potentially be seen as a null termination.

If you see the UART/COMPort component Send and Receive Array functions then this should give you the idea.

Example.jpg
Example.jpg (39.87 KiB) Viewed 1816 times

Another way without using arrays would be to store the data inside the DLL and then have a macro to pull out the data a single value at a time. You might have a getCount macro which checks for stored data and a getData macro which gets the next data value.

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

Re: FAD and DLL calls

Post by jay_dee »

Thanks ben, i'll have a try. J.

Post Reply