Using labview cosimulation, how to control PWM duty cycle in multisim

I am new to using Multisim with LabVIEW using cosimulation. I want to ask if there is a PWM component in Multisim that can have its duty cycle be controlled using LabVIEW? I have an algorithm in LabVIEW that outputs duty cycle values from 0 to 1, representing duty cycle percentages.
How do I control the PWM duty cycle in Multisim using LabVIEW cosimulation?
Many thanks,
SPECTRE
Solved!
Go to Solution.

Hi Spectre,
In Multisim, search for the parts base on functionality, there are some PWM models in the database.  Have a look at this knowledge base  if you don't know how to search for parts:
http://digital.ni.com/public.nsf/allkb/7309A5CABC677296862577ED006EC99E
Aslo, have a look at this knowledgebase:
http://digital.ni.com/public.nsf/allkb/EF391C48CF71AE4F862571B900644F84
This article shows how you can get Mutlisim and LabVIEW to co-simiualte:
http://www.ni.com/white-paper/13663/en
I hope this helps
Tien P.
National Instruments

Similar Messages

  • PWM duty cycle update stalls

    Hello
    I want to output a variable pulse width modulated signal via counters. The duty cylce should follow a sine or triangle pattern from 10 to 90 percent.
    Problem: When I observe the ctr output with an oscilloscope, I see that the update stalls, i.e. for some time, the output is seamlessly variable as expected, but then, update stalls and jumps to a new duty cycle to continue variable again.
    I tried several different approaches,
      -for-loop with wait ms- timing and single sample,
      -timed loops with single sample and
      -pulse train ouptut via DaqMX-Write-Counter-n-Samples.
    Albeit to no avail. In any case, I get jumps in the PWM duty cycle instead of smooth transitions.
    System is either cDAQ 9174 or PXI with 6602. As system load is 99% idle state, I can't imagine the OS at fault.
    Solved!
    Go to Solution.

    Hello, Frank
    After looking through some documentation, I think that I need RT-HW for what I want.
    6602 cards have STC-2 without buffer, so updating duty cycle is OS-limited. Even in timed loops there is no guarantee that update will run at the specified rate of 1/140 sec. I'll probably just get an error for untimely execution....
    With STC-3 based counters (such as cDAQ9074 or X.series PXI 6361) I can load 127 values into buffer which will be processed smoothly but on renewal of samples (every 127/140 sec), I get stalls again, since the OS seems to consider my request inappropriate. I was surprised to find that USB vs PXI does not change the behaviour, though I'd have expected better latency from PXI.
    Attached, please find a VI to get an impression of what I tried out. Pardon for code ugliness.
    I still hope that I maybe have missed something simple to get running with what HW I got
    Best regards
    Michael
    Attachments:
    Unbenannt 1.vi ‏172 KB

  • How can i use labview.tl​b to control Labview from an external applicatio​n?

    Hi,
    I've been told by a labview engineer that i could use the file
    labview.tlb located in the labview install folder to control labview
    from an external application (in my case, a C# app). I'm using Labview
    6.1 under Windows 2000. This article confirms that:
    "ActiveX and LabVIEW"
    http://zone.ni.com/devzone/conceptd.nsf/webmain/54​01BE584FBAEECE862567C2006D36C7?opendocument
    But i've not been able to find out how to use this file to achieve
    what i want. I just want to be able to open/close labview, open/close
    a vi, start/stop a vi, hide/show a vi from a C# application. The above
    web page talks about activex but i really don't see the realtion
    between activex and that labview.tlb file.
    Is there so
    mebody around who knows how to use that file? Why does NI
    tell us that it's possible to do what i want to do but doesn't explain
    how (or hides this info very well)?
    Thanks

    Hi,
    > Hi I am fighting a similar problem and so far I found this: Calling
    > LabVIEW from C++ Using ActiveX
    >
    > http://sine.ni.com/apps/we/niepd_web_display.DISPL​AY_EPD4?>p_guid=B45EACE3E21356A4E034080020E74861&p​_node=DZ52051&p_submitted=N&p_rank=&p>_answer=&p_s​ource=External
    Thanks for the link, i actually already found this link before. I've
    found yesterday how to use Labview.tlb, just add it to the references
    of the project, it was probably too easy for me at that time:-) But
    now, i'm still stuck as there is no doc about using the interfaces and
    classes of this activex to control labview.
    The example given on your link is made is C++ and for some reasons,
    the wrapper generated for Labview.tlb when i added it to my c# project
    doesn't seem to expose the same
    interfaces and classes as the one used
    in the C++ example. I therefore can't use the C++ example in C#.
    I've tried to do something like:
    LabVIEW.ApplicationClass a = new LabVIEW.ApplicationClass();
    Just this line causes labview to launch but then immediately throws an
    exception: "Query interface for interface LabVIEW._IApplication
    failed".
    Does somebody knows how to use that control in C#/VB.NET ?

  • Using LabVIEW 5.01 to control HP E1411B DMM

    The IVI drivers (for LabVIEW 6) I find do not work with LabVIEW 5.01.
    It appears that the E1411B is a register-based VXI instrument which
    means it doesn't respond to SCPI commands. I have no clue how to use
    LabVIEW 5.01 with register-based commands to control it. The examples
    in the manual are in HP basic. The E1411B is the same as the E1326B if
    that helps. Are there some example programs that show how to use LV
    5.01 to control a register-based VXI instrument?

    There's a LabVIEW driver (not IVI) available for the E1411A. You can get it here.

  • Measuring PWM duty cycle with Analog Input

    Hello folks,
    I have a NI 9205 module and was wondering if there was a way to measure the duty cycle of a PWM signal that I am generating with a separate microcontroller?  I have found a lot of examples with Digital inputs but not analog.. Is this possible?
    Thank you,
    Bob

    Hi Robert,
    I'm not sure what that error is, try searching for it.
    If you want to measure a PWM signal you would usually use a counter input.  A counter is a dedicated piece of hardware that is used to measure digital signals.  Since the NI 9205 is an analogue device and it doesn't have any counters onboard, you will not be able to select counter input.
    I would recommend you get the right tools for the job and buy a digital acquisition device with an onboard counter.  It will make reading PWM much easier for you.  The NI 6008 has a counter onboard and is only £99.  It will also offload processing from software to hardware since you don't have to calculate duty cycle.
    If you still want to use analogue post back and we can look into why its not working for you.  Tips to start you off: Voltage is the correct setting and  Look in the manual and make sure you have connected it like you have configured it (differential, RSE, NRSE page 14)
    Lewis Gear CLD
    Check out my LabVIEW UAV

  • Detect 0% and 100% PWM Duty Cycles on 660X Card

    Hi,
    We essentially want to be able to detect 0% (all low) and 100% (all high) duty signals as well as > 0% and < 100% duty.  However, I noticed that when performing buffered pulse width measurement, if either 0% or 100% duty occurs, the previous detected duty is stored.  It seems as if the next edge or level change isn't detected, then the HWSave or SWSave registers store the last successful count.  Is there some flag on a status register for the NI PCI-6602 card that would indicate whether PWM is continuing to be detected?
    Thanks,
    Jeff S.

    Hi Jeff-
    You might be able to achieve this operation by setting the Counting_Mode to Synchonous_Source mode.  Check out the descriptions for bits 2:0 of the Gi_Counting_Mode register, as described in the 660x RLP manual page 3-22.  In that mode, you also must set the Gi_Alternate_Sync bit as described on page 3-21.
    Without making the change to synchronous counting, you might also be able to glean some useful information about when an error condition has been met by periodically monitoring the Gi_Stale_Data bits, as described on page 3-13.
    I haven't tested this, but I wanted to offer a few quick tips to try.  Please give these a try and let me know your results.
    Thanks-
    Tom W
    National Instruments

  • How to decode duty cycle using LabVIEW?

    The duty cycles are output of an accelerometer, which are the input of the DAQcard-DIO-24, but how to decode the duty cycles after acquisition? I knew a timer would be useful, but have no idea about how to perform with labview.
    Thanks a lot.
    --yang
    Message Edited by YangLi on 02-23-2006 05:43 AM
    Message Edited by YangLi on 02-23-2006 05:48 AM

    This will still be a very difficult task without dedicated hardware, and the 1ms resolution will still be relative to other things outside your control. Timed Loops give the tasks they execute a high priority in terms of processor time, but Windows will always be able to preempt LabVIEW in favor of anything it pleases (anti-virus software, automatic updates, screen redraws, etc.). The Timed Loop gives you the ability to dynamically handle what you do in such a situation (discard loop iterations, abort, etc.), but this is not ideal.
    You would really be much better off, as Dennis said, with dedicated hardware. Most NI MIO or DIO boards come with a couple counters, which can measure high times and low times against a high-accuracy clock and calculate the duty cycle. The advantage here is that the hardware is doing all the work with real-time accuracy, so you don't have to worry about software-timing and Windows instability. In addition, the API for this in LabVIEW is much simpler.
    If you choose to try using timed loops, then you will have pair each digital acquistion with a timestamp and for a sort of digital waveform.
    Jarrod S.
    National Instruments

  • Using LabView, Arduino, and Easy-Driver to control a Stepper Motor

    Hello fair folks of the LabView forums!
    I am a humble engineering student in need of some advice and input on a project I am working on.
    I’ve also done a fair amount of reading on the LabView forums with people trying to use LabView and Arduino to control stepper motors, and I’ve used as much information from each as I could. However the problem I'm encountering now is one which is unique to my VI Configuration.
    So, here is what has been done thus far:
    -Installed LabView Interface for Arduino [LIFA]
    -Installed necessary VISA drivers for LabView to communicate with arduino
    -Uploaded firmware to Arduino to allow it to communicate with LabView
    -Properly wired Stepper Motor with Easy Driver and Power Supply; I have verified this by first using the Arduino independently of LabView, using example code found here.
    -I have created a VI, and have just recently got it to run without reporting back any errors. While I suspect the behavior I’m encountering has to do with something inside the VI, it is difficult to determine as there are no errors being reported!
    But here is general problem I am encountering:
    -Connect Joystick to USB Port, connect Arduino to USB Port.
    -Plug in outlet for Power Supply
    -Open LabView VI
    -Run LabView VI
    -LabView successfully detects Joystick, and Arduino.
    -Tilt Joystick; Stepper Motor moves in proper direction, but it only takes a single step. If held, it does not move further. If returned to zero, and then tilted, it again only takes a single step.
    I know that in the example code, the Arduino issued the step command by writing the signal from LOW to HIGH, and varied the speed by how often it did this.
    I assumed that the Write-PWM feature would do this same thing, but perhaps my assumption is wrong. I will continue to tinker with this myself, but I would be extremely grateful for any insight you might be able to lend.
    I’m thinking, if not the Arduino Write-PMW feature perhaps a simple timing-sequence that could be used to alternate between writing 0 and 1, with the timescale of the sequence being scaled to the X-Axis from the Joystick. But, I am open to suggestions, and certainly appreciate any thoughts you may have to offer!
    Attached to this is the VI used in this setup, a picture of said VI, as well as a rough sketch of the hardware configuration.
    Thank you!
    Attachments:
    Arduino Stepper Control.vi ‏1224 KB
    VI Picture.png ‏82 KB
    Configuration Sketch.png ‏522 KB

    Hi danjifraga,
    I am not so familiar with the Arduino toolkit functions, but you may have better luck looking at the Arduino page at:
    www.ni.com/arduino
    I'll ask around on Monday to see if anyone is more familiar with the toolkit.
    Good luck,
    Brian
    Brian G.

  • How to measure PLL lock time using LabView?

    Hi.
    I have to measure PLL, especially PLL lock time, using LabView.
    How can I do it?
    Is there is some dedicated LabView Toolkit that can do PLL lock time measurement?
    Thanks :-)

    Hi Igor,
    you want to measure the time it takes the PLL to lock in to a change in the source frequency?
    So you need to measure the frequency and you need to know the state of the PLL. Then you can calculate the time the PLL needs to work.
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Sorensen SGI control using labview

    Hi,
    I am attempting to control a sorensen sgi400/63 dc power supply using labview. I have the supply connected via rs232 and using windows hyper terminal i am able to issue a *idn? command and get a response back detailing model name / number etc. - This says to me that the comms link is working.
    My troble comes when trying to use labview to do the control. I  have downloaded the labview driver for this power supply form ni.com - this gave me a .zip folder (called sornsg.zip) containing some .vis. I opened the self test vi. It seems when run in highlight execution mode that all is well writing to the supply, but reading from it throws the error -10738007339. Any ideas?
    I have contacted sorensen but no reply as yet...
    Many thanks.
    Attached is screen shot of the vi not working quite as i'd like.
    Attachments:
    selft test.jpg ‏1615 KB

    I still have the error.
    What error are you getting?
    I'm not sure what you mean by changing the display mode to "\".
    Right click on your "*IDN?" string constant and select the display mode - Normal, \, Hex or Password
    Also in the "Visible Items" select "Display Style" to show the '\" symbol in the string constant.
    Is there anyway to configure a termination character in labview?
    Yes with the same property node that you are using to set the other com port settings.
    But for the writes you do not need to if you include at the end of your *IDN? string. Now as for the read, it is good to set the termination character for the VISA reads and then set the bytes to read to some number larger than anything you expect.
    Omar

  • Problem to measure 0% and 100% duty cycle of a PWM.

    Hi,
    I am using counters of USB-6341 to measure duty cycle of PWM just by following the example 'Meas Duty Cycle-Buffered-Finite.vi'. It works almost all the time. However, when the duty cycle of a input pwm is 0 or 100%, the DAQ can't read anything, in another word, it can't measure 0 or 100% duty cycle.
    How to modify that?
    Thank you very much :-)
    Nan

    That's the thing about PWMs, you never really know if the PWM is 0% or 100%.
    Let's say we have a 50% duty cycle, at 1/2Hz.  So low for 1 second, high for one second right?  What if we run at 1/20Hz, so low for 10 seconds high for 10 seconds.  Or is this a 0% duty cycle for 10 seconds, and a 100% for 10 seconds?
    A true PWM read will never be 0% or 100% it will just keep waiting until the trigger is seen, and recalculate the frequency and duty cycle of it.  The solution to your problem is for you to define a duration to watch for a change, and if one isn't seen, then you can define 0% or 100% appropriatly.
    So I would recommend taking your duty cycle like you normally are, and then at the same time watch the digital signal for however long you want, if the digital line does not change state, then output 0% if it is low and 100% if it is high and ignore what ever duty cycle you read.  But if the digital line does change state, then use the read duty cycle as the actual value.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Generate complement​ary digital signals with dead time between each pulse and controlled by duty ratio

    I am to generate  two complementary digital signals using NI 9606 conected by RIO Mezannine Card to NI 9683 (Half Bridge DO).
    I am able to generate the signals but I am not able to put dead time between high and low signal and also, low and high signal.
    Requirement:
    (1) When the first signal goes high and the second signal goes low, there should be a controllable dead time.
    (2) Also when the second signal goes high and the first signal goes low, there should be a controllable dead time.
    I am able to do requirement 1, but I am unable to fulfill requirement 2.
    Please have a look at my VI and let me know how to go about satisfying requirement 2.
    Attachments:
    complementary test 2.vi ‏69 KB

    Hi Frank ,
    I have already taken note of the example Tannerite has provided  and have built my vi ( attached in previous post) surrounding that example.
    Now I require to control the PWM duty cycle as you can see from the vi using a knob and that control refers to both the signal 1 and 2.
    Now the signal 1 end and signal 2 generation requires a controllable dead time. Similarly, signal 2 end and signal 1 geneeration also requires another controllable dead time.
    I am able to do either one dead time at a time using delay but not two dead time simultaneously.
    I feel that I have two put the delays at the appropriate data flow point. I am working on that.
    I would really appreciate if you could give some insight on how to solve this dead time issue and generate two complementary waveform with dead times whose duty cycle can be controlled by a knob controller in fronty panel .
    I have also posted the required timing diagram for reference as suggested by Tannerite.
    Best regards.

  • Dynamic Duty Cycle Change for PWM

    Hello savvy LabView people out there!
    I am trying to do PWM for servo control using LabView.
    I have been able to manually move my servo with this: http://www.ni.com/white-paper/2991/en
    My goal is to automate the servo position as a sinuisoidal movement, and to do so,
    I need to automate the duty cycle to oscillate in 5%~10% automatically over time.
    I have looked into some stuff as:
    http://forums.ni.com/t5/Counter-Timer/PCI-6602-PWM-GENERATION-Dynamic-sine-duty-cycle/td-p/1522442
    But it was not too helpful, as I was also getting Error -200301.
    I want to be able to move the servo position at ~10Hz, if that is important, and the square wave freq. for the
    servo signal (PWM) has to be 50Hz.
    Any help? Thank you!
    Attached is what I am trying to do. The sine motion of the servo is (supposed to be) actually paired up with
    an analog output from a BNC-2120 board. The servo control part is separated on the top portion.
    Solved!
    Go to Solution.
    Attachments:
    ServoTest3.vi ‏110 KB

    Is something like this for the PWM look like what you had in mind?
    (see attached)
    This works, but I need something that responds faster.
    For example, the PWM needs to be at 50Hz, which means the loop delay should be able to
    go as low as 20ms
    In the picture, it is currently 200ms, and this does not run. I found that with 50Hz, the minimum
    delay that the Error 200301 doesn't pop up is with 500ms delay, at which point the
    accuracy of PWM duty cycle in each period is compromised.
    Is there a way to have the loop delay be as low as ~20ms?
    Attachments:
    Servo.jpg ‏52 KB

  • How to convert a number to duty cycle (FPGA)

    Hi
    I want to convert a numerical number to a duty cycle value in FPGA module so I could use it to generate a PWM signal for the numerical value.
    I tried dividing it but it shows an error in FPGA as it would produce a float value. I tried even the example of scaled division but the quotient is rounded of to 0 (I wanted to convert an output by multiplying 10/36).
    In my project the 100% duty cycle is 360 degrees and 0% is 0 degrees of the motor shaft rotation.
    Please help me I need to use it for my project.
    Thank you
    Dinesh

      I am not exactly sure how your duty cycle is setup, but here is a way we have used a number to create a PWM in our FPGA.
         If you have 360 deg. then I would guess you want to create a PWM duty cycle that is some fraction of 360, say "number"/360.  You could use a for loop where 360 is wired to the "N" and then your "number" can be compared to the current loop count.  That comparison would be true/false which could triger a DIO to be high or low.  Therefor, if   (loop count) < "number"  then DIO is HIGH,  if (loop count) >= "number then DIO is LOW.   This would send out a PWM that has a duty cycle of "number"/360, (multiply by 100 to get in %)  
         I hope this helps.
     --Alex--

  • "create analog signal" programmatic control of parameter Duty Cycle

    I need to generate a square wave with a programmable duty cycle in LabView (not SignalExpress).  I can use "Create Analog Signal" for a fixed duty-cycle signal but I cannot figure out how to get at the Duty Cycle parameter to change it programmatically.  I was hoping for something like Property Node access but found that this only works for front panel objects.
    Is there a way to dynamically change the Duty Cycle parameter in the "Create Analog Signal"? 
    Solved!
    Go to Solution.

    The Square Waveform vi found in Signal Processing - Wfm Generation has an input at the top for offset.
    - tbob
    Inventor of the WORM Global

