Author Topic: Send STRING from Control/Compactlogix to Micrologix 1400 and vice versa.  (Read 5257 times)

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Micrologix 1400 has a string data type ST, however sending it directly will not work. MicroLogix/SLC/PLC5 platform stores data in Big-Endian Motorola format. And the newer Control/Compactlogix stores CIP data in Little-Endian Intel format , Little-endian is an order in which the "little end" (the least-significant byte) is stored first.

On the Control/CompactLogix side, SourceString is copied to INT_Array_Temp, then used SWPBYTE to reverse the order, store it in the  INT_Array_OUT, next write it  to ML1400 to N10:0 integer file




On the ML1400 side, the integer file N10:0 is then copied to STRING file ST16 as final result is display

« Last Edit: May 11, 2023, 03:56:28 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Send STRING from Micrologix 1400 to Control/CompactLogix
« Reply #1 on: April 30, 2022, 11:02:54 AM »
To send string from ML1400 to Control/CompactLogix. It's the same process, copy string to INT file and swap byte.
N30 file do not have to be defined on the ML1400 side



On the CompactLogix side, file N30 need to be mapped in:


Another approach: since ML1400 already swapped the needed data bytes into N11 file, On the CompactLogix use SLCTypeRead to read data in.
This approach is simpler, but there is a draw back, since data change from ML1400 will be not be seen as fast, until the Message is triggerred to read.


NEQ is there so that you can see the string data.

=====================================

Another approach:  to use CIP to read data directly from ML1400.  IN ML1400, have N9 contain the date 2022-04-30 HH MM SS.


The Msg_Read_Request is format to read PCCC command from file N9 with 12 bytes:



--------------------------------------------------------------------

Perhaps, the last approach is to use socket client - server but I wont go there today.  8)
« Last Edit: May 11, 2023, 03:56:39 PM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================