LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange execution of timed loop with labview ARM

Hi,

I'd like to sinchronize timed loop with the processor clock.

I did this VI that should normally blink the LED:

Sans titre.jpg

there is two strage thinks:

I enabled Iterrupt andd named Timer0 "timer". when I execute the VI I have this error

Error in expression Detail: [UVSC_DBG_CALC_EXPRESSION, MSG: 0x200A, STATUS: 0xD] (13)

 

that's the first problem.

so I tried a simple timed loop (without externaltiming source) and defined 1kHZ as frequency and 1000 as period, the VI runs but the LED didn't blink: before the not gate ant after the value is true. On PC the same VI blink a LED

0 Kudos
Message 1 of 14
(8,673 Views)

To trigger a timed loop from interrupts you don't have to Create External Timing Source, just give the loop timer name.

The LED is blinking
as expected on my board.

Probes are not updated instantaneously - that's why you might see TRUE on both sides. (see again the picture from http://forums.ni.com/ni/board/message?board.id=420&thread.id=1363)

0 Kudos
Message 2 of 14
(8,657 Views)

Hi NICB,

Thank you for answer.

About refreshing, ou where right.

A did some tests.

A while loop with  "wait(ms)" runs correctly and LED blinks

Timed loop in debug mode runs correctly If there is no "elemetal IO" LED0

with elemental IO an in debug mode I have this error :

 

Sans titre.jpg

 

 If I desable debugging It runs correctly and LED blinks

And finally with Timer interrupt the VI runs and LED dont blink so I dont know what do the VI do exacly

0 Kudos
Message 3 of 14
(8,646 Views)

Try to attach the project and I'll take a look tomorrow (clean the project in uVision and send the generated files as well).

0 Kudos
Message 4 of 14
(8,641 Views)

Here are 4 VIs, you can try hem with and without debug mode. the compiled source ware done in debug mode for the 3 first VIs and othout Debugging for the last one.

 

0 Kudos
Message 5 of 14
(8,635 Views)

Hi Neil,

 

Every single application is working just fine. Unfortunately I couldn't find anything wrong in generated files or uVision project (actually I had also compiled and run your projects without LabVIEW and they are also working).

 

Since I couldn't reproduce the error and generated files are the same I cannot understand what happen in your computer (e.g. which symbol is trying to find LabVIEW unsuccessfully when debug mode is enabled).

 

Couple differences might explain the behavior: I have LabVIEW 8.6 (not 8.6.1) and MDK-ARM 3.70. In your place I'd better reinstall the ARM module and update MDK-ARM. After intalling 3.70 you will encounter few errors, but you can find sollutions here: http://forums.ni.com/ni/board/message?board.id=420&thread.id=1317

 

I apology for confusing you in a previous post:LabVIEW 8.6 don’t create automatically an external timer source.

However LabVIEW 2009 don't support timed loop handlers any more, so the feature could be forgotten. Talking about versions – I run your project successfully without modification in 2009 (of course, except time loop handlers).

 

Please post a reply here if you are fixing yourself the problem.

 

Nic

0 Kudos
Message 6 of 14
(8,617 Views)

Hi Nic,

 

Actually I use LV8.6.1 and uV3.6.2

I will try LV2009 as soon as I have my DVD

 


 

Please post a reply here if you are fixing yourself the problem.


 

 Sure

 


I apology for confusing you in a previous post:LabVIEW 8.6 don’t create automatically an external timer source.

However LabVIEW 2009 don't support timed loop handlers any more, so the feature could be forgotten. Talking about versions – I run your project successfully without modification in 2009 (of course, except time loop handlers).


That means that there is no way to execute timed loop faster than 1ms or perhaps does it supports 1MHz like in Real Time?
0 Kudos
Message 7 of 14
(8,611 Views)

Neil,

 

It is hard to switch tasks in microseconds if the CPU clock is 50 MHz.

In LabVIEW 2009 an interrupt cannot handle a timed loop directly but it could call an ISR vi where you can put a small piece of code. Depending of the complexity of that code the ISR vi can finish its job in microseconds. (this mode could reach 1MHz, but not very often - actually in C is hard to get such rates) 

Additionally, if the code is more complex, the ISR vi could be declared as a thread – this feature is almost as triggering a timed loop in LabVIEW 8.6.

Also, in the interrupt vi someone can drag a Fire External Source VI – this is exactly as handling directly a timed-loop.

 

Concluding, there is more flexibility in the new version.

 

Until updating to 2009  I am aware about what's happening in your computer

0 Kudos
Message 8 of 14
(8,608 Views)

Hi Nic,

 


Until updating to 2009  I am aware about what's happening in your computer

 

I tried the same VI with LV2009 for ARM/uV3.7 and I obtain the same error.  Really strange. Sure there is a problem with my PC but I don't know what.


It is hard to switch tasks in microseconds if the CPU clock is 50 MHz.

 I don't nead 1MHz execution. I'd like to deloy a VI that I allready done with CRIO in ARM Board, the control loop runs with 20kHz

0 Kudos
Message 9 of 14
(8,580 Views)

Neil
Do you have an English LabVIEW version?
Also, what operating system do you have?
I am asking this because there is already a known issue for Japanese (
Installation of the LabVIEW ARM Module fails if %TEMP% contains Japanese characters)

 

I suggest you try all examples provided in LabVIEW 2009\examples\lvemb\ARM\LM3S8962 and tell us or NI support if they are working or not.

 

After that we could go further and see if the algorithm from CRIO is deployable to ARM

0 Kudos
Message 10 of 14
(8,564 Views)