04-04-2014 01:52 AM
Hi
I would like to know if it is possible to create a PWM with a variable frequency with labview ...
Thanks !
Solved! Go to Solution.
04-04-2014 07:04 PM
You can change the PWM frequency by using functions built into the Arduno IDE. There is no capability built into LIFA for changing the PWM frequency by using the functions built into the Arduino IDE. If you need this capability you would eed to add this capability to LIFA. The following two links provide information on changing the PWM frequency.
<http://playground.arduino.cc/Code/PwmFrequency#.Uz8-V6hdU_o>
<http://playground.arduino.cc/Main/TimerPWMCheatsheet#.Uz9G6qhdU_o>
hrh1818
04-07-2014 01:52 AM
Thanks but this is not that I would like to do... I try to do a signal with a frequency between 44 and 63 Hz. I know how to do with the code (by using PWM library) but not how to interface with labview... It is possible to control a data with labview? for example my function has "freq" as a parameter and change its value with labview
04-07-2014 09:05 AM
Generally, if it's possible with Arduino, it's possible with LabVIEW via Arduino. If not already available in LIFA, you have to create custom functions to access the functionality.
04-07-2014 12:49 PM
Can you control the frequency using the Arduino serial monitor. If yes it will be easy to control the frequency using Labview. If you can not control the frequency using the Arduino serial monitor you will not be able to to control the frequency using Labview.
hrh1818
04-08-2014 05:07 AM
I succed in control a parameter in a function. I used a VISA to write on the serial port and it works !
But my problem now is : Labview already uses the serial communication for its interface with the arduino. So there is a conflict between the 2 serial communication ! I can't read 2 differents datas on the same port.... ( not use two times Serial.read()). So I can't use an other simple function in Labview like PWM write for example....
04-08-2014 02:23 PM
Were you able to change the frequency when you sent the command via VISA? If yes, you should post the Arduino code that you used to be able to chagne the frequencey. That way, we can determine if it's possible to integrate it into LIFA.
04-09-2014 05:59 AM
This is my code !
04-09-2014 07:01 PM
I created a custom LIFA function based on your Arduino code. I made some assumptions since I did not have that include file (I was also unable to compile for the same reason).
Take a look at the code to see if my assumptions were correctly. Let me know if it works.
04-10-2014 01:53 AM
Thanks !
But this is the duty cycle which changes... not the frequency when I put in value between 43 and 61 hz (the duty cycle decreases while I increase the frequency). After 61 hz, the frequency up to 3 khz... Maybe the default function arduino is not able to make the difference.... it is really weird.