Studio 5000 MSG instruction change path during runtime?

In my case, I was programmatically changing the characters inside the IP address text section of the Path string.

I didn't realize that the Length of the IP address text is encoded with a single byte inside that path segment, as well as being accounted for in the 32-bit .LEN of the Path string. And I didn't realize they were padded to be even.

Those details won't matter for your application because it sounds like you are creating/copying actual .Path strings and replacing the whole strings, rather than composing one from its elements.
 
Can each of the four octets of the IP address be left-zero-padded to three characters for octets less than 100 e.g. 192.168.0.12 becomes 192.168.000.012.



Then the string length should be constant, at least the IP address part of it anyway.
 
There is an old IETF versus BSD dispute about the interpretation of IP address digits with a leading zero as octal instead of decimal.

You can illustrate it yourself by sending a PING to the Google DNS server at "8.8.8.010".

It's my understanding that the ControlLogix OS always considers the values in an IP address octet field to be decimal. But there are enough similar and adjacent software and systems (like Windows and RSLinx) that don't, that I would prefer not to introduce that uncertainty.
 
There is an old IETF versus BSD dispute about the interpretation of IP address digits with a leading zero as octal instead of decimal.




oh for pete's sake; so it will depend on the interpretation the instruction gives it.


that deserves a haiku:



i am not surprised,
but even so feel the need

to roll my two eyes
 
There is one 1756-ENBT on my network, with IP address 192.168.21.21.

RSLinx definitely interprets a leading zero as Octal. You can't see it from the screenshot, but with Autobrowse checked, every couple of seconds the identified module description switches from "192.168.21.025" to "192.168.21.21".

Why do PLC programmers get Halloween and Christmas mixed up ?

Octal_Octets.PNG
 
For the Record I got this working

I just did a Concat on the prefix and the IP address and COPed the result to the Path member.
 
Last edited:

Similar Topics

I need assistance with writing a logic for sending data from a Station PLC using 1 MSG instruction to an AGC PLC in every cycle using a CIP Data...
Replies
2
Views
570
Can Anyone tell that How Msg Instruction comes under Unscheduled communication and How System Overhead time slice(SOTS) function connected to it...
Replies
1
Views
957
Is there any good way to send actually messages to another PLC? The MSG instruction isn't really a message it just continuously writes to a tag...
Replies
2
Views
1,789
Hi everyone, I have an issue with installation of Studio 5000 33.00.02 DVD Media disc 2 with View Designer on Windows 11. After installation...
Replies
0
Views
63
Anyone have problems/solutions with Rehosting Studio 5000 to a new computer. Our IT department successfully Rehosted 2 laptops, but the other 2...
Replies
1
Views
114
Back
Top Bottom