Maybe you are looking for

  • Can I use old iPhone 4S in Europe for WiFi, w/o cellular service? A few Qs not found in Support Community-

    I wish to upgrade to iPhone 6, but first want to know if I can use my iPhone 4S for camera, iMessaging and apps (i.e. What's App) on Wifi after it is disconnected from U.S. Verizon network? iPhone 4S, iOS 7.1.2 (reluctant to upgrade to 8.1.2), Verizo

  • MAC Excel 2011 cursor issues

    I am using Mac Office Excel v. 2011.  Since upgrading to LION I opening Excel the cursor shows as a square box with small arrow points on the upper left and lower right corners.  A left or right mouse click will not return the cursor to a plus sign a

  • What is the Function Equivalent of =TEXT(B4,"hh")?

    =TEXT(B4,"hh") is a formula I found in an Excel spread sheet and I want to use the equivalent in Numbers, but I can't find it! can anyone help? epmacman

  • TimeStamp application with OSDT.

    Hi. I've tried to make a TimeStamp application with OSDT libraries (osdt_cert.jar, osdt_cmp.jar, osdt_cms.jar, osdt_core.jar, osdt_tsp.jar). I can get timeStamp information like TSA, SerialNumber, etc, but I've a problem when try to save TimeStamp in

  • About posting in Swing Forums

    Please check this topic http://forum.java.sun.com/thread.jspa?threadID=5202439 thanks Angel