LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I don't get output to an indicator in a recursive VI

Hi,

    I'm trying to create a simple text parser with LabView.  So far, I only want the parser to recognize three commands:

 

*loop n - indicates the start of a loop of commands to execute n times

*endloop - end of section of commands to loop

*pausetime n - pause the reading/output of commands for n milliseconds

 

I use a "Scan String for Tokens" to break the text in a text control by line breaks. 

 

I use a case structure to recognize those commands with a default case that passes any other text to a text indicator. 

 

I figured the easiest approach to dealing with the loops would be to make the VI recursive. 

 

When I don't have a *loop/*endloop pair in my text control, all the other text gets sent to the text indicator correctly, and the *pausetime appears to pause the reading correctly. 

 

When I have a *loop/*endloop pair in in my text control, the loop index is parsed correctly, the VI is called recursively, the "offset past token" is RETURNED as the point beyond *endloop, but I don't see any of the commands that lie between the *loop/*endloop pair ouput to the text indicator.

 

Can someone suggest what I might be doing wrong?

 

Thanks,

 

Jason Mazzotta

Message Edited by JackOTrades on 06-08-2010 02:10 PM
0 Kudos
Message 1 of 4
(2,943 Views)

Nativie recursion was added in LabVIEW 2009. You are using 8.5 so you definitely have a serious penalty here.

 

 You code is so full of outrageous code constructs that is makes little sense to try to understand it all.

 

Examples:

 

  • Convert INF to I32 to wire to N of a FOR loop. What's the idea???
  • Obscure bitwise operations: String size NOT(OR "1") for a case structure. What???
 
What would be a typical input string? 

 

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

I am a bit new to LabView programming and I'm trying to get the program to work at all.  So, I haven't had a chance to consider the best options for some of what I've done but ... 


  • Convert INF to I32 to wire to N of a FOR loop. What's the idea??

 

... to create an infinite loop.  I could use a while loop, but I wanted to use the same FOR loop for finite and infinite looping 

 

 

 

  • Obscure bitwise operations: String size NOT(OR "1") for a case structure. What???


That is simply check to see if *loop has a parameter.  I could use a comparison operator, and probably will, but that's what I found first off and it works.
 
 
What would be a typical input string?
 
A B C
*loop 3
D E
*endloop
 

0 Kudos
Message 3 of 4
(2,910 Views)
There is no "infinite" for integers.
 

JackOTrades wrote:

That is simply check to see if *loop has a parameter.  I could use a comparison operator, and probably will, but that's what I found first off and it works.

 


 

 
 Just wire the string directly to the case selector terminal. One case is "empty string" and the other the "default".
 
 
0 Kudos
Message 4 of 4
(2,906 Views)