bitWrite / conversion of Boolean Array to Number | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
bitWrite / conversion of Boolean Array to Number
May 7, 2018
2:18 pm
Avatar
AK7466
Guest
Guests

Hi.

I would like to use the Arduino bitWrite function, but have been unable to find a way to do this so as an alternative I tried to convert a Boolean Array to the corresponding number and this seems to be getting uneccessarily complicated.

Am I missing a simple solution somewhere?

Thanks

Alan K. 

May 7, 2018
3:42 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Can you confirm which VI you are using?  There is no bitWrite VI.  There is a Digital Write.vi which is for a single pin, and a Digital Write Port.vi which is for writing 8 bits at a time.  The latter is probably what you are looking for.

May 29, 2018
2:51 pm
Avatar
AK7466
Guest
Guests

Hi Steffan.

Thanks for the prompt reply.  Sorry for the delay in getting back to you.

It is not the "Digital Write Port" I want to use, but the "bitWrite" and "bitRead" functions which appear in the Arduino language but do not have a corresponding LabVIEW function.

What would you suggest as the simplest way to implement this?

Thanks.

Regards

Alan K.

May 29, 2018
6:24 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

If you are operating on a variable/wire, then I would think you could easily do this with LabVIEW primitives, like and AND gate, and make it a subVI.  Those functions just write and read a single bit in a variable.  If you are trying to write/read to and from a digital port, possibly for speed, you could make a custom library to wrap the bitWrite and bitRead Arduino functions.  Take a look at the help manual for instructions on making your own library.

May 31, 2018
8:20 am
Avatar
AK7466
Guest
Guests

Thanks Steffan.

I will give both of those a try.

Regards

Alan K.

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
1
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356