Page 2 of 3

Re: Pass measages

Posted: Wed May 18, 2022 4:46 pm
by BenR
Slight tickle to the client code here to make the comms run faster. If we have no data to receive then we don't wait the timeout period any more.
AD_CLient.fcsx
(19.9 KiB) Downloaded 181 times
I've also addd the examples to this page on the wiki.
https://www.flowcode.co.uk/wiki/index.p ... r_Examples

Re: Pass measages

Posted: Sat May 21, 2022 12:14 pm
by wayne_millard
Hi,

How do I send and receive strings?.

Thanks,

Wayne Millard

Re: Pass measages

Posted: Mon May 23, 2022 9:56 am
by BenR
Hello,

Sending a string should be simple enough,

To send a string from the client to the server you would construct a command using the standard approach e.g. : followed by the command code. Next if you want to send multiple strings you might send an index byte. Next you would send the string data a byte at a time followed by sending a 0 or null byte. Finally send the command end ;\n. The server would receive the command and then pull data into a string a byte at a time until the null value is received.

To send a string from the server to the client you again would issue the command from the client, again maybe with an index to specify one out of a number of strings. Then the server would respond with the string data and null byte. The client should try and pull in a maximum number of bytes e.g. 255 and this can put it into a special case where it knows it's receiving a string and will receive until it collects the null byte.

I can edit the examples with this functionality if it would help.

Re: Pass measages

Posted: Mon May 23, 2022 10:57 am
by wayne_millard
Hi Ben,

Would love to see a example it would help a lot.

Thank you for your help.

Wayne M

Re: Pass measages

Posted: Mon May 23, 2022 12:15 pm
by BenR
Ok here you go, I've added commands C and D to send and receive string data and added an index byte into each command to make it easier to assign the values to useful things without having to create more unique commands.

For the client the index is specified as a parameter to the set/get macro.
For the server the index is processed in each branch of the ProcessCommand macro

AD_Client.fcsx
(29.26 KiB) Downloaded 170 times
AD_Server.fcsx
(32.41 KiB) Downloaded 171 times

Hopefully makes things a bit easier to work with.

Re: Pass measages

Posted: Wed May 25, 2022 3:28 pm
by wayne_millard
Hi Ben,

I have tried to intergrate the server and client into project but have problems.
I have a App Developer app that get information from a device with a Xport ethernet to serial comms device on.
So app communicates with devide using IP address and port number that all works ok.
Want to send data to a second computer using another app using your server and client.
I can get any of the two working by them self but not to geather.
What do i need to i have tried everything.

Thanks,
Wayne M :oops: :oops:

Re: Pass measages

Posted: Wed May 25, 2022 3:44 pm
by BenR
Hi Wayne,

Do you have two network comms components in your program or are you trying to pipe all the comms through one? I think you will need to have two components if you don't already.

Re: Pass measages

Posted: Wed May 25, 2022 4:04 pm
by wayne_millard
Hi Ben,

I tried it first with two ethernet component's but could not get that to work and then tried one and can't get that working. So very stuck.

Thanks
Wayne M

Re: Pass measages

Posted: Thu May 26, 2022 10:24 am
by BenR
Hi Wayne,

Ok thanks I'm looking into it for you now.

Re: Pass measages

Posted: Thu May 26, 2022 10:27 am
by wayne_millard
Thanks Ben
It seems as if I use two ethernet com component's one affects the other from working.

Wayne