General information
Category:
Coding, syntax & commands
Hello,
I am trying to implement a digital io module fron ICPDAS. The current module i use is giving a string back through serial port.
The problem is that i need to look bits in the string to read the status.
Currently i do it with a case structure like:
DO CASE
CASE SUBSTR(RIGHT(cIcpconinstring,3),1,2)='7F'
cStatus = '00000'
CASE SUBSTR(RIGHT(cIcpconinstring,3),1,2)='7D'
cStatus = '01000'
CASE SUBSTR(RIGHT(cIcpconinstring,3),1,2)='66'
cStatus = '10011'
CASE SUBSTR(RIGHT(cIcpconinstring,3),1,2)='64'
cStatus = '11011'
CASE SUBSTR(RIGHT(cIcpconinstring,3),1,2)='65'
cStatus = '01011'
CASE SUBSTR(RIGHT(cIcpconinstring,3),1,2)='6A'
cStatus = '10101'
CASE SUBSTR(RIGHT(cIcpconinstring,3),1,2)='62'
cStatus = '10111'
CASE SUBSTR(RIGHT(cIcpconinstring,3),1,2)='63'
cStatus = '00111'
ENDCASE
Is there a faster method to return the bit structure as a string?
Thanks in advance
Piet Koemans
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only