LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stupid 1D array indicators!

Solved!
Go to solution

Hi all. New here, fairly familiar with LV although my last serious encounter was with Version 6i, 10 years ago.

I'm just getting to grips with 2012 and am now really frustrated. I've just built a simple serial comm vi to read a pressure sensor and most of it was OK but, and it's a big but, if I right click on a terminal with the wiring tool and select create indicator it gives me a 1D array, with the up down arrow thing. I just want a simple numeric indicator, not a 1D array! I've gone to "Representation" and it tells me it's a DBL, which is fine.

Please, someone, how do I make it default to a simple indicator and how do I change the ones I've got from a 1D array to and ordinary indicator.

Sometimes it's like banging your head against a brick wall. Please make it stop!

Thanks

Andy

 

 

0 Kudos
Message 1 of 8
(3,022 Views)

If you right click on a wire and select create control/indicator LabVIEW will create the correct control type for the wire. You must be right clicking on a wire which is a 1D array. Same applies to when you right click on a terminal of a subVI. You can manually create a control/indicator of whatever type you want on the front panel. Then simply connect the wire you want to display. If you have an existing control you can right click on it on th efornt panel and select Replace. Then simply choose the type you want. However you may end up with a broken wire if the new type does not match the wire type/terminal connected to it.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 8
(3,019 Views)

Mark, thanks for that quick reply. You're right, I've traced back through the data flow and I'm using "String to byte array" to convert a pair of characters taken from a serial port to a hex number and then to a decimal. However, once I've got my number, how on earth do I get it to be a plain old number and not an array for evermore?

Thanks again

Andy

0 Kudos
Message 3 of 8
(3,010 Views)

BTW, I noticed your avatar. I too, sail, as much as possible. I do a bit of racing, especially the Round The Island race (Isle of Wight, off UK) every year. I'm very keen to get this LabView working right as it's paying for 2 new sails for my Jaguar 23!

Cheers

Andy.

 

0 Kudos
Message 4 of 8
(3,003 Views)
Solution
Accepted by topic author ASH2020

There are a couple of options available to you. First, what format is the string that you are receiving? Is it an ASCII representation of the hex values or is it the binary equivalent of the hex? If it is the ASCII equilavent you can simply use the "Hexidecimal String To Numer" vi to convert it to a number. If it is the binary format you can use a typecast to convert the data from a string to a number.

 

Convert String.png

 

As for sailing I have been sailing and racing on Lake Michigan for the past 30 years. I currently crew on a Benneteau First 42. We race the weekly beer can races, a few weekend regattas as well as some port to port including the Chicago to Mackinac Race. Nothing beats being out on the water. BTW, here is the full size picture of my avatar.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 8
(2,996 Views)

Bloody hell Mark! That's a big sea! (lake). Very impressive. I think I'd go home and put the boat up for sale after that.

 

Thanks for the answer, it looks like a better solution. I'm turning in now but I'll give it a try in the morning.

Cheers

Andy.

0 Kudos
Message 6 of 8
(2,978 Views)

Mark, I'm sorry, I tried all your examples but I'm afraid I still don't get it.

 

I am receiving a value from a pressure sensor, sent on an I2C bus through a Com port, so I get a value typically of 7FFF ( I assume that's sent as four ASCII characters, representing two bytes 7F then FF) I can't convert each byte as its received, I have to receive the whole word then work on it. What I'm trying to do is convert 7FFF into decimal 32,767

 

 

 

When I try "Hexadecimal string to number" I just get 0 in the indicator no matter what offset.

 

When I try "Type cast" I get a pink wire in and a pink wire out, no matter what I put into "type"

 

When I try "unflatten from string" again I can't seem to make the 'type" work, It wants a cluster

 

I'm doing this by right clicking on the type terminal and creating a constant. Is that the wrong way to do it?

 

Sorry to be so thick.

Cheers

Andy

0 Kudos
Message 7 of 8
(2,929 Views)

Sorry Mark, I was being pathetic. I realise now that you have to create a numeric constant first, then wire it into the "type" terminal. If you right click and "create constant" it just creates a string type.

 

I've tried type cast again and it works, with the representation set to U16. Thanks for your patience. I don't really understand what type cast does, but it's a learning curve.

Thanks again.

 

Andy

 

0 Kudos
Message 8 of 8
(2,917 Views)