Send TCP Commands

Is there any way to send TCP strings to a TCP client (either configured in the script or the one configured in the configuration->Remote Control)? I saw somewhere an ITCPRemote interface, but can’t figure out how to use it.

There is this function:

procedure TCPSendString(iServer: string; iPort: word; iString: AnsiString);

It will open the TCP connection, send the string, then close the connection.

Persistent connections are much more difficult…

TCPSendString worked great, as did UDPSendString.
Is there any way to receive reply packets to a UDP string? Tried UDPRecieveString with no success, I assume you don’t use the same library as the net one I found, but do you have a simple command to read a UDP string rent as a reply to the one I send from the script? No need to persistent connections, just an immediate receive.

For what kind of messages? Do you have control over their content (software developed by yourself)? Or third-party software?

It’s for a status report of a third party hardware, but I think at this point we figured we get the status through relays and not UDP and TCP strings.

Hi, OSC and scripting is new for me.

I have a Behringer XR18

Can someone help me with this one ?
When a midi command is received, a OSC command (fader 15 solo ON) has to be sent to the XR18:

procedure OnLoad;

procedure OnMidiMessage(Device: integer; Status, Data1, Data2: byte);
begin
if (Status = $B1) and (Data1 = $10) and (Data2 = $7F) then

procedure UDPSendString(iServer: string; iPort: word; iString: AnsiString);
begin
+++ this should be sent +++
192.168.0.50";10024;"/-stat/solosw/15~~~~,i~~[ 1]"
++++++++++++++++++++++++++++
end;
begin
end.

Thank you very much.

Hi Gregory,

please think of marking your code before posting.

If I get you right it should look like this:

procedure OnMidiMessage(Device: integer; Status, Data1, Data2: byte);
begin
  if (Status = $B1) and (Data1 = $10) and (Data2 = $7F) then
    UDPSendString('192.168.0.50', 10024, '/-stat/solosw/15~~~~,i~~[ 1]');
end;

begin
end.

(Untested, for obvious reasons.)

Sent regards

TSD

1 Like

(post withdrawn by author, will be automatically deleted in 24000 hours unless flagged)

OSC info :
/‐stat/solosw/[id] enum {OFF, ON}, int with value 0 or 1 0/1 for on/off of solo switch [id]: 01-32: Ch 01-32 33-40: Auxin 1-8 41-48: FxRtn 1-8 49-64: Bus master 01-16 65-70: Matrix 1-6 71: L/R 72: Mono/Center 73-80: DCA 1-8

Thx but I still have a problem with the UDPSendString
I need to sent :
/-stat/solosw/15 ,i 1
or
/-stat/solosw/15 ,i 0

When I use ‘X-Air Live Toolbox’ the code is correctly executed.
But when I use it with the UDPSendString :

UDPSendString('192.168.0.50', 10024, '/-stat/solosw/15 ,i 1');

it doesn’t work.

Script syntax looks good, and if you receive no error in the log, it should be fine.

Have you checked with Wireshark if the packet is sent anyway?

If yes, it can be an issue of OSC syntax (I’m not an expert).

Just got the hint that OSC actually expects ASCII 0 characters instead of spaces (ASCII 32).

UDPSendString('192.168.0.50', 10024, '/-stat/solosw/15‘ + #0 + ‘,i‘ + #0 +‘1');

Indeed.
Tom explained it.
So the problem was solved.
Thanks anyway and take care.

Always good to have a solution documented in the forum :wink: