LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time controled cicle

Hi, I'm having an implementation problem which my biggest problem is that I don't actualy know how to search my anwser.

 

I have a program that adquires some values from my inputs, after that I do some calculations and finaly, depending on my output I have to convert to a PWM, so in a time base I have to control the ON/OFF off my PWM but I can't get stuck here, and I just can't use a while loop. It's forbidden.

 

Can anyone explain me how to do that? how do I have always a PWM output and keep reading my inputs?

 

Thanks and sorry for my bad explanation of the problem.

0 Kudos
Message 1 of 12
(3,430 Views)

-> How are you planning to generate the PWM (what hardware have you selected)...!!


@Top24 wrote:

Can anyone explain me how to do that? how do I have always a PWM output and keep reading my inputs?


You can have PWN generation and input acquisition in saperate & parallel loops.

-> can you share your code, and tell us, what you have done so far

-> And last thing, what is "Cicle"??


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 2 of 12
(3,425 Views)

I can't share the code due to company privacy 😕

 

I'm not working with any hardware for now i'm just simulating and of course that I'm new at labview.

 

I have something like this:

 

- Aquire temperature

- Use a Pid control go generate a 0 - 100 analog signal

- After having that 0 -100 analog signal I want to convert it into a PWM signal so I do it mathematicaly comparing the iteration I'm in and the analog value and in a while loop I have mt time frequency and it is simple. the working PWM is one I found here in the forum and I'ts in my post below.

 

The problem is the last topic is working using the VI I'm sending BUT I need to make it work without the while cicle 😕

0 Kudos
Message 3 of 12
(3,420 Views)

I saw your code, now as you're using 'Shift Registers', you cannot remove compltely the While loop (it's not While ciclecycle). But if you want to convert this code (PWM from an analog signal.vi) into a subVI, which should run just once, probbaly you can change the existing While loop to a single iteration loop OR a cleaner approach would be include 'Feedback Node'.

 

PS: Single iteration loop is either a For loop with '1' wired to N terminal OR a While loop with 'True' connected to conditional terminal (set as 'Stop if True').


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 4 of 12
(3,411 Views)

Shift registers are not a problem since my pwm is still in a while loop BUT that while loop is the same that has the PID, so if I have to rum the while loop 100 times to have a full period of my PWM controler in that time I'll run my PID 100 times witch will change my analog PWM input without the cicle is complete

0 Kudos
Message 5 of 12
(3,408 Views)

This is a sample of my program 🙂

0 Kudos
Message 6 of 12
(3,400 Views)

Your problem statement is not very clear, but I made some modifications and you can use this code for your reference.

Specially check the changes done in "PWM from an analog signal.vi".


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Download All
0 Kudos
Message 7 of 12
(3,371 Views)

Putting both those files together I still have 2 while loops. I' trying to put everything in a while loop only 😕 

0 Kudos
Message 8 of 12
(3,364 Views)

@Top24 wrote:

I still have 2 while loops.


Where do you think is the second Loop???


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 9 of 12
(3,351 Views)

each file has a while loop I was looking for trying to gather both in a single VI with a single while loop

0 Kudos
Message 10 of 12
(3,343 Views)