Siemens Encode & Decode function

TEOWK

Member
Join Date
Oct 2004
Location
Batu Pahat
Posts
38
I am studying Siemens s7-300 PLC. There are 2 built-in function that seems confusing to me. ie. Encode & Decode FC83
Please suggest an application example using this function.
 
it's under Standard Library....TI-S7 Converting Blocks
oh... and i made a mistake
it should be FC96 and FC97
sorry for the mistake
 
Last edited:
OK. Now I see. So it looks to me like enocode makes convertion from 1 of 31 code into binary and decode makes opposit convertion.
Possible app is keyboard (it can give you number of pressed button) for encode FC or (not sure about my translation into English) "light dial/scale" for decode FC.
 
To find out what a certain function does, it is enough to select that function in the instruction browser and press the F1-key.

The funcions you're talking about are:
  1. FC96 - ENCO
    This function returns in RET_VAL the bitnumber of the first set bit in the value in parameter IN starting from the right.
    IN = 0001_0101_0000_1000_0101_1111_0100_0000 -> RET_VAL = 6
  2. FC97 - DECO
    This functions sets one bit (bitnumber 0-31 in parameter IN) in a double word (parameter RET_VAL). If the value in IN is greater than 31, modulo 32 is calculated first, eg. 35 sets bit 3.
    IN = 5 -> RET_VAL = 0000_0000_0000_0000_0000_0000_0010_0000
    [/list=1]
    Kind regards,
 

Similar Topics

Hello I have a s7-1200 and I would like to read the tags present in this controller with my controllogix controller. The two controllers don't use...
Replies
3
Views
43
Hi need help why this “failure 5 emergency stop “ appears at every startup in the morning ? Have to shut off main switch at least 10 times on...
Replies
19
Views
257
i have two plc 1. s7-1212dc/dc/dc ip; 192.168.0.1 2. s7-1500 1513-1pn ip; 192.168.3.2 i need to get data from plc1 to plc2. any idea how to do...
Replies
5
Views
91
Hi everyone hope you'll well. Is it possible for me to download a Crack version of tia portal v13..sorry to say this but the software is very...
Replies
5
Views
187
I have established an online connection to a machine using an S314 processor. I am using an mpi connector and simatic manager. The online...
Replies
11
Views
171
Back
Top Bottom