Page 1 of 3

Pass measages

Posted: Sun May 15, 2022 10:18 pm
by wayne_millard
Hi Everyone,

Is there a way to send ethernet measages from one App to another on a differant PC.
Would like to send data that is captured on one app and send it to a differant computer running a second app to display the data?

Thanks,
Wayne M

Re: Pass measages

Posted: Mon May 16, 2022 8:44 am
by Steve-Matrix
The vNet Injector might be what you're looking for:
https://www.flowcode.co.uk/wiki/index.p ... Injectors)

Re: Pass measages

Posted: Mon May 16, 2022 4:58 pm
by wayne_millard
Hi Steve,

Thanks for the reply.

What im trying to do is send some float values to a static text box. which i have in the main code and wont to copy on second display over network.
Is there a way to copy the static text display on second screen.

Thanks,
Wayne M :D

Re: Pass measages

Posted: Mon May 16, 2022 5:56 pm
by Steve-Matrix
Sorry. I've never used that component, but it sounds like it should do what you want.

Have you tried looking at the vnet examples?

Re: Pass measages

Posted: Mon May 16, 2022 6:09 pm
by wayne_millard
Hi Steve.

Yes I have had a look and can see how to send switch values to control LEDS. But can't see how I can use to send float values to a second app.

Thanks,
Wayne M

Re: Pass measages

Posted: Tue May 17, 2022 9:05 am
by Steve-Matrix
Looking at the macros for the component, it sends and receives byte values. You could try converting your float value to a string, send it as a sequence of bytes, and then recreate the string at the other end.

Re: Pass measages

Posted: Wed May 18, 2022 11:25 am
by wayne_millard
Hi Steve,

Sorry to be a pain. But i have had a play with VNet and found that it is not available in App developer.

Thanks,
Wayne

Re: Pass measages

Posted: Wed May 18, 2022 12:01 pm
by Steve-Matrix
Ok. I'll ask around and see if we can think of an alternative.

Re: Pass measages

Posted: Wed May 18, 2022 4:31 pm
by BenR
Hello,

Hmm shame that vNet is not available in AD, I might look into this and see what we can do here.


For now the following should provide an example of fairly robust server and client type comms as we use with our AllCode systems and should be a bit more flexible then the vNet approach.

The server sits and waits for clients to connect to it. It then pulls in any data sent to it and looks for a command start code ":" followed by a command body and terminated with a command end code ";\n".

Once it receives this it processes the command. The first byte sent after the command start is the command code and tells the server what the client is trying to do. This then provides the basis on what to do next, bytes to send and receive etc.

In the examples I have two commands A and B which are created in the ProcessCommand macro.

A takes a floating point value from the client and passes to the server.

B takes a floating point value from the server and passes to the client.

Hopefully fairly straightforward but let us know how you're getting on with this.

To make the apps run simply start the server app running. Then on the client app you just need to enter the IP address of the server into the properties window and then the client app should run and connect and allow two way data. Both apps can run on the same PC for testing purposes.

AD_Server.fcsx
(22.91 KiB) Downloaded 247 times
AD_CLient.fcsx
(19.95 KiB) Downloaded 248 times

To keep things organised and easier to debug we generally draw up an API table that shows what each command will do in terms of parameters and returns. This is an example taken from our AllCode Robot Arm.
RobotArmAPIv2.xlsx
(13.13 KiB) Downloaded 261 times

Re: Pass measages

Posted: Wed May 18, 2022 4:35 pm
by wayne_millard
Hi Ben,

Thanks for the example i will have a look.

Wayne