Pack 2 Bytes into 1 Word Micrologix 1500LRP

ddnnis

Member
Join Date
Oct 2008
Location
Rochelle
Posts
92
I am working on an RFID project that will write Micrologic integer value to an RFID tag. The RFID system is the Turck BLCDN RFID SLICE. It communicates via Devicenet. I have mapped it to the scanner and all works well. It will allow me to write and read 4 words with no issues. The problem is that I need to write and read at 5 values. Two of the word values are under (255 decimal, hence 1 BYTE). If I could pack these 2 values as one word I believe this would solve my issue. Long story short can anyone help me on how to pack 2 Byte's into 1 Word on the Micrologix 1500LRP. I will also need to unpack them when I read the RFID tag.
Any help would be much appreciated.
Thanks
 
One approach would be to use the SWP instruction to swap the low and high bytes of one of the words, which would put the 8 data bits on the high end and 8 zeros on the low end. Then use a masked move MVM or OR instruction to combine the swapped word with the remaining value, and you'd have two 8-bit values stored in one 16-bit word. I've never personally used the SWP instruction but after reading the help file it seems like it should work.
 

Similar Topics

I am using Schneider elau pack drive servo motor ISH-100. I am facing the problem that On the ISH -100 red light is blinking and pack drive C-600...
Replies
0
Views
57
Has anyone already worked with ALTOPACK equipment, model AVE-PC (VFFS). Year 2009, I need to do a retrofit for this equipment, has anyone already...
Replies
0
Views
62
Hi All, If i have the original project for TIA Portal V13sp1. the SoftPLC is running in V13sp1 in a 1515sp Win7 industrial PC. I was not able to...
Replies
6
Views
1,505
Hi People, I have a ScadaPack 330E that has been sitting on a shelf for a few years (previously working), and have recently re-installed...
Replies
4
Views
1,792
I've got 16-bit data at address 40200 on a Schneider Scapack 350. I can grab the data over Modbus TCP using Kepware at IP 172.16.1.100. When I...
Replies
8
Views
2,489
Back
Top Bottom