LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Comparing CAN strings to know if i have the right one.

Solved!
Go to solution
I am trying to write a program to test a product that we produce using CAN.  How would I go about seeing if I have a certain CAN string message to to know that our alarm is turned on, on the product?  Is there some way to compare the incomming strings, and have it pass some bolean value when it does?  Thanks, Fred
0 Kudos
Message 1 of 4
(2,838 Views)
Solution
Accepted by topic author Fred420

Hi Fred420,

you can use the simple compare function to compare two strings. If you have a list of strings, then you can store them in an array and use the Search 1D Array function. Two find a part of a string in another string, you can use the search and replace function.

 

Hope it helps.

Mike

0 Kudos
Message 2 of 4
(2,837 Views)

Hey Mike, thanks for the help.  I had already looked at the search 1d array function, but doesn't that only return 1 part of the index?  Or will this return all of the matched index?

 

Thanks, Fred

0 Kudos
Message 3 of 4
(2,827 Views)

Hi Fred420,

it will only show the first found index. If you need more, then use a while loop til the result is -1. Store the last found index in a shiftregister, add one and conact it to the index input.

 

Mike

0 Kudos
Message 4 of 4
(2,819 Views)