LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement a multiplexer for data

I am receiving a predefined packet from my electronics. The first byte of the packet highlights which dial the following information is for. Eg dec 40 is for the first dial. dec 41 is for the second dial. (The packets are received over the rs232 port. I have made the flow so that is separates the string into a byte array, clusters and then ungroups into 1st byte, 2nd byte, 3d byte etc - this then gives me the fist byte sent to rs232 being the control byte, the 2nd and third bytes being the data and the 4th being the CR)

Byte two and three contain the value of a right justified 10bit ADC value. (8bit, then 2 bit I think)
Byte four is a Carriage return to signify the end of the packet.

1st question:
I want to route the values of the second and third bytes through to the appropriate dials, depending upon the value in the first byte (much like a multiplexer)
I have set up a multiple switch statement, and in each case have routed the info through to the dial. This does not satisfy Labview though, as each of the other dials on the output need to be 'connected' to something in the switch box so that they are not floating. I am wondering what to do... maybe I should create an array/buffer inside so that while the switch is set to driving dial 40, dials 41,42...etc are being driven by the values in the buffer. How would I implement this?

2nd question:
I would like to combine the 2nd byte and the third byte together so that my ADC value is a 10 bit value of 1024 bits rather than 256. How would one do this?

Thanks
0 Kudos
Message 1 of 5
(2,977 Views)
Hi jaybee,

here is some code which can gives you an idea about your questions (code for LV 7.0 or 7.1).
I used the "join numbers" function which you can find in the function palette at : advanced/data manipulation.
If it doesn't answer your questions, then it is because I din't understood your question (my english comprehension is not very good).

If you can join to your post a part of your code, it will be easier to understand your question.


Best regards,
G Liagre
Best regards,
G Liagre
0 Kudos
Message 2 of 5
(2,975 Views)
Thanks.

I shall have a look at it, and get back to you.

I have attached my excuse for a design, which is basically a modification of the complex serial example in 7.1.

I am not sure if the switch box is the correct way to go about it - it will not let me complete this as I need to put an ouput to each display even when the correct display is routed through.

Thanks
0 Kudos
Message 3 of 5
(2,952 Views)
Thanks for you multiplexor. Have had a quick look. I am a beginner to Labview. In each of your cases, does the value 0 get put to the output? I do not want that, otherwise my dials will go to the correct value, then fall back to zero until it is refreshed again. I am refreshing at about 20 times a second so far. Hoping this could be raised.

I was thinking that maybe the inside the case statement a buffer could be put for each dial. That way, the value of the buffer could be output to the dial when the input is to another dial, but an input would just refresh/update the buffer of the dial it is serving.

Thanks





@G Liagre wrote:
Hi jaybee,

here is some code which can gives you an idea about your questions (code for LV 7.0 or 7.1).
I used the "join numbers" function which you can find in the function palette at : advanced/data manipulation.
If it doesn't answer your questions, then it is because I din't understood your question (my english comprehension is not very good).

If you can join to your post a part of your code, it will be easier to understand your question.


Best regards,
G Liagre


0 Kudos
Message 4 of 5
(2,948 Views)
Ooops!! you're right!! I forgot the use of the shift register!!

In fact, instead of using a zero for non acquired value, you can use its last value.
See my simple example, it's quite the same as theone before, but instead of zero, I get the last value for this gauge.
I used a cluster for the shift register just to avoid having one shift register for each values (as I can see in your code, there are many gauge!)

Hope it helps better than the previous one!

Best Regards,
G Liagre
Best regards,
G Liagre
0 Kudos
Message 5 of 5
(2,935 Views)