Byte Me - PLC5

bluenoser337

Member
Join Date
Apr 2003
Location
Nova Scotia
Posts
391
I have a status word being read from a device (N address). Bits 00 to 07 have a BCD error code number, and bits 08 to 15 contain a BCD error location code number. I need to split this word and convert the BCD values to decimal, so I can use the separated values in compare instructions...to turn on various fault bits to display error information on a PanelView. What's the easiest way to get these byte values separated...and then converted to decimal. Thanks in advance!!
 
bluenoser,

I like the /256 method.

You can also use the BTD (Bit Field Distributor) instruction to move the top 8 bits of the source into the lower 8 bits of a destination word. Of course you still have to convert to integer.

I've used the BTD where space was at a premium (IO to/from a 1394 servo). For 1394 to PLC5, I pack what I can into the 99 bits in the 1394's RIO data table then disassemble the integer into it's separate parts with the BTD instruction. For PLC5 to 1394 I assemble the 99 bit output table with the BTD then use GML to take it back apart.
 
Last edited:

Similar Topics

Our system utilises INPUT_BYTE to capture NMEA0183 ASCII stream which sends data to the NOM multiple times a second. The NOM module can either be...
Replies
0
Views
385
Hello everyone, friends. I need help with something. I want to read and change Bit and Byte numbers via HMI. I found a code snippet for this as...
Replies
18
Views
3,021
Hello everyone :) I just want to start with learning PLC programming, so I need advice. I have SIMATIC S7-1200, CPU with integrated memory...
Replies
5
Views
922
I have a C-More HMI that changes my PLC String from "Machine Status" to "aMhcni etStasu" . There is an option with other objects that have string...
Replies
15
Views
3,463
Hello I have got a problem with positive edge from "system clock memory byte" in Tia Portal. I would like to change byte"system clock memory"...
Replies
27
Views
3,577
Back
Top Bottom