AdvancedHMI Software

General Category => Tips & Tricks => Topic started by: bachphi on April 26, 2022, 10:18:31 PM

Title: Send STRING from Control/Compactlogix to Micrologix 1400 and vice versa.
Post by: bachphi on April 26, 2022, 10:18:31 PM
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

(https://i.postimg.cc/g2QS0Q7n/String-2-ML1400.jpg)


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

(https://i.postimg.cc/XNxbQKqQ/String-2-ML1400-2.jpg)
Title: Send STRING from Micrologix 1400 to Control/CompactLogix
Post by: bachphi 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

(https://i.postimg.cc/xdd8njr1/Send-String-From-ML1400.jpg)

On the CompactLogix side, file N30 need to be mapped in:
(https://i.postimg.cc/HWzwtnp6/Receive-String-From-ML1400.png)

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.
(https://i.postimg.cc/rF6g0FLh/SLCType-Read.png)

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.
(https://i.postimg.cc/qvjKPFPT/MSG-CIP-TYPE-READ.png)

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

(https://i.postimg.cc/Sx7dJVHT/MSG-READ-REQUEST-FORMAT.png)

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

Perhaps, the last approach is to use socket client - server but I wont go there today.  8)