From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fpga: cannot update the timer on fpga via host.

Solved!
Go to solution

Hello all,

 

I have been working on FPGA project. It has several paralel loops and runs with certain sampling time.

I would like to change the timing on one loop, it's called output loop. I would like to slow down the loop so the the loop updates the output less frequently. (see the attachment - red circle)

I have modified the code by changing the timer via host. (see attachment - blue circle).

 

I have done several things such as:

1. Adding manual switch that allows me to change the sampling time from normal mode (same sampling time with other loops) to manual mode (put certain number to the timer).

But, this was not working all the time. I monitored the value on the host, it's still on the same sampling time, even I write the customized timer value.

2. I changed the strategy by putting the other control connected directly to the timer (without switch) in the loop so that I can change the value directly. However, it's still no luck. The result is not reliable. It sometimes slows down and many are in the same rate as before.

3. I even put a case structure in front of the output so it's only updated after sometimes (every 100 or more loops). It still doesn't help. I can see the speed varies but it's not as expected.

 

Hardware is piezo drives/motor. But, I would like to slow down the speed, not increase the speed. So, it shouldn't be a problem.

 

I really appreciate if there is any feedback or suggestions.

 

Kind regards,

Areku

 

0 Kudos
Message 1 of 4
(2,294 Views)

Hi Areku,

 

if you want your expected behavior you should at first remove coercion dots in your code.

 

One bigger problem should be the coercion dot at the loop timer function…

 

Why are you using local variables when the terminal isn't used in your code?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,289 Views)
Hi GerdW,

thank you for your reply.

I have removed the local variable with terminal and selected the same type number with loop timer. So, there is no coercion dot anymore. But, it's still not working properly.

kind regards,
areku
0 Kudos
Message 3 of 4
(2,275 Views)
Solution
Accepted by topic author areku

Hi all,

 

after consultation with my supervisor, he recommended me to pass on the value to new or intermediate control first. then, update the control value which is connected to the loop timer with the value from that intermediate control. It will update the value of loop timer after one loop elapsed (when intermediate received value from host and update it to control connected to loop timer). It works very well now.

 

I don't know exactly the mechanism labview writing or updating value on fpga via host. But, it seems to me, in my case, there was a problem writing a value to the control that is connected to the loop timer where was running in relatively fast. So, the control kind of ignore/reject the new value as it is busy running the loop in fast speed.

 

Thank you again for replying my post, GerdW.

 

Kind regards,

Areku

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