This page last changed on Jan 14, 2015 by costa.

Hi guys,

i'm trying to setup a system with a Elexol Ether IO72 card, a very flexible and nice piece of hardware because it has 9 port, each one with 8 bits for a total of 72 programmable I/O bits which, with an additional A/D converter, can also accept analog signals.
My problem is that the card sends back the port status as hex which, once converted to binary, i get the 1 or 0 status of each bit.

Just to make clear, if i send the command a to get the status of port A what i get back is "41 1f" where
41=A in hex
1f once converted in binary = 00011111 that means that the first 3 bits are 0, the last 5 are 1

analogue example can be made with any number at 8 digit binary

Now the questions.... how can i convert the hex to decimal and read a specific bit inside the 8 digit binary number in order to get the status of that specific bit??

Is it possible to create a regular expression??

Thanks for any help you would like to give.

Costa

Document generated by Confluence on Jun 05, 2016 09:39