LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous generation of waveform

Hi mhs100,

 

I would say you should take a look at the following example, which explains how to handle events generated in subVI. This seems to be what you want to do (update the amplitude of your sine wave in this subVI during runtime).

Best regards,
Rohan B
0 Kudos
Message 11 of 16
(1,163 Views)

I'm sorry but I don't think I should load the Advantech library since I am using a work computer.  Your vi is still a wiring mess, which causes me to take extra time to look at it.  You still have wires on top of wires. You still have right to left wires.  You still have many unnecessary bends.  All of this makes me not want to even look at your vi's.  I'm a volunteer, I don't work for NI, and my time is limited.  This is what I suggest if you want help:

 

Clean up the wiring.  Put comments in your code explaining what each section and what each subvi does.  This alone will make it much easier to understand what you are doing.  Give a detailed explanation of what problems you are having, pointing out to the code section where the problem is occuring.  PUT DELAYS IN YOUR LOOPS.  I've said it before and you did nothing.  Maybe by "shouting" you will get the message.  In the vi with the event structure, put a value for the Timeout case.  100mS will probably be OK.  Move all the setup subvi's outside the loop.  No need to repeat these over and over, except for the subvi that changes frequency if that is what you want to change.  Again I said this before and you did nothing.  If you don't follow my advice, I won't give it anymore.

 

You will have delays between sine waves because of the way you coded it.  It outputs a sine wave, then you go through all that setup again, then it outputs another sinewave, and so on.  You need to study the device library you have and find out how to output a continuous wave.  The only thing that should go into a loop is the event structure and the code to change the frequency.  I am not going to study your device to find out how to output a continuous wave.  I don't have the time.  Besides, that is your job.  I can only help with code problems.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 12 of 16
(1,154 Views)

mhs100,

 

Why did you download the old LabVIEW driver for your card instead of the latest one? It has the simple example I mentioned and is much easier to use. Similar style to the old tradtional DAQ driver from NI.

0 Kudos
Message 13 of 16
(1,154 Views)

Hi

 

The example you told earlier looks really good. Is there however any function you can change the amplitude periodically and automatically? I have to change the amplitude in 12 steps. I tried with for loop but to no avail.

 


Danke im Voraus,

Thanks in advance

Julian Samangun

0 Kudos
Message 14 of 16
(1,036 Views)

'But to no avail' really does not explain exactly what you did and why it does not work. Attach your code.

0 Kudos
Message 15 of 16
(1,032 Views)

Hi,

 

I practically put the  signal generator in a for loop and wire an array to the amplitude input from outside the for loop. the waveform generated is a 2D array and can't connect to the DAQmx write.vi at data pin with the same mode. I am sorry I don't have the code right now. it is all in the computer at work. I'll try to update soon.

 


Danke im Voraus,

Thanks in advance,

Julian Samangun

0 Kudos
Message 16 of 16
(1,017 Views)