Pass measages

Discuss PC Developer and Web Developer projects and features here.
wayne_millard
Posts: 94
http://meble-kuchenne.info.pl
Joined: Fri Dec 04, 2020 6:12 pm
Has thanked: 1 time
Been thanked: 9 times

Pass measages

Post 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

Steve-Matrix
Matrix Staff
Posts: 1233
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: Pass measages

Post by Steve-Matrix »

The vNet Injector might be what you're looking for:
https://www.flowcode.co.uk/wiki/index.p ... Injectors)

wayne_millard
Posts: 94
Joined: Fri Dec 04, 2020 6:12 pm
Has thanked: 1 time
Been thanked: 9 times

Re: Pass measages

Post 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

Steve-Matrix
Matrix Staff
Posts: 1233
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: Pass measages

Post 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?

wayne_millard
Posts: 94
Joined: Fri Dec 04, 2020 6:12 pm
Has thanked: 1 time
Been thanked: 9 times

Re: Pass measages

Post 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

Steve-Matrix
Matrix Staff
Posts: 1233
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: Pass measages

Post 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.

wayne_millard
Posts: 94
Joined: Fri Dec 04, 2020 6:12 pm
Has thanked: 1 time
Been thanked: 9 times

Re: Pass measages

Post 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

Steve-Matrix
Matrix Staff
Posts: 1233
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 167 times
Been thanked: 277 times

Re: Pass measages

Post by Steve-Matrix »

Ok. I'll ask around and see if we can think of an alternative.

BenR
Matrix Staff
Posts: 1706
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Pass measages

Post 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 237 times
AD_CLient.fcsx
(19.95 KiB) Downloaded 235 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 243 times

wayne_millard
Posts: 94
Joined: Fri Dec 04, 2020 6:12 pm
Has thanked: 1 time
Been thanked: 9 times

Re: Pass measages

Post by wayne_millard »

Hi Ben,

Thanks for the example i will have a look.

Wayne

Post Reply