LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

need help..please explain to me this part of the programming code...

Hi,

 

can someone please explain to me "PWM Duty Cycle (ticks)"? In the third loop, this variable is a local variable. But in the 2nd loop, it is just a control. According to the screenshot attached, does it mean that value is passed from the PWM Duty Cycle (ticks) control to the local variable (meaning pass from 2nd loop to third loop)?

 

Theoretically, data should be passed from third to 2nd loop, is this right? Thanks in advance..

0 Kudos
Message 1 of 20
(4,214 Views)
Yes, the code in the final frame  in the sequence appears to set the value of the control to a new value based on the calculation in the final frame.
0 Kudos
Message 2 of 20
(4,189 Views)
P.S.  The value of the control changes, but the prior sequence frames don't see the new value until the execute again.
0 Kudos
Message 3 of 20
(4,187 Views)

Hai,

There are two possibilities here to pass a value to the control.

 

1. When the local variable of the 'PWM duty cycle' gets a value the same value will get updated in the control.

2. The value to the control can be passed from RT to the FPGA 'PWM duty cycle' control directly.

 

In any of the ways the control gets updated but the control will hold the value that was updated latest!

 

Hope this helps. 

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 4 of 20
(4,178 Views)

Thank you both of you here, your explanations help. 😃

0 Kudos
Message 5 of 20
(4,171 Views)

I modified my program from this example, but somehow, the host still doesn't work. I've spent time figuring out where has gone wrong but stil...Can anyone please help me take a look and spot if anything is wrong? This is on the implementation of PID velocity controller on fpga.

 

Here are some descriptions:

 

1) When run fpga vi, the position and counts read by encoder work ok. But when i run the host, the position always read zero. It seems that the data cannot be passed from the fpga to the host, thus at host, position is always zero value. The data passed from fpga is in counts, which is non-decimal number.

 

2) Shared variables are to pass values between loops, actually i can need not use them if i put them in the same loop in host?Are tehy in the right place in project explorer?

 

 

 

Download All
0 Kudos
Message 6 of 20
(4,131 Views)
More attachments. If required, i can post the vi here also.
0 Kudos
Message 7 of 20
(4,128 Views)
Anyone? I still can't solve it. It has been weeks..
0 Kudos
Message 8 of 20
(4,082 Views)
Hai,
i looked in to the FPGA vi.  You are not getting the output of only position output in host or none of the outputs in FPGA is not appearing in host.  If this is the case there is some problem with FPGA or FPGA code is struck some where.  Are you sure the FPGA is running when it is run from host check out the error status if any after you run the code from host.
 
One more option you can try is jus develop one FPGA VI with only the top loop that acquires data from encoder and just maually rotating the encoder and see if the same behaviour is see.  This is to ensure that the other loops are not hinderance while running from host.
 
Just try these  options so that you might get an idea where the problem is.
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 9 of 20
(4,075 Views)

Hi,

 

Thanks...

 

Encoder part of FPGA VI can run by itself. meaning when i manual turn it, number jumps. When i run by host, count number didn't jump when I manually move it.

 

Then I remove the last loop of FPGA VI (as I cannot remove 2nd and last loop as i need the pid clock), and run the host and manually shifted the encoder, no count jumps reflect on the host.

 

Any oother ways to test?

0 Kudos
Message 10 of 20
(4,031 Views)