LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to duplicate timed loop example?

I have successfully run the timed loop example for the blackfin.  I created an almost duplicate vi...and it doesn't run.  My program runs and allows the user to press one button and the corresponding LED illuminates.  After that, there seems to be no action.

 

Any suggestions?

 

Thanks.

Download All
0 Kudos
Message 1 of 17
(6,923 Views)

Hummer1,

 

         I assume that you used the BF537 Timed loop callback.lvproj shipping example as your basis (?). Your Main Timed Loop.png shows that you are getting your callback VI Reference from "Timmed Interrupt from Clock.vi". Is this the Timed Interrupt Handler for Loop.png? I didn't know if you were pointing to the correct interrupt VI.

 

I know that in general that you want to spend as little time as possible in the interrupt VI and I wonder if checking the button is pushing it to the limit for some reason. What happens if you just have the Global.VI and Fire External Timing Source.VI code in the interrupt VI and move the BF Get Button Pushed.VI to the main timed loop. Does the functionality work then?

0 Kudos
Message 2 of 17
(6,888 Views)

 

 

The BF Get Button Pushed.vi can only be used in the interrupt vi.

 

I ran the example as provided to make sure that I had all the build options set right...and it ran ok.

 

When I tried to build it using "from scratch" using the exact same elements, it ran, but when the first button was pressed, the LED came on, but never extinguished...(looks like there is only the first interrupt created.)...I thought that it might be because the example doesn't clear the button, so I added the clear button (but to do that I had to know which button, so I added the BF Get Button Number from the previous example, which worked.).

 

This one does the same thing...builds, runs, first button push lights LED, second and all subsequent button pushes ignored.

 

And, yes, Timmed (sp) interrupt from clock is the ISR that I wrote as the interrupt handler...which is designated in the interrupt vi. properties of the right click on the ADSP build object.

 

Interesting.

 

Hummer 1

 

0 Kudos
Message 3 of 17
(6,886 Views)

It is named properly in the Project file ...

0 Kudos
Message 4 of 17
(6,882 Views)

Hummer1,

 

          What was the functionality you saw from the shipping example? Did the LED flash everytime you pressed a button or just everytime you ran the ISR.vi? I don't have a BF537 at my desk right now to check this out myself. Does your built application stop only when a certain button is pressed (meaning if you press button 2 instead of 1 does it still appear to not run anymore)?

0 Kudos
Message 5 of 17
(6,877 Views)

The example worked correctly, each time a button (any button) was pressed, the LED number 1 changed state.

 

When mine runs, the first time you press a button (any button) LED number 1 changes state from off to on.  The system is unresponsive after that.

 

Hummer 1

 

PS...I think this is the same ISR but with the name correct on the PNG file to avoid confusion.

0 Kudos
Message 6 of 17
(6,874 Views)

I did notice that the processor choice on the timed loop in the example was set to 0.  In my program, I have tried to set it to 0 and have also left it at -2.  Either way produces the same result.

 

Hummer1

 

0 Kudos
Message 7 of 17
(6,865 Views)

Hummer1,

 

        Two things:

 

1) Try using "0" instead of "-2" for the CPU infinity on the Timed Loop

2) If you run the code in debug mode, does the Numeric global VI correctly see what button was pressed?

0 Kudos
Message 8 of 17
(6,864 Views)

Nevermind on #1 Smiley Happy

0 Kudos
Message 9 of 17
(6,862 Views)

As to the global variable, I don't know.  Let me try that.  I believe at this point it will work on the first press and not on the following...but let me check.

0 Kudos
Message 10 of 17
(6,860 Views)