05-29-2012 09:29 AM
With all of the received data in a indicator, it should now be obvious why your equal comparison returns false.
05-29-2012 09:33 AM
Hi,
Danil again created a new thread to handle a topic related to VIs shown here. Solution to his answer was accepted...
05-29-2012 10:57 PM - edited 05-29-2012 10:58 PM
While running, the indicator showing exactly the array that I have send.And I just compared a string constant with the element in the first value of the array.The wire value also the same as the string constant.But after comparison it returns false.Why this is happening??I can't understand what is the problem here.
GerdW,
I created a new thread because I thought not to mix the comparison with VISA and all.Sorry
Can you give me a specific answer why it is returning FALSE??
Dennis,
Before comparison I have placed a string Indicator.It also showing exactly the same value that I want to compare.But then also it is returning false.Can you please state the thing that you have understand,why it is returning FALSE.Is it it due to any other problem??please specify
05-29-2012 11:08 PM - edited 05-29-2012 11:14 PM
Because the first element of the array DOES NOT MATCH the constant you are comparing it to as mentioned by others in previous posts.
Your array element as a linefeed character at the end, the constant you comparing to does not. There for Equals results in a FALSE.
05-29-2012 11:12 PM
So how can we change the string constant to get TRUE.??Or we have to change anything in the array??
05-29-2012 11:14 PM - edited 05-29-2012 11:14 PM
Put the same thing in the string constant that matches what is in the element of the array!
05-29-2012 11:17 PM - edited 05-29-2012 11:18 PM
The first element in the array is F9A42BB1\n.You mean we have to attach "\n" in string constant in comparison(that is F9A42BB1\n)??.I did it but then also it is returning false.
05-30-2012 12:10 AM
I have done the comparison like this by attaching "\n" after string constant.But no change.Do you mean we have to change any other??
05-30-2012 12:40 AM
For proper understanding I made a new VI with a string array and then compared a string constant with the first element.But whatever changes are made,it always points to false.Can you suggest a simple way to correct this?
05-30-2012 01:04 AM - edited 05-30-2012 01:09 AM
@danil33 wrote:
I have done the comparison like this by attaching "\n" after string constant.But no change.Do you mean we have to change any other??
Well, LabVIEW strings have several display modes.
If your string constant is set to display normal mode, entering "\n" will add the two characters '\' + 'n' to your string.
If your string constant is set to display \ display mode, entering "\n" will add a single character with the ASCII code 10, which is a linefeed, to your string
This happened because you have not understood what you were doing when following my previous tip to right click on the string array control inside your array and select "\-Display Mode" in the popup menu. This will make the string display any non printable character with a backslash code where as in normal mode it will display a line feed as a line break and any other non printable character as a black box.
That all said, working through a tutorial is definitely not a bad idea. Learning by doing is fine, but some guidance is always helpful, and a tutorial can give that. I'm sure in the time you have made this thread a 70 posts thread (for a few very minor things) you could already have worked through quite a bit of the tutorials, have a more through understanding of LabVIEW than now, and be able to solve most of the things you have done so far in less than a day. And if you end up with questions, you would know how to ask good questions here. Your posts so far often lack to much relevant information to be able to give you a concise and helpful answer.