Jump to content

Dumb C/Visual Studio Question


Recommended Posts

Hi guys,


I use V Studio and usually code in V Basic as I find it easier.


I want to knock up a program for controlling my heating system (eq-Max).

There is some C code out in the wild that will interface with the unit and do all the connection and integration but it is the form of cpp & h files and to be honest I don't know where to start with them.

For reference, https://github.com/KnuthLohse/MAXCPP/tree/master/DiffSet


Can I mix 'n match C with VB by calling the cpp & h files at all?

Do I need to write in C?

If so, how do I then integrate the supplied code with my code?


Worst case the protocols are known so I can start from scratch but obviously would rather reuse what is already out there.


TIA for any pointers for a dumb VB hick.



Link to comment
Share on other sites

Been doing some digging and it seems that the way forward is to convert the C code to a dll (somehow...) and call the dll from within VB.


All I need to do now is convert the code to this dll. The implication is that I need to reference the calls in the dll and get the VB to then reference it.

Sounds a bit hard but I'll see if I can find some guides.

Link to comment
Share on other sites

Hi l0gic


Is that not just a c port of this?


If so, the above is already in a library and comes with an example project too (albeit all of this is in c#, not vb).


I downloaded it and it builds but I don't have the hardware to test.


Set MaxSharpExample as the startup project, check ELVMAX_Cube_IP_Adress and ELVMAX_Cube_Port in Main.cs and give it a go.


If it works I will convert the example to VB.net for you.


  • Like 2
Link to comment
Share on other sites


Nice one kccsf!


I've tried it with my IP settings and the console is pumping away readings.

All stats & rad valves look like they are there.

It only reads, the code is not there to write to the cube to set values but I _may_ not need that at least in the short term.


I've had a quick go at changing it into a form based program rather than a console and faffed it up already.

C variations are just not my 'thing'.


If you could convert the example to VB that would be great and I should be able to take it from there.

I'm a one trick pony - I know!


Cheers for all your help.



Link to comment
Share on other sites

Hi l0gic



(Doesn't let me upload zip or rar here)


Archive contains the source from the repo to which I've added MaxSharpFormExample.


As per before set the ip and port albeit this time within Form1.vb in the MaxSharpFormExample project and if it is not already, set it as your startup project.


Let me know how it goes


Link to comment
Share on other sites

Hi Steve,

fantastic mate.

Changed the IP and it all runs - sweet.


I'll now start pulling out the feed and splitting it into discrete room data so I can present it as data in a section for each room.

Maybe even graphing it, who knows.


Again, thanks for the assistance. I can now progress in my recognisable VB bubble :)





Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...