Making C++ Application Communicate With Turing Application
Author |
Message |
Ryan.W.S
|
Posted: Wed Jan 09, 2013 12:19 am Post subject: Making C++ Application Communicate With Turing Application |
|
|
Hi,
I was wondering if there is any way I can get a C++ program to pass messages to and from a Turing program on the same computer. The operating system will be Windows XP, and the reason for doing this is that I need to use turing to interface with the special turing parallel port driver, to interface with the parallel port.
The alternative would be if anyone knows an easy way to install and operate a parallel port driver via C++ (need it for breadboards, Computer Engineering)
Thanks very much,
Ryan
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
jr5000pwp
|
Posted: Wed Jan 09, 2013 12:30 am Post subject: RE:Making C++ Application Communicate With Turing Application |
|
|
I don't know anything about C++, and I don't know anything about parallel ports, but two things come to mind when I read this.
1) Use networking with a loop-back ip (127.0.0.1 or localhost)
2) Write to a text file.
I would assume this wouldn't be necessary as there should definitely be a way to do it fully in C++ |
|
|
|
|
|
ryan.s
|
Posted: Wed Jan 09, 2013 12:49 am Post subject: Re: Making C++ Application Communicate With Turing Application |
|
|
Thanks for the fast reply!
Those were both the only 2 ways I could come up with, if keeping turing in it is a must. The only issues:
Network - the turing network module seems to be completly broken, in that it crashes the turing environment when you call one of its functions.
File - seems like the way to go, but how do I prevent simultaneous access to the same file? Would it cause a crash if, say turing reads to the file while C++ program writes to it?
I really wish I could just go straight C++, but i doubt the school has the drivers setup and forcing them to install as well as getting my code working could be hit and miss
Any thoughts on what I could to to prevent both programs from accessing the same file at the same time? Would making 2 files (one C++>>turing, other Turing >> c++) help?
Thanks,
Ryan
Ps: sorry if there is another forum, I found out I already had an account here after i made a new one and posted under it... I think I deleted that reply but how do i delete the new account? |
|
|
|
|
|
[Gandalf]
|
Posted: Wed Jan 09, 2013 7:27 pm Post subject: RE:Making C++ Application Communicate With Turing Application |
|
|
My gut tells me you should just do everything in C++, but...
Network - The Turing network module should work. If it isn't, try a different version of Turing from http://compsci.ca/holtsoft/
File - The problem here will indeed by managing file locks. Getting this to work will be more trouble than it's worth. |
|
|
|
|
|
ryan.s
|
Posted: Thu Jan 10, 2013 1:36 am Post subject: Re: Making C++ Application Communicate With Turing Application |
|
|
I managed to get file based communication to work... I don't know if I am up to socket programming yet, especially with fire walls and such.
The system goes both ways, but is slow in terms of latency (probably fine for the purpose though, and potential to be sped up.)
If anyone is interested I can post either source code, they are roughly mirror images of eachotther (just translated, with some exceptions)
Thanks for the suggestions and help,
Ryan |
|
|
|
|
|
|
|