Hi!
I have a problem how to convert a 38-bit binary value to a dec-value.
The PLC is a Siemens 400-cpu and have a 32-bit accumulator, so the solution must use 2 DoubleInteger variables to show the dec value.
Do anyone have a solution or tip how to solve this problem.
Who will be the first to solve my problem?
//Apollo11
[?]: Convert 38bit bin-value to dec value
-
- Posts: 258
- Joined: Fri Apr 03, 2009 3:24 pm
- Location: Bosnia and Herzegovina
Re: [?]: Convert 38bit bin-value to dec value
More precisely, please.
38-bit or 32-bit or 64-bit binary?
38-bit or 32-bit or 64-bit binary?
-
- Posts: 4
- Joined: Thu May 06, 2010 6:46 pm
Re: [?]: Convert 38bit bin-value to dec value
A RFID-reader sends a serialnumber in 38-bit Binary-code this value should be converted to datatype=dec in the PLC-system.
In some way I need to find a solution who can work with bigger value than 32-bit.
Because the Siemens-system has only a 32-bit accumulator to work with.
In some way I need to find a solution who can work with bigger value than 32-bit.
Because the Siemens-system has only a 32-bit accumulator to work with.
-
- Posts: 104
- Joined: Sat Jun 13, 2009 12:25 pm
- Location: Europe
Re: [?]: Convert 38bit bin-value to dec value
Hi,
Could you explain how and where the data are send to the Siemens PLC?
Could you explain how and where the data are send to the Siemens PLC?
-
- Posts: 4
- Joined: Thu May 06, 2010 6:46 pm
Re: [?]: Convert 38bit bin-value to dec value
OK!
The RFID-reader sends the data over a Profibus-connection.
The data are 12-byte long in binary-code. In this data-area you can read out following data.
Binarycode from left to right.
Codetype = bit 1-8 bit (8-bit long) convert to 0-255 dec, no problem.
FilterType = bit 9-11 (3-bit long) convert to 0-7 dec, no problem.
PartionTable = bit 12-14 (3-bit long) convert to 0-7 dec, no problem.
CompanyPrefix = bit 15-28 (14-bit long) convert to 0-16384 dec, no problem.
SerialNo = bit 29-66 (38-bit long) this value is bigger than 32-bit and that is my problem because the PLC-system is built to handle max 32-bit each programaccess.
The RFID-reader sends the data over a Profibus-connection.
The data are 12-byte long in binary-code. In this data-area you can read out following data.
Binarycode from left to right.
Codetype = bit 1-8 bit (8-bit long) convert to 0-255 dec, no problem.
FilterType = bit 9-11 (3-bit long) convert to 0-7 dec, no problem.
PartionTable = bit 12-14 (3-bit long) convert to 0-7 dec, no problem.
CompanyPrefix = bit 15-28 (14-bit long) convert to 0-16384 dec, no problem.
SerialNo = bit 29-66 (38-bit long) this value is bigger than 32-bit and that is my problem because the PLC-system is built to handle max 32-bit each programaccess.
-
- Posts: 31
- Joined: Tue Nov 06, 2007 3:48 pm
- Location: Europe
Re: [?]: Convert 38bit bin-value to dec value
which type of RFID reader is used?
I'm looking for readers which can be conneced to Profibus-DP directly.
For me it's only necessary to identifiactie the RFID Taf (unique) number in a PLC program.
Waiting for your answer....
Regards,
Benthouse
I'm looking for readers which can be conneced to Profibus-DP directly.
For me it's only necessary to identifiactie the RFID Taf (unique) number in a PLC program.
Waiting for your answer....
Regards,
Benthouse
-
- Posts: 4
- Joined: Thu May 06, 2010 6:46 pm
Re: [?]: Convert 38bit bin-value to dec value
Sorry for the late answer.
The RFID reader from a company called Vilant (www.vilant.com).
You need for now a gateway between the reader and your profibus-system.
Everything can be deliverd by Vilant.
//Apollo11
The RFID reader from a company called Vilant (www.vilant.com).
You need for now a gateway between the reader and your profibus-system.
Everything can be deliverd by Vilant.
//Apollo11
-
- Posts: 41
- Joined: Wed Sep 06, 2006 10:07 am
- Location: Slovenia
Re: [?]: Convert 38bit bin-value to dec value
Change the way of thinking, RFID key for sure doesn't use a CPU that is better than Siemens CPU4xx, so you can use more than one byte, dint, ... array of bits,..
-
- Posts: 104
- Joined: Sat Jun 13, 2009 12:25 pm
- Location: Europe
Re: [?]: Convert 38bit bin-value to dec value
Hi,
Another way to solve your problem : use string (convert byte area into string)
Then, use SCL for programming with string , it is more easy...
Another way to solve your problem : use string (convert byte area into string)
Then, use SCL for programming with string , it is more easy...