PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Dividing FPGA labview

Hi  for all,

 

my problem look easy but its not real.

 i want to introduce simple equation to my project which simply generate PWM signal with "PWM bridge pair" function. as this function need Ontime and Half_period  with format (I16) and (I32) i want to introduce simple function which convert frequency 32kHz to 625 ticks = Half_period(I32) since FPGA clock its 40MHz so i tried to introduce this equation

 

Hal_period (PWM pair bridge Block) = (40000 / F) / 2 in order to obtain F like input in kHz and not ticks as input.

 i found in forum many solutions like :

 

http://www.ni.com/example/29021/en/

or this one also

 

http://forums.ni.com/t5/LabVIEW/Dividing-in-FPGA/m-p/189324/highlight/true#M109575

 

 i download it  which in attached piece 2   but how to use it with my existing project.

 

i do like this my programme is attached in piece 1 with comments  but not fuction   :/.

 

thanks for all helps.

 

 

Download All
0 Kudos
Message 1 of 11
(5,604 Views)

No answer !!!!!!!!! Please i need help .

i'am blocked at this problem 😕

0 Kudos
Message 2 of 11
(5,567 Views)

Rayden,

 

Could you clarify what exactly is not working for you? You say your program does not function but it is hard to identify what your problem actually is.

 

I did notice that in the code you posted, you have a single cycle timed loop warpped around your entire program. The single cycle timed looped is mean to contain a small amount of simple code. In your program, you have a lot going on inside your single cycle timed loop. I would recommend using a regular while loop instead.

0 Kudos
Message 3 of 11
(5,550 Views)

I want simply to divide 4000 by variable I32 . it means i want to convert ticks in frequency as FPGA clock is 40MHz 

 

F (KHz) = 4000 / Variable (tikcks) thats it. the problem is dividing when i use R and Q fraction or simply bloc  fraction /   is not function in labview with FPGA target.

0 Kudos
Message 4 of 11
(5,522 Views)

Comparing your code to the provided example, it seems like you are missing a shift register in your while loop. Could this be the cause of your error?

 

Again, I would not recommend using a single cycle timed loop with a while loop inside of it. 

0 Kudos
Message 5 of 11
(5,506 Views)

not yet. 😕

 

the problem is how to inject while loop and FPGA Horloge loop.

there is no other solution without looping to avoid loop problem to do dividing of 2 variables in FPGA !?

0 Kudos
Message 6 of 11
(5,375 Views)

You cannot divide or use loops inside a single cycle timed loop.

0 Kudos
Message 7 of 11
(5,357 Views)

Yes i confirm it.  So how can i do to divide 2 variables format U16 ?!!

 

Please i am blocked for 3 weeks 😕

0 Kudos
Message 8 of 11
(5,350 Views)

You should be able to divide two U16s in a normal while loop. Just make sure to remove your single single timed loop. Division takes more than one cycle of a timed loop.

0 Kudos
Message 9 of 11
(5,337 Views)

i didn't understand can you give me some détails !

dividing in labview its different than dividing in labview FPGA  😕

please can you tell me what modification i must introduce to my program a sugestion look very usefull. thanks

0 Kudos
Message 10 of 11
(5,328 Views)