I would be very grateful if someone could point me in the right direction to 'broadcast' a string thru an Ethernet connection.. I've attached a sample program that I've started if someone might have a couple minutes to take a quick look and perhaps directly add a couple net lines that would be required or maybe direct me to a similar example somewhere that would explain specific details.
Background... we have a Unitronics V1040 plc controlling a small machine we're providing and the customer has an existing software program (specifics of which is unknown to us) that apparently picks broadcasted data from various machines connected to there Ethernet network. They have asked us to broadcast a couple of the variables from our plc to the network in the following format: <STX>(11<HT>1<HT>[VARIABLE1]<HT>2<HT>LB<HT>4<HT>1<HT>83<HT>[VARIABLE2]<HT>57<HT>[VARIABLE3]<ETX>, where the three variables are memory locations in the plc (2x MI & 1x ML locations).
Several questions hoping someone can confirm or provide better direction on where to start:
1) I believe this needs to be done with UDP since a "broadcast" (to ip address 255.255.255.255 ?) is desired instead of direct communication with a specific pc/plc&port#. Does this sound correct?
2) How would one assemble a single text string which combines the various string constants with program variables? I'm quite inexperienced but from trying to research this before asking for help here, I think this is basically a tab delimited text string? Does that look to be the case?
What I've done so far:
1) SB2 power up bit... have a PLC NAME set, have a TCP/IP CARD INIT with valid IP's set, and have a TCP/IP SOCKET INIT set for (Socket 2, UDP-RAW, Port 20257).
2) We would also like to be able to remote into the plc from what best I can tell would be thru Socket1 which is already setup for this by default and doesn't need to have a SOCKET INIT included in the code.? Is this correct? or would it be better practice to go ahead and place it also in the code?
3) Even if above steps is close.. that is where I'm at as I can not figure out how to get the string assembled. Looking at available command options, I'm thinking I need a vector of MI locations that could then be used with a UDP_RAW SEND FB.?
Anyways... thanks in advance to anyone who can take a couple minutes to look at this and help me out with some of the details or a specific example showing something similar.
text test.vlp