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.
I've also addd the examples to this page on the wiki.
https://www.flowcode.co.uk/wiki/index.p ... r_Examples
Pass measages
-
- Matrix Staff
- Posts: 1924
- http://meble-kuchenne.info.pl
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: Pass measages
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 94
- Joined: Fri Dec 04, 2020 6:12 pm
- Has thanked: 1 time
- Been thanked: 9 times
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: Pass measages
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 94
- Joined: Fri Dec 04, 2020 6:12 pm
- Has thanked: 1 time
- Been thanked: 9 times
Re: Pass measages
Hi Ben,
Would love to see a example it would help a lot.
Thank you for your help.
Wayne M
Would love to see a example it would help a lot.
Thank you for your help.
Wayne M
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: Pass measages
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
Hopefully makes things a bit easier to work with.
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
Hopefully makes things a bit easier to work with.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 94
- Joined: Fri Dec 04, 2020 6:12 pm
- Has thanked: 1 time
- Been thanked: 9 times
Re: Pass measages
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

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


-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: Pass measages
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 94
- Joined: Fri Dec 04, 2020 6:12 pm
- Has thanked: 1 time
- Been thanked: 9 times
Re: Pass measages
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
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
-
- Matrix Staff
- Posts: 1924
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: Pass measages
Hi Wayne,
Ok thanks I'm looking into it for you now.
Ok thanks I'm looking into it for you now.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 94
- Joined: Fri Dec 04, 2020 6:12 pm
- Has thanked: 1 time
- Been thanked: 9 times
Re: Pass measages
Thanks Ben
It seems as if I use two ethernet com component's one affects the other from working.
Wayne
It seems as if I use two ethernet com component's one affects the other from working.
Wayne