07-19-2010 02:03 PM
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).
07-19-2010 02:11 PM
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.
07-19-2010 02:12 PM
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.
03-06-2012 06:39 AM
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
03-06-2012 09:31 AM
'But to no avail' really does not explain exactly what you did and why it does not work. Attach your code.
03-06-2012 10:32 PM
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