LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The case structure is not working well on comaring two strings using true or false string matching VI

I need an execution of commands after the reply from the instrument matches with the string I provided for that i used true or false string match VI on which the true string the matching command and the string is the reply from the instrument. And I put the further executionable commands in frame after frame of sequence loop in the true of the case structure. Amd finally I given all the output strings to the concatenate string to get all the replies as one loop. But when I execute the program the desired result is not available. So kindly please help me to overcome this problem.  

0 Kudos
Message 1 of 5
(2,806 Views)

You VI makes absolutely no sense and I would recommend you start with a few simple LabVIEW tutorials before trying to tackle this.

 

  • What is the point of the FOR loop with 1 iteration, it might as well not even be there, same difference.
  • Why is there an abort primitive in the FOR loop, this mean the program will unconditionally stop abort before any downstream code will ever go into action. The program will never get past the FOR loop.
  • You created a circular data dependency and LabVIEW inserted a feedback node automatically, making things even worse. (see also)
  • You need to learn about dataflow, execution order, and data dependency.
  • You need to learn about the various types of tunnels (plain, autoindexing, etc.)

There is a tremendous amount of duplicate code. Large code sections are the same, differeing only by a string. You should only have one copy of that code inside a proper state machine. Have a look at the design templates and examples that ship with LabVIEW.

0 Kudos
Message 2 of 5
(2,799 Views)

You don't fully understand how data flow works. You have outputs from the VISA read which is wired to execute after the FOR loop completes fedding back into the FOR loop. You cannot do this as it is impossible to exeute. It is the equivilant of being in two places at the same time. Also, the inlut of a case statement cannot be an array. It must be a single value.



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 3 of 5
(2,794 Views)

Also page attention to the format display of the string constants going into the VISA writes.  In one you have "M3\r\nm".  It seems odd to have another character after the \r\n which are typically termination characters in serial commands.  But the big problem is that you have the constant set for normal display which means you are literally sending a backslash "r", backslash "n".   \r \n are the codes for carriage return/line feed, but you need to enter those when the string constant is set for \codes display.

0 Kudos
Message 4 of 5
(2,775 Views)

for the initial read \r\n is working well , only when reaches to case loop it is not well functioning, and also M3\r\nm  the last character m is the character used to read the state od system, so we have to add it. so in that there is no problem . Only problem is that your answer is not clear to me. And also i mad the intention of my program clear.

0 Kudos
Message 5 of 5
(2,773 Views)