Discussion:
Monitoring pins through a serial input
(too old to reply)
RyanElkholy
2006-08-02 14:40:14 UTC
Permalink
Hello,
 
I am having a lot of trouble as to where I should start with what I am doing. As of now I am using a Parallax Basic Stamp II and will be connecting it to my PXI through a breaker box. I am outputting the values (0 or 1, High or Low) of 8 pins that I am monitoring on the microcontroller. They are being sent serially through one pin into the breaker box as a string of 1's and 0's. So an example of the string would be "10011101". Of course these values are constantly changing and that is what I would like to monitor. In labview I created a 4x2 display table in order to constantly monitor the pins. I would like to know how to take these sets of 8 bit strings and break them up into the display that I have created in labview so that I can see if pin 1 is high or low and so on. I read many labview books and did not find what I was looking for, or maybe I just did not understand it.
 
so what I am looking for is this:
 
10011101 will be sent through the breaker box
 
In labview I want this displayed:
 
            Input     Output
Pin 1    1             1
Pin 2    0             1
Pin 3    0             0
Pin 4    1             1
 
where Input is the last four bits and Outputis the first four. As you might notice the input and outputs of the pins may not be in the same state and that is due to some testing that I am trying to do.
 
Any help would be greatly appreciated,
Ryan
 
shahina
2006-08-04 00:40:13 UTC
Permalink
Hello Ryan,

You can first split your boolean string to an array of strings
containing each character (see the attached VI). You can then
concatenate (use Concatenate Strings function) each of these elements
in the array (use Index Array function to get each element) and form
your final string.

I suggest to post these types of questions to the LabVIEW board and you will get many responses from other forum members.

Good luck and best regards,
Shakhina P.
Applications Engineer
National Instruments


ExtractBooleanString.vi:
http://forums.ni.com/attachments/ni/70/5278/1/ExtractBooleanString.vi


ExtractBooleanString.JPG:
Loading Image...
Continue reading on narkive:
Loading...