meta data for this page
lamaLibrary: bitsToByte
The function 8 bits JOIN to a byte.
Function call:
"bitsToByte"(bit00:=_bool_in_, bit01:=_bool_in_, bit02:=_bool_in_, bit03:=_bool_in_, bit04:=_bool_in_, bit05:=_bool_in_, bit06:=_bool_in_, bit07:=_bool_in_, OUT=>_byte_out_);Source code:
TITLE = JOIN A BYTE FROM BITS { S7_Optimized_Access := 'FALSE' } AUTHOR : lamaLibrary FAMILY : TOOLS VERSION : 0.1 //Build a word, bit-by-bit VAR_INPUT bit00 : BOOL; // Bit 00 of BYTE bit01 : BOOL; // Bit 01 of BYTE bit02 : BOOL; // Bit 02 of BYTE bit03 : BOOL; // Bit 03 of BYTE bit04 : BOOL; // Bit 04 of BYTE bit05 : BOOL; // Bit 05 of BYTE bit06 : BOOL; // Bit 06 of BYTE bit07 : BOOL; // Bit 07 of BYTE END_VAR VAR_OUTPUT OUT : BYTE; // Word constructed from bits END_VAR BEGIN // Assemble bits to a byte #OUT.%X0 := #bit00; #OUT.%X1 := #bit01; #OUT.%X2 := #bit02; #OUT.%X3 := #bit03; #OUT.%X4 := #bit04; #OUT.%X5 := #bit05; #OUT.%X6 := #bit06; #OUT.%X7 := #bit07; END_FUNCTION
Main site > LamaLibrary Simatic
lamaLibSimatic topics on lamaPLC
Page | Date | User | Tags |
---|---|---|---|
2024/11/18 21:46 | tia, scl, lamalibsimatic, source code, energy meter, modbus, register, word | ||
2024/11/18 21:55 | tia, scl, lamalibsimatic, source code, energy meter, modbus, register, word | ||
2024/11/18 21:54 | tia, scl, lamalibsimatic, source code, join, bits, byte, convert | ||
2025/05/26 12:52 | tia, scl, lamalibsimatic, source code, dt, string, convert | ||
2024/11/18 21:45 | tia, scl, lamalibsimatic, source code, math, power of 10 |
This page has been accessed for: Today: 1, Until now: 93