LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Manipulating RS232 data into array of boolean

I am trying to use an array of booleans to display the status of a prototype circuit connected via the RS232 port. I am expecting two binary 8 bit Bytes from the RS232 port, the frist byte an address and the second byte actuall 8 bit data. I have an 8 x 6 array of boolean indicators, how can I use the address byte to correctly update the array with the correct data? Each row of indicators has its correspoding 8 bit address. Thanks.
0 Kudos
Message 1 of 8
(3,415 Views)
Hi jorge,

is there any specific method involved for conversion of address & data byte into boolean array? If yes, pl. explain.

As per my understanding, i have attached one vi. See if works. Your feedbacks are welcome.

Best Regards,
Nirmal Sharma
0 Kudos
Message 2 of 8
(3,415 Views)
Actually I was not intending to just display the address and the data, I would like a way for labview to automatically "decode" the address and update the correct indicator on the array. There is nothing too fancy about the way I addressed the data. Row one has address "00000001". Which I would then wait for the data to come in, seperate the byte into bits and display where it was a one or zero. I also don't have a fancy way of "decoding" the data. I take the order of the data coming in and display the correct indicator according to the address. "00000001" for row one, "00000010" for row two, "00000011" for row three and so on. Thanks for the help. I have included the vi of the array I created.
0 Kudos
Message 3 of 8
(3,415 Views)
You need to split the returned string into two parts. The first part is wired to the index input of the Replace Array subset function and the second part of the string is the new element. I've attached an example that I hope will explain it.
0 Kudos
Message 4 of 8
(3,415 Views)
Hello,

Here�s a small piece of code that should help you. Let me know if there is anything I can help with or clarify. Have a great day!

Ken S.
National Instruments
0 Kudos
Message 5 of 8
(3,415 Views)
Thanks to both of you. That is exactly what I was after, now I can move on, hopefully I will not run into anymore problems, but if I do I will know were to come for help, thanks guys.
0 Kudos
Message 6 of 8
(3,415 Views)
Actually there is one more thing, I would like to lable the array, but what I have read, and tried, if I change the label on one, they all change. Could I have done the previous manipulation of address and data using a cluster as the indicator, so that I could easily label the indicators? Thanks.
0 Kudos
Message 7 of 8
(3,415 Views)
If you want to display a single row as a cluster, you could modify my example to have an index array function with the row input wired to the decoded index and then use an array to cluster function.
0 Kudos
Message 8 of 8
(3,415 Views)