General Category > Tips & Tricks

Send STRING from Control/Compactlogix to Micrologix 1400 and vice versa.

(1/1)

bachphi:
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

bachphi:
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)

Navigation

[0] Message Index

Go to full version