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 everyone, I've had this issue for the last 2 days where I try to assign the profisafe address to an IO block (6ES7 146-6FF00-0AB0) but when...
Replies
5
Views
109
Hello, good morning, I have been having two problems with the Tia Portal software. The first is that I have installed it on my computer and...
Replies
5
Views
155
Hello to all, I'm just starting with using CodeSys. Immediately, I have noticed that Codesys doesn't use data blocks like for example S7 does...
Replies
11
Views
169
Hi, I'm setting up a modbus master on an S7-300. It seems to work in OB1 but not when I use it in OB35. Does anyone have any ideas why? Could...
Replies
10
Views
113
The past week we received a new piece of equipment from Germany which utilizes siemens controls. Typically in our company we use A.B. controls for...
Replies
12
Views
332
Back
Top Bottom