Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
kraftwerk
21
Years of Service
User Offline
Joined: 10th Apr 2005
Location: isle of wight
Posted: 7th Mar 2011 13:09
Hi all
I want to send data between to or more programs .I think the easiest way would be to write a file from one then the other reads this but is there another way with out using up clipboard or files.I was thinking of some memory that both/all programs could share.
thank any help would be top

http://www.facebook.com/cloudjanus
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Mar 2011 14:03
Text files are about the easiest method of communication but I guess it depends how quick you need them to be able to communicate?

We changed recently (where I work) from simple text files to databases and various other new systems for our interface data as well as 3D model data and it's caused no end of hassle. The data is much harder to check, change and understand since we left the old text files behind... that's just one person's experience though.

Unless there's a speed issue I'd just say stick with text. You can always use encryption algorythms (not so hard to come up with something) if the data is sensitive.

kraftwerk
21
Years of Service
User Offline
Joined: 10th Apr 2005
Location: isle of wight
Posted: 7th Mar 2011 14:24
Cheers baxslash
yes I need it to send timing so all programs run in time.
i think files would do but I'm looking for something in memory.DBP has memory block but I don't think all programs can share other block.
thank

http://www.facebook.com/cloudjanus
bitJericho
23
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 7th Mar 2011 15:10 Edited at: 7th Mar 2011 15:22
You'd be best off using tcp traffic in this case. Since timing is an issue.

Two programs on the same computer can communicate via tcp just as easily as two programs in different computers. Just use localhost or 127.0.0.1 for the ip address.

Textfiles will be slow and timing will not be easily possible without some serious rigging. Trying to use shared memory is probably just going to be mindblowingly frustrating.

tcp/ip communication is the way to go as you can share data and timing fairly easily with almost no latency if running all on localhost.

You'd have the added ability of being able to run parts of your application on two separate networked computers with no real change to your software (though latency may cause issues depending on what you're doing)

[center]
Join the TGC Group!
http://tehcodez.groups.live.com
kraftwerk
21
Years of Service
User Offline
Joined: 10th Apr 2005
Location: isle of wight
Posted: 7th Mar 2011 15:36
thank Jerico2day
I didn't think of TCP.sounds perfect.
now to read up in it.
thanks all

http://www.facebook.com/cloudjanus
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Mar 2011 20:15
It'd be easier to use shared memory instead of networking commands.

Compile the following to a program named 'master':


Compile the following into a program named 'slave':


Run a few of the slave program, and one of the master. With the master program selected, just press space bar a couple of times - each time you do, the slave programs will respond.

You have to take care when running multiple DBPro programs together - they will pretty much run flat out and use all of your available processor cycles. That's why I used SYNC SLEEP in both programs, and NICE WAIT in the slave program.

kraftwerk
21
Years of Service
User Offline
Joined: 10th Apr 2005
Location: isle of wight
Posted: 7th Mar 2011 20:20
Cheers IanM
thank for taking the time for the code

http://www.facebook.com/cloudjanus
sadsack
22
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 8th Mar 2011 00:03
IanM I don't have the lates update so that maybe it, I can't compile it sync sleep 1 will not compile.
thanks
renny



Life is not fair, so deal with it.
http://www.gusroundtable.com/
Wyldhunt
16
Years of Service
User Offline
Joined: 27th Sep 2009
Location: The Dark Side
Posted: 8th Mar 2011 06:38
Make sure that you have the Matrix1 utilities out of IanM's sig link. Everyone should have it. Not sure why it's not included with DBP by default...

See if it'll compile with his plugin. I know you'll need it for Nice Wait.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Mar 2011 14:12
@sadsack,
The SYNC SLEEP command was added to DBPro literally years ago. I'd advise you to upgrade to at least the 7.5 release - you can find links to all releases in my release details thread in the bug forum.

If you have a reason not to, then you don't really need to as IIRC, the commands I used from my plug-ins don't rely on any new DBPro internals and so should run without problem. Just remove the offending command.

sadsack
22
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 8th Mar 2011 23:29
Thank you
renny

Life is not fair, so deal with it.
http://www.gusroundtable.com/
sadsack
22
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 9th Mar 2011 00:59
I upgraded to 7.5 and now this line will not compile

map shared mem to bank "SYNCHRO", 1, 4096


so i would like to be able to use this but it not looking good
renny



Life is not fair, so deal with it.
http://www.gusroundtable.com/
sadsack
22
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 9th Mar 2011 01:19 Edited at: 9th Mar 2011 01:25
I see i need your plugin I will download it now.
Is there a way I can download all the help files?
renny

EDIT: Never mind, I see the help comes with the download.

Life is not fair, so deal with it.
http://www.gusroundtable.com/
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Mar 2011 14:03

Login to post a reply

Server time is: 2026-07-15 03:40:14
Your offset time is: 2026-07-15 03:40:14