Internet PLC Forum
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
Internet PLC Forum
»
General
»
Technical support
»
Relay Bit Manipulation
« previous
next »
Print
Pages: [
1
]
Author
Topic: Relay Bit Manipulation (Read 11688 times)
Stiefes
Newbie
Posts: 1
Innovative Controls
Relay Bit Manipulation
«
on:
October 24, 2013, 01:08:18 PM »
Sorry if this is posted somewhere but I cant find it.
How do I manipulate bits in BASIC?
This is wrong but this is how I would invision it to be like.
If
Relay[1:0]=1 & Relay[1:1]=1 Then
Relay[1:2]=1
Endif
In ladder I would do it like this
Relay#1 Realy#2 Relay#3
-----| |-----------| |-----------------------------------------( )---------
any way to do this in BASIC?
Logged
ScarBelly
Newbie
Posts: 6
I'm a llama!
Re:Relay Bit Manipulation
«
Reply #1 on:
October 24, 2013, 01:34:19 PM »
Here is a little snippet of mine that should clear things up.
If TestBIT (Relay[1],0) Then
CLRBIT Relay[1],0
Endif
'Use TestBIT here for your application
If TestBIT (Relay[1],0) AND TestBIT (Relay[1],1)Then
SetBIT Relay[1],2
EndIf
Logged
Print
Pages: [
1
]
« previous
next »
Internet PLC Forum
»
General
»
Technical support
»
Relay Bit Manipulation