Packing Data Into a Tag

ndzied1

Lifetime Supporting Member
Join Date
Aug 2002
Location
Chicago, Illinois
Posts
2,852
I received this via PM but am re-posting it here so all can see.

Note that there is only 1 word available to pack this data and only 15 bits of the word can be used.

My suggestion is in the attached PDF file. Resolution is pretty low but if you have to do what is asked, "pack 4 pieces of data into 15 bits" of course it will be low.

I need to be able to encode/mask and decode the values of 4 PLC tags being written to the RFID Tag.

So if I have four PLC tag values that I need to put on the RFID tag for example:

Tag 1 (35.3)

Tag 2 (400.1)

Tag 3 (75.4)

Tag 4 (112.7)

The sum total is 623.5 since the RFID tag can only hold a 16 bit integer value. I can multiple it by 10 and that's 6235 I can write that value on to the RFID tag no problem I can get that far.

It's when the RFID tag passes another reader and it reads a value 6235 I can divide the value by 10 and bring it back to its original value of 623.5 but I need to be able to decode that value and know that it is comprised of the following:

Tag 1 is 35.3

Tag 2 is 400.1 and so on

That's the problem I'm having decoding the RFID tag when it passes another reader, if it displays a value of 6235, it means nothing to anyone else but me as I know that the value comprises of four PLC tag values.

So what I'm asking is there a method of decoding the sum total and retrieving the original four PLC values solely using Codesys to convert the sum total 6235 back to the original 4 PLC values.

Apologies I haven't been clearer it hasn't been easy from your point of view as I have kind of said the same thing to you twice regarding arrays when arrays are not the issue.

I can post the thread in the forum no problem it's just a very specific issue and if you're busy that's no problem either.

I was just looking for an opinion on how to approach this.

Thanks for your help

My answer to this problem is in the attached PDF file. Note that the values in my pdf file for the range of each piece of data came in a prior PM to me.
 
Last edited:
I was thinking the same thing kalleOlson but:

This is on a TAG.

Note that there is only 1 word available to pack this data and only 15 bits of the word can be used.

Regards,
 
Just to confirm, Garry is right. Sorry if it was not obvious. The request was to pack 4 pieces of data into an RFID Tag with only 15 bits available.
 
I don't believe what you want to do is possible
you have 4 4 bit words to work with binary value of 4 bits = 0-15
all1"s would only yield 15 15 15 15 split out the way you show
I don't see any way to make it work just adding the values together will not work because you have no way to separate then without knowing the values before hand.
you may have to pick 2 of the 4 values that will give you 2 8 bit words each word = 0- 255 you may be able to work with that
 
Oh, I'm sure what I presented will work as advertised. Whether or not the OP can live with the super low resolution I have no idea.
 

Similar Topics

Hello everyone I'm new in PLC programming , i want to program a horizontal packing machine ,i've chosen S7 300 for this project and Wincc flexible...
Replies
8
Views
3,363
Dear all, We are working on a biscuit packing machine named dobey.... PLC is Siemens S7 300 with five delta servo motors, the issue we are facing...
Replies
1
Views
2,076
Hello Everyone, thank you for taking the time to read this post. I got this short program of a Packing Line. I documented everything. I was hoping...
Replies
16
Views
3,970
I'm designing an HMI using CitectSCADA 7.20 connected to a CompactLogix and have a very limited number of points. From what I can gather, you...
Replies
4
Views
2,726
I've been working on cleaning up a Modicon 984LL program off and on for quite some time. It is not a program that I wrote but one which I have...
Replies
8
Views
4,084
Back
Top Bottom