scripting bit shift right

asterof

Member
Join Date
May 2007
Location
Califonia
Posts
554
trying to figure out how to start at bit 29
look at a input if it is true set bit 29 to 1
and bit shift right

y = 536870912 ' bit 29 set to 1
x = 0

WHILE x < 30

IF INPUT[0] == 1
y = y & 1
ENDIF
y = y / 2
x = x + 1

LOOP


Can not figure out how to do it
Any ideas
Thanks
 
look at a input if it is true set bit 29 to 1
and bit shift right
It is very likely that your PLC software program has a built-in instruction for doing a Bit-Shift Right.
 

Similar Topics

I work for an OEM. I am trying to develop a generic HMI program that will display an overview screen displaying between 2 and 6 "widgets"...
Replies
1
Views
1,281
Hey guys, I am new to vb scripting in TIA and had a small query. I need to view certain data from HMI in excel. After running a certain script I...
Replies
13
Views
2,580
I need to make a navigation to 1 of 2 pages based on the value of a DINT in the PLC. I need a statement in the script that basically says when...
Replies
18
Views
6,167
Is there any way to script driver configuration instead of using the rslinx gui? It would be nice to just have scripts i can run for whatever...
Replies
2
Views
1,604
Hello all. I have a Danish program that has a lot of AOI's that were created using structured text. There are a few arguments that I am not...
Replies
3
Views
1,409
Back
Top Bottom