LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ 6361

Hello. I’m using the DAQ card 6361 and I want to use it to generate PWM single to control motor. First of al, I’m wondering what is the difference between PFI and PO pins ? Also, to which pin I connect  motor to generate ? Thank you 

0 Kudos
Message 1 of 12
(554 Views)

This article explains it well - https://www.ni.com/en/support/documentation/supplemental/18/pinout-terminology-and-definitions-for-n...

 

https://www.ni.com/en/support/documentation/supplemental/18/features-and-differences-of-ni-multifunc...

 

PWM is generated using counters, and counters can be routed to PFI pins, and some pins are multi-functional.

 

Here is an example reference to generate PWM using counters - https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1P0CAI&l=en-US

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 12
(543 Views)

Hello. Thank you , this example was very useful and easy to use . I have another question related to it . So now , I send pwm and my motor works , and if I I need to send different signal , the motor stops and then starts with another pwm . My question is , is it possible gradually increase or decrease pwm without stopping the task ? For example, motor works with 15 % and I increase to 16, 17 and so on ? 

0 Kudos
Message 3 of 12
(474 Views)

Hi bezdoganna,

 


@bezdoganna wrote:

My question is , is it possible gradually increase or decrease pwm without stopping the task ? For example, motor works with 15 % and I increase to 16, 17 and so on ? 


Yes, that's possible.

You can set a new PWM value while the task is running, it's the same as setting a new AO value while the AO task is running. With PWM the only limit is: you cannot change the PWM value twice within one PWM cycle…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(471 Views)

So I can set it from 17 to 18% for example , but not further to 19 ? If I understand correctly 

0 Kudos
Message 5 of 12
(464 Views)

Hi bezdoganna,

 


@bezdoganna wrote:

So I can set it from 17 to 18% for example , but not further to 19 ? If I understand correctly 


You can also set to 19%, but only in the next PWM cycle…

 

What is your PWM frequency? Let's assume it's 100Hz then you can set a new PWM value each 10ms, once for every PWM cycle…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(460 Views)

Can you provide an example how to do it ? I don’t quite get it 

0 Kudos
Message 7 of 12
(456 Views)

Hi bezdoganna,

 


@bezdoganna wrote:

Can you provide an example how to do it ? I don’t quite get it 


Right now no.

 

Try:

  • Place a loop around the DAQmxWrite function to set the PWM value.
  • Put a wait inside the loop, waiting for more milliseconds than your PWM cycle time.
  • Change the PWM value inside the loop…

Like this:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(451 Views)

bezdoganna_0-1705390924825.png

Currently I am using this code, I modified example form the LabVIEW.  But for duty cycle I have array of values that are inputs, but before setting new PWM, motor stops and then initiated with a new value. 

0 Kudos
Message 9 of 12
(443 Views)

Hi bezdoganna,

 


@bezdoganna wrote:

Currently I am using this code, I modified example form the LabVIEW.  But for duty cycle I have array of values that are inputs, but before setting new PWM, motor stops and then initiated with a new value. 


When you call the whole VI just to change the duty value then it will start and stop the PWM task with each call.

Why don't you implement my suggestion in this VI to output all the duty cycle array elements in this loop?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 12
(430 Views)