02-11-2014 09:36 AM
How do I reference a text from a number reference? I wan to call fro example B0 and see "start bit"
B0 | START BIT |
B1 | PACKET LENGTH |
B2 | PACKET ID |
B3 | OCU A ADDRESS HIGH BIT |
B4 | OCU A ADDRESS HIGH BIT |
B5.0 - 5.1 | OCU A DIRECTION |
B5.2 - 5.4 | OCU A AUTO BRAKE OVERRIDE |
B5.5 - 5.7 | UNDEFINED |
6.0 - 6.2 | OCU A INDEPENDENT BRAKE OVER RIDE |
02-11-2014 10:02 AM - edited 02-11-2014 10:06 AM
There are many ways to do this. How big are the tables?
What's the meaning of "B" That does not sound like a number, especially since some have decimal points. It seems you probably want to strip the B. What should be returned for non-existent values (e.g.5.9)? Are thre other letters besides a leading B?
You could create a numeric array of boundaries, then use "threshold array" to get an result (rounded down or up) to be used to index into an array of corresponding texts. (you could modify this example)
02-12-2014 09:09 AM
Here are several posts using Variants as look up tables where you have a name and value pair.
http://forums.ni.com/t5/LabVIEW/Darren-s-Weekly-Nugget-10-09-2006/td-p/425269
https://decibel.ni.com/content/docs/DOC-25371
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-12-2014 10:47 AM
I am not quite sure how you would implement the ranges using variant attributes. In this case there could be an infinite number of names (e.g. B5.2 .....B5.4) for a certain atttribute (OCU A AUTO BRAKE OVERRIDE).
02-12-2014 10:57 AM
@altenbach wrote:
I am not quite sure how you would implement the ranges using variant attributes. In this case there could be an infinite number of names (e.g. B5.2 .....B5.4) for a certain atttribute (OCU A AUTO BRAKE OVERRIDE).
Sorry didn't catch that one
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord