Search found 72 matches

by Ksawery
Sun Jul 28, 2019 1:45 pm
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 377

Re: Infinite loop running in the background

That makes sense, it now works, thank you!
by Ksawery
Sun Jul 28, 2019 12:00 pm
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 377

Re: Infinite loop running in the background

Thank you for your quick reply, that helped solve the problem of the application hanging on wxCriticalSectionLocker lock(m_dataCS) , however I'm still unable to close the window (the window remains where it was and I have to manually terminate the application in the debugger). I'm still not sure why...
by Ksawery
Fri Jul 26, 2019 2:26 pm
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 377

Re: Infinite loop running in the background

Thank you, I will try to use wxThreadHelper for now, but I will also take a look at the code you provided :) Just for comparison, here is a very simple complete example using just wxThread, where instead of Sleep()ing, one could communicate with the device #include <wx/wx.h> #include <wx/thread.h> c...
by Ksawery
Fri Jul 26, 2019 2:06 pm
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 377

Re: Infinite loop running in the background

Thank you, I used the code template provided, and wxThreadHelper works pretty well. The only problem I have is that when I attempt to close the frame (which is my main GUI window), the application hangs and the window doesn't close. What's the issue here, do I need to call some code from the destruc...
by Ksawery
Fri Jul 26, 2019 12:26 pm
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 377

Re: Infinite loop running in the background

Thank you, I'll give it a read.
by Ksawery
Fri Jul 26, 2019 11:40 am
Forum: C++ Development
Topic: Infinite loop running in the background
Replies: 9
Views: 377

Infinite loop running in the background

I'm building a GUI which will use data continuously received via a serial port. I'd like to setup a loop that will always run in the background, poll for new data (via a Modbus protocol) and update the text in the main GUI window. What would be the best way to implement this? Do I need to create a n...
by Ksawery
Fri Jul 26, 2019 10:03 am
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 610

Re: Using libmodbus with wxWidgets

Ok, I re-compiled libmodbus in 32-bits, instead of re-compiling wxWidgets in 64-bits, and... http://www.quickmeme.com/img/14/14b5cf9333e7faf072cc4b453793df731bd73de847eaf650ecc6d470b83a18ce.jpg So it was 32/64 bit compatibility after all. I still needed to ensure the order of headers was correct and...
by Ksawery
Fri Jul 26, 2019 9:34 am
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 610

Re: Using libmodbus with wxWidgets

Thanks, I'll recompile wxWidgets to ensure its 64-bits and test the application again.

Regards,
Ksawery
by Ksawery
Fri Jul 26, 2019 9:29 am
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 610

Re: Using libmodbus with wxWidgets

Could it be that the 64-bit compiled library may be in conflict with the 32-bit wxWidgets library? Now i'm not sure which version of wxWidgets I built, perhaps that's the issue here.
by Ksawery
Fri Jul 26, 2019 9:09 am
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 610

Re: Using libmodbus with wxWidgets

Thanks for your reply. I built the library myself, using the instructions provided in the readme, at the following repository: https://github.com/stephane/libmodbus I built the library in Visual Studio 2019, Windows x64. I then linked the source/header and .dll files into the wxWidgets project, in t...
by Ksawery
Thu Jul 25, 2019 3:34 pm
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 610

Re: Using libmodbus with wxWidgets

Thank you. Unfortunately changing the order of includes made things worse. I managed to get the application to run by suppressing the error/warnings using: #pragma warning(disable:4996) However I'm unable to call the library functions: /* Initialize MODBUS */ modbus_t* ctx; ctx = modbus_new_rtu("\\\...
by Ksawery
Thu Jul 25, 2019 12:45 pm
Forum: Compiler / Linking / IDE Related
Topic: Using libmodbus with wxWidgets
Replies: 8
Views: 610

Using libmodbus with wxWidgets

Hello, I'm starting to learn wxWidgets through online tutorials, and so far I have successfully created a very basic GUI in Visual Studio 2019. I was planning on using wxWidgets to create a GUI for a Modbus RTU RS-232 Master application, which will communicate over the serial line with a Modbus slav...