-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using TinyG in WPF Project #282
Comments
Tinyg uses a serial port to send data. It also maintains a state in the
firmware. If you are writing to the serial port with multiple threads,
while this could be possible I think your design is flawed. You should
setup a thread to write data to the board and then use a queue etc to put
data that needs to be sent. You could then have threads push data into
that queue. Not understanding what you are going for really. This is more
of a general software design follow up.
Riley
…On Fri, Jan 5, 2024 at 9:12 AM Javid Majidzade ***@***.***> wrote:
Hello, I have a big project where the motors are used to move the arms of
goniospectrophotometer. And as I understood WPF causes some thread related
problems, because TinyG driver, which is in C++ is not thread safe. I put
mutexes in the source code of C++ and WPF project and now it works better,
but still not ideal. If I put getranges() 10 times in a row, on 3rd or 4th
try it will give some corrupted values like 1.323411414 or 2.12312441. Who
knows how to fix it, or maybe someone has thread safe version of this
driver.
Thank you in advance!
—
Reply to this email directly, view it on GitHub
<#282>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABYSMYQJX7YXYOYHEB2R5TYNAC4HAVCNFSM6AAAAABBOPQ6NWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA3DONBRHAZTKMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thank you, but I'm talking about cpp version of TinyG driver, that was sent to me. I created C++/CLI wrapper for it and added mutexes to make it thread safe, but it doesn't work perfect still. Maybe you have an idea how I can fix it. Repo: https://github.com/David-Vice/Thread-Safe-Wrapper Thank you in advance! |
Just out of curiosity... What DLL are you referring to? |
The code I gave generates Optel_TinyG.dll and isomove.dll |
This is not our code. You should talk to the author of that code.
riley
…On Sun, Jan 7, 2024 at 3:55 PM Javid Majidzade ***@***.***> wrote:
Just out of curiosity... What DLL are you referring to?
The code I gave generates Optel_TinyG.dll and isomove.dll
—
Reply to this email directly, view it on GitHub
<#282 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABYSM6M4XPZR5NNRAQTYH3YNMDU3AVCNFSM6AAAAABBOPQ6NWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBQGE3DQNJZGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Not sure who or what Optel is, but i second @ril3y. Unless you are not the author, you should search out for help where you found that source. |
Hello, I have a big project where the motors are used to move the arms of goniospectrophotometer. And as I understood WPF causes some thread related problems, because TinyG driver, which is in C++ is not thread safe. I put mutexes in the source code of C++ and WPF project and now it works better, but still not ideal. If I put getranges() 10 times in a row, on 3rd or 4th try it will give some corrupted values like 1.323411414 or 2.12312441. Who knows how to fix it, or maybe someone has thread safe version of this driver.
Thank you in advance!
The text was updated successfully, but these errors were encountered